Skip to content

Instantly share code, notes, and snippets.

@fagnersilva
Last active April 3, 2017 19:19
Show Gist options
  • Save fagnersilva/25c5a77f90caa301e1b89b9ac5980b8e to your computer and use it in GitHub Desktop.
Save fagnersilva/25c5a77f90caa301e1b89b9ac5980b8e to your computer and use it in GitHub Desktop.
pjsip_populating <PosrtgreSQL_9.5>
DELETE FROM ps_aors;
DELETE FROM ps_auths;
DELETE FROM ps_endpoints;
INSERT INTO ps_auths (id, auth_type, password, username)
SELECT
'7999'::integer + row_number() OVER () ,
'userpass',
'7999'::integer + row_number() OVER () ,
'7999'::integer + row_number() OVER ()
from
information_schema.columns c
LIMIT 20;
insert into ps_endpoints (id, transport, aors, auth, context, disallow, allow, direct_media)
SELECT
'7999'::integer + row_number() OVER () ,
'transport-udp',
'7999'::integer + row_number() OVER () ,
'7999'::integer + row_number() OVER (),
'default',
'all',
'alaw,ulaw',
'no'
FROM information_schema.columns c
LIMIT 20;
insert into ps_aors (id, max_contacts)
SELECT
'7999'::integer + row_number() OVER () ,
'2'
FROM information_schema.columns c
LIMIT 20;
SELECT * FROM ps_aors;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment