# Database Integration for SIP,Extensions

**URL:** <https://community.asterisk.org/t/database-integration-for-sip-extensions/82591>\
**Category:** Asterisk SIP\
**Created:** [February 5, 2020, 11:46am UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591 "2020-02-05T11:46:22Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Santanu](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Santanu](https://community.asterisk.org/u/Santanu)\
**Post date:** [February 5, 2020, 11:46am UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591/1 "2020-02-05T11:46:22Z")

</div>

I have created a table for sip.conf.

CREATE TABLE `sip_friends` (  
`name` VARCHAR(40) NOT NULL DEFAULT ‘’,  
`username` VARCHAR(40) NULL DEFAULT ‘’,  
`secret` VARCHAR(40) NOT NULL DEFAULT ‘’,  
`context` VARCHAR(40) NOT NULL DEFAULT ‘’,  
`ipaddr` VARCHAR(20) NOT NULL DEFAULT ‘’,  
`port` INT(6) NOT NULL DEFAULT ‘0’,  
`regseconds` INT(11) NOT NULL DEFAULT ‘0’,  
PRIMARY KEY (`name`)  
)

i have installed and configured ODBC. I am using MySQL database.  
Along with that i have made entries in extconfig.conf:  
sip.conf =\> odbc,asterisk,sip\_friends  
But asterisk real time is not working. unable to login with voip client.  
What else i need to do?

---

<div class="post-metadata">

**Author:** ![bford](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/bford/32/3704_2.png) [@bford](https://community.asterisk.org/u/bford)\
**Post date:** [February 5, 2020, 6:31pm UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591/2 "2020-02-05T18:31:42Z")

</div>

Do you have your **odbc.ini** and **odbcinst.ini** files set up correctly? Can you confirm that you can establish a connection using ODBC? The following wiki page might be helpful: [https://wiki.asterisk.org/wiki/display/AST/Getting+Asterisk+Connected+to+MySQL+via+ODBC](https://wiki.asterisk.org/wiki/display/AST/Getting+Asterisk+Connected+to+MySQL+via+ODBC)

---

<div class="post-metadata">

**Author:** ![Santanu](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Santanu](https://community.asterisk.org/u/Santanu)\
**Post date:** [February 6, 2020, 6:12am UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591/3 "2020-02-06T06:12:01Z")

</div>

Yes i have configured odbc. kindly go through the screenshots attached.  
Do i need to configure anything else?  
 ![odbc show all](https://global.discourse-cdn.com/asterisk/original/2X/c/c5178b8703f257be564bf0b7094b5d8f5e6b691f.png)

![odbcini](https://global.discourse-cdn.com/asterisk/original/2X/5/5e844400f06f5dae0997dfda32d362aaa1519e47.png)

![odbcini2](https://global.discourse-cdn.com/asterisk/original/2X/f/fe84efed6bd92ddf48270175da394a0ea512632b.png)

---

<div class="post-metadata">

**Author:** ![kharwell](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/kharwell/32/1924_2.png) [@kharwell](https://community.asterisk.org/u/kharwell)\
**Post date:** [February 7, 2020, 12:03am UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591/4 "2020-02-07T00:03:22Z")

</div>

> [@Santanu](#):
>
> But asterisk real time is not working. unable to login with voip client.

how do you know realtime is the problem? What do you mean by “login with voip client”? It won’t register? Can’t make a call?

Have you looked at the Asterisk log? Any warnings or errors of note?

---

<div class="post-metadata">

**Author:** ![Santanu](https://avatars.discourse-cdn.com/v4/letter/s/6a8cbe/32.png) [@Santanu](https://community.asterisk.org/u/Santanu)\
**Post date:** [February 24, 2020, 2:15pm UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591/5 "2020-02-24T14:15:03Z")

</div>

Thank you for your answer.  
Yes i have configured odbc.ini and odbcinst.ini. they are as follows:

```auto
[asterisk-connector]
Description=MySQL connection to 'asterisk' database
Driver=MySQL
Database=asterisk
Server=localhost
user=root
password=voip123
#;Server=178.63.254.99
Port=3306
Socket=/var/lib/mysql/mysql.sock

```

```auto
# Driver from the mysql-connector-odbc package
# Setup from the unixODBC package
[MySQL]
Description = ODBC for MySQL
Driver = /usr/lib/libmyodbc5.so
Setup = /usr/lib/libodbcmyS.so
Driver64 = /usr/lib64/libmyodbc5.so
Setup64 = /usr/lib64/libodbcmyS.so
FileUsage = 1
Pooling = Yes
"odbcinst.ini" 24L, 628C

```

From Asterisk CLI “odbc show all” returning as follows

```auto
srv*CLI> odbc show all

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

  Name: root
  DSN: asterisk-connector
    Number of active connections: 1 (out of 1)
    Logging: Disabled

```

I have also configured extconfig.conf

```auto
[settings]

;sip.conf => MySQL,root,bit_sipfriends
sippeers => odbc,root,sipfriends
extensions => odbc,root,bit_extensions_table

```

After doing all these setting the connection with asterisk server is not working. When i am trying to login from a mobile app it’s not working.

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/asterisk/original/2X/4/475d0c889911cfb84ac4881ad6df8b523e3f9105.png) [@system](https://community.asterisk.org/u/system)\
**Post date:** [March 25, 2020, 2:15pm UTC](https://community.asterisk.org/t/database-integration-for-sip-extensions/82591/6 "2020-03-25T14:15:10Z")

</div>

Closed on March 25, 2020, 2:15pm UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
