Hello, recently I’m trying to move from sip to PjSip. I’m on a 13.11.2 Asterisk with realtime Postgresql using ODBC, will paste some configs after a short explanation.
To get started with PJSip I configured it statically, without any changes on sorcery.conf or pjsip_wizard.conf, all endpoits direct on pjsip.conf and it worked like a charm. (with a clean asterisk install, without odbc yet)
Then I configured ODBC and enabled res_odbc module, and without even configuring my database tables on sorcery.conf and extconfic.conf all my static endpoints lost their object “aor” and cannot register anymore.
The most strange thing is that if I change “enable => no” in res_odbc.conf they get the “aor” configuration once again and are able to register.
I’m on a Debian GNU/Linux 8.9 (jessie)
I installed asterisk with ./configure --with-pjproject-bundled command and confirmed that all pjsip resources were there while ‘make menuconfig’.
ODBC installed packages and configuration files:
dpkg -l | grep odbc
ii libodbc1:amd64 2.3.1-3 amd64 ODBC library for Unix
ii odbc-postgresql:amd64 1:10.00.0000-1.pgdg80+1 amd64 ODBC driver for PostgreSQL
ii odbcinst 2.3.1-3 amd64 Helper program for accessing odbc ini files
ii odbcinst1debian2:amd64 2.3.1-3 amd64 Support library for accessing odbc ini files
ii unixodbc 2.3.1-3 amd64 Basic ODBC tools
ii unixodbc-dev 2.3.1-3 amd64 ODBC libraries for UNIX (development files)
cat /etc/odbcinst.ini
[PostgreSQL]
Description = ODBC para Postgresql
Driver = /usr/lib/x86_64-linux-gnu/odbc/psqlodbca.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcpsqlS.so
FileUsage = 1
cat /etc/odbc.ini
[asterisk]
Description = ODBC pro Asterisk
Driver = PostgreSQL
Trace = 1
TraceFile = /tmp/tracepsqlodbc.txt
Database = integrador
Servername = localhost
UserName = root
Password = myPassword
Port = 5432
ReadOnly = No
RowVersioning = No
ShowSystemTables = No
ShowOidColumn = No
FakeOidIndex = No
ConnSettings =
ODBC connection is just fine:
isql asterisk
+---------------------------------------+
| Connected! |
| |
| sql-statement |
| help [tablename] |
| quit |
| |
+---------------------------------------+
SQL>
Asterisk config files involved:
cat /etc/asterisk/res_odbc.conf
[asterisk]
enabled => yes
dsn => asterisk
pre-connect => yes
;username => root
;password => myPassword
cat /etc/asterisk/pjsip.conf
; Basic UDP transport
;
[transport-udp]
type=transport
protocol=udp ;udp,tcp,tls,ws,wss
bind=0.0.0.0[7000]
type=endpoint
context=internal
disallow=all
allow=ulaw
transport=transport-udp
auth=7000
aors=7000[7000]
type=auth
auth_type=userpass
password=7000
username=7000[7000]
type=aor
max_contacts=1
The only error that I’m aware of receiving when enabling res_odbc is this when I start asterisk:
[Out 17 15:11:42] ERROR[4548]: config_options.c:877 aco_set_defaults: Unable to set default for 7000, qualify_timeout=3.0
[Out 17 15:11:42] ERROR[4548]: res_sorcery_config.c:317 sorcery_config_internal_load: Could not create an object of type 'aor' with id '7000' from configuration file 'pjsip.conf'
*CLI> pjsip show endpoints
Endpoint: <Endpoint/CID.....................................> <State.....> <Channels.>
I/OAuth: <AuthId/UserName...........................................................>
Aor: <Aor............................................> <MaxContact>
Contact: <Aor/ContactUri..........................> <Hash....> <Status> <RTT(ms)..>
Transport: <TransportId........> <Type> <cos> <tos> <BindAddress..................>
Identify: <Identify/Endpoint.........................................................>
Match: <ip/cidr.........................>
Channel: <ChannelId......................................> <State.....> <Time.....>
Exten: <DialedExten...........> CLCID: <ConnectedLineCID.......>
==========================================================================================
Endpoint: 7000 Unavailable 0 of inf
InAuth: 7000/7000
Transport: transport-udp udp 0 0 0.0.0.0:5060
*CLI> pjsip show auths
I/OAuth: <AuthId/UserName.............................................................>
==========================================================================================
Auth: 7000/7000
*CLI> pjsip show aors
No objects found.
When I try to register a softphone using endpoint 7000:
[Out 17 16:07:53] WARNING[4971]: res_pjsip_registrar.c:664 find_registrar_aor: AOR '7000' not found for endpoint '7000'
Thats the infos and configs I have in mind to be important now, if someone needs anything else just tell me!
Thanks in advance.