# Database integration

**URL:** <https://community.asterisk.org/t/database-integration/15185>\
**Category:** Asterisk General\
**Created:** [June 21, 2007, 5:12pm UTC](https://community.asterisk.org/t/database-integration/15185 "2007-06-21T17:12:15Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![Pull](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@Pull](https://community.asterisk.org/u/Pull)\
**Post date:** [June 21, 2007, 5:12pm UTC](https://community.asterisk.org/t/database-integration/15185/1 "2007-06-21T17:12:15Z")

</div>

How can I integrate a database (SQL server) of a program with asterisk or the asterisk database?  
Please help me…

---

<div class="post-metadata">

**Author:** ![mbruni](https://avatars.discourse-cdn.com/v4/letter/m/ecccb3/32.png) [@mbruni](https://community.asterisk.org/u/mbruni)\
**Post date:** [June 22, 2007, 10:33am UTC](https://community.asterisk.org/t/database-integration/15185/2 "2007-06-22T10:33:00Z")

</div>

You may use a php agi script do do that.

Regards.

---

<div class="post-metadata">

**Author:** ![mudslide567](https://avatars.discourse-cdn.com/v4/letter/m/5daacb/32.png) [@mudslide567](https://community.asterisk.org/u/mudslide567)\
**Post date:** [June 22, 2007, 5:36pm UTC](https://community.asterisk.org/t/database-integration/15185/3 "2007-06-22T17:36:34Z")

</div>

To enable asterisk to access SQL Server, you would need some sort of ODBC SQL Server Driver and, as far as I know, there are none for linux.

---

<div class="post-metadata">

**Author:** ![alexis](https://avatars.discourse-cdn.com/v4/letter/a/838e76/32.png) [@alexis](https://community.asterisk.org/u/alexis)\
**Post date:** [June 22, 2007, 6:35pm UTC](https://community.asterisk.org/t/database-integration/15185/4 "2007-06-22T18:35:56Z")

</div>

It depends on what you what to do and what kind of SQL-Server you have.(Ms-Sql,Oracle,postgres ,mysql ???). If its mysql its very easy :  
[voip-info.org/wiki/view/Asterisk+cmd+MYSQL](http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL). And you can do it directly via the Dialplan. For the other SQL server i would to a php script .

---

<div class="post-metadata">

**Author:** ![meral](https://avatars.discourse-cdn.com/v4/letter/m/51bf81/32.png) [@meral](https://community.asterisk.org/u/meral)\
**Post date:** [June 24, 2007, 12:04am UTC](https://community.asterisk.org/t/database-integration/15185/5 "2007-06-24T00:04:53Z")

</div>

for postgreSQL i just wrote and app\_getpgsql, wich return result in vars.  
so for any another database it can be rewrited so.

---

<div class="post-metadata">

**Author:** ![pratik.kotkar](https://avatars.discourse-cdn.com/v4/letter/p/ac8455/32.png) [@pratik.kotkar](https://community.asterisk.org/u/pratik.kotkar)\
**Post date:** [July 11, 2007, 11:19pm UTC](https://community.asterisk.org/t/database-integration/15185/6 "2007-07-11T23:19:01Z")

</div>

Either write an app…Or use PHP AGI script incase you are already comfortable with PHP and using it with MySQL…

---

<div class="post-metadata">

**Author:** ![zaib\_kiani](https://sea1.discourse-cdn.com/asterisk/user_avatar/community.asterisk.org/zaib_kiani/32/9558_2.png) [@zaib\_kiani](https://community.asterisk.org/u/zaib_kiani)\
**Post date:** [November 29, 2008, 8:27am UTC](https://community.asterisk.org/t/database-integration/15185/7 "2008-11-29T08:27:12Z")

</div>

Hi,

any developement?

i want to integrate my cdr in MS-SQL… currentaly i am using mysql table and i want to shift at MS-SQL server… is anyone has done this?

---

<div class="post-metadata">

**Author:** ![jmcateer](https://avatars.discourse-cdn.com/v4/letter/j/c57346/32.png) [@jmcateer](https://community.asterisk.org/u/jmcateer)\
**Post date:** [January 12, 2009, 3:50pm UTC](https://community.asterisk.org/t/database-integration/15185/8 "2009-01-12T15:50:50Z")

</div>

all,

To connect to Microsoft SQL Server from withing Asterisk, you will need to look into FreeTDS. Here is a link with some relevant information: [voip-info.org/wiki/view/FreeTDS](http://www.voip-info.org/wiki/view/FreeTDS)

Thank You,  
Justin McAteer  
Out of the Blocks Consulting, LLP

---

<div class="post-metadata">

**Author:** ![Charu\_Kanzehr](https://avatars.discourse-cdn.com/v4/letter/c/e480ec/32.png) [@Charu\_Kanzehr](https://community.asterisk.org/u/Charu_Kanzehr)\
**Post date:** [May 22, 2009, 10:11am UTC](https://community.asterisk.org/t/database-integration/15185/9 "2009-05-22T10:11:48Z")

</div>

Visit the following link if you are interested in integrating Asterisk with Oracle Database:  
[forums.digium.com/viewtopic.php? … ght=oracle](http://forums.digium.com/viewtopic.php?t=68273&highlight=oracle)

---

<div class="post-metadata">

**Author:** ![cuban\_cigar](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@cuban\_cigar](https://community.asterisk.org/u/cuban_cigar)\
**Post date:** [July 2, 2009, 11:29pm UTC](https://community.asterisk.org/t/database-integration/15185/10 "2009-07-02T23:29:50Z")

</div>

Guys, its fair to point out that microsoft operating system / products / sql server does not belong in a business environment.

Please get a unix / linux variant so the world isn’t plagued by your infested botnets.

thanks,

---

<div class="post-metadata">

**Author:** ![cuban\_cigar](https://avatars.discourse-cdn.com/v4/letter/c/da6949/32.png) [@cuban\_cigar](https://community.asterisk.org/u/cuban_cigar)\
**Post date:** [July 2, 2009, 11:30pm UTC](https://community.asterisk.org/t/database-integration/15185/11 "2009-07-02T23:30:53Z")

</div>

[quote=“cuban\_cigar”]Guys, its fair to point out that microsoft operating system / products / sql server do not belong in a production environment.

Please get a unix / linux variant so the world isn’t plagued by your infested botnets.

thanks,[/quote]
