Hello.
Sorry for my english.
I setup Asterisk 13.19.0 on CentOS7 with ODBC and PostgreSQL 9.6. I configured PJSIP realtime connection throught ODBC to PostgreSQL. The is my configuration files:
res_odbc.conf
[pgsql]
enabled => yes
dsn => dnsPgSQL
username => asterisk
password => <my_password>
pre-connect => yes
sanitysql => select 1
connect_timeout => 10
share_connections => yes
sorcery.conf
[res_pjsip]
endpoint=realtime,ps_endpoints
endpoint=config,pjsip.conf,criteria=type=endpoint
auth=realtime,ps_auths
auth=config,pjsip.conf,criteria=type=auth
aor=realtime,ps_aors
aor=config,pjsip.conf,criteria=type=aor
domain_alias=realtime,ps_domain_aliases
contact=realtime,ps_contacts[res_pjsip_endpoint_identifier_ip]
identify=realtime,ps_endpoint_id_ips
extconfig.conf
ps_endpoints => odbc,pgsql
ps_auths => odbc,pgsql
ps_aors => odbc,pgsql
ps_domain_aliases => odbc,pgsql
ps_endpoint_id_ips => odbc,pgsql
ps_contacts => odbc,pgsql
ps_endpoint_id_ips => odbc,pgsql
ODBC connection working well
CLI> odbc show all
ODBC DSN SettingsName: pgsql
DSN: dnsPgSQL
Last connection attempt: 1970-01-01 03:00:00
Number of active connections: 1 (out of 1)
In pjsip.conf file I create static transport to use for all endpoints (static and realtime).
Realtime tables was created in PostgreSQL by alembic script. I populate tables ps_endpoints, ps_aors, ps_auth manualy with some data for test endpoints. My test endpoints can connect and register on asterisk and I have messages in CLI
CLI>
â Added contact âsip:XXX@AAA.BBB.CCC.DDD:45387;transport=UDP;rinstance=0a0d4ddc3e1fe4eaâ to AOR âXXXâ with expiration of 60 seconds
== Contact XXX/sip:XXX@AAA.BBB.CCC.DDD:45387;transport=UDP;rinstance=0a0d4ddc3e1fe4ea has been created
== Endpoint XXX is now Reachable
â Contact XXX/sip:XXX@AAA.BBB.CCC.DDD:45387;transport=UDP;rinstance=0a0d4ddc3e1fe4ea is now Unknown. RTT: 0.000 msec
where AAA.BBB.CCC.DDD is IP address of endpoint with name XXX.
Then I do âshow contactsâ i get
CLI> pjsip show contacts
Contact: <Aor/ContactUriâŚ> <HashâŚ> <RTT(ms)âŚ>Contact: XXX/sip:XXX@AAA.BBB.CCC.DDD:45387;transport=UD b00258b3e8 Unknown nan
So all seems works fine.
The question is - There in PostgreSQL data tables i can find IP address of registered endpoints? To be clear - I want to get from data table IP address AAA.BBB.CCC.DDD for endpoint XXX. In Asteris version 11 with chan_sip and realtime odbc, after endpoint registration on asterisk server ip address was updated in fiel ipaddr of sip table. Where can I find such data in Asterisk 13 with realtime pjsip connetion to PostgreSQL thhrought ODBC?
Thanks for any help.