asterisk2billing.org
http://forum.asterisk2billing.org/

Asterisk ODBC works, but I can't get SIP Realtime working
http://forum.asterisk2billing.org/viewtopic.php?f=33&t=12562
Page 1 of 1

Author:  gromm [ Thu Jul 28, 2016 11:04 pm ]
Post subject:  Asterisk ODBC works, but I can't get SIP Realtime working

Hi Everyone.

I'm trying to get Asterisk Realtime to work for SIP users, using the A2Billing cc_sip_buddies table in MySQL, using the ODBC connector (ODBC seems to be the only way to go with versions of Asterisk newer than 11, and we're going with 13.1).

So far, I've gotten Asterisk to recognise the ODBC configuration and I can see this:

Code:
template25*CLI> odbc show all

ODBC DSN Settings
-----------------

  Name:   asterisk
  DSN:    asterisk-connector
    Last connection attempt: 1969-12-31 16:00:00
  Pooled: No
  Connected: Yes


but reloading the SIP driver doesn't show me any of the SIP peers in MySQL, just the ones in the flat files.

This is my configuration so far:

odbc.ini:
Code:
[asterisk-connector]
#Driver       = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Driver  = MySQL
Description  = MyODBC 3.51 Driver DSN
SERVER       = 127.0.0.1
PORT         =
USER         = a2billinguser
Password     = Pdj2sjhah#
Database     = mya2billing2
OPTION       = 3
SOCKET       = /var/run/mysqld/mysqld.sock
Port = 3306


odbcinst.ini:
Code:
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/x86_64-linux-gnu/odbc/libmyodbc.so
Setup = /usr/lib/x86_64-linux-gnu/odbc/libodbcmyS.so
FileUsage = 1


res_odbc.conf:
Code:
[asterisk]
enabled => yes
dsn => asterisk-connector
pre-connect => yes


extconfig.conf:
Code:
[settings]
sippeers => odbc,asterisk,cc_sip_buddies
sipusers => odbc,asterisk,cc_sip_buddies


Hopefully I'm not missing anything.

Author:  gromm [ Thu Jul 28, 2016 11:41 pm ]
Post subject:  Re: Asterisk ODBC works, but I can't get SIP Realtime working

FYI, I can further demonstrate that ODBC is working within asterisk by executing the following from the Asterisk CLI:

Code:
template25*CLI> odbc read ODBC_SQL "select context from cc_sip_buddies limit 5" exec
context               suspended
----------            ----------
context               edmonton
----------            ----------
context               suspended
----------            ----------
context               suspended
----------            ----------
context               vancouver
Returned 5 rows.  Query executed on handle 0 [asterisk]

Author:  vulcan [ Fri Aug 26, 2016 2:57 pm ]
Post subject:  Re: Asterisk ODBC works, but I can't get SIP Realtime working

If ODBC config is ok you can still call them. To be able to see them use "rtcachefriends=yes" in sip.conf then "sip show peers" from cli.

Page 1 of 1 All times are UTC
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group
http://www.phpbb.com/