Asterisk/Trixbox/FreePBX Integration

From Data24-7 Wiki

Jump to: navigation, search

Data24-7's ID24-7 service can be used with your existing Asterisk / FreePBX / Trixbox installation.

First create an account with Data24-7, and make note of your username and API password. Then follow the instructions below:

Adding ID24-7 to Trixbox or FreePBX:

The following was last tested with FreePBX 2.7.0.5:

1.  From the main screen choose the "Setup" tab on the left-hand menu.

2.  Under "Inbound Call Control", click "CallerID Lookup Sources"

3.  On the right-hand side of the screen, click "Add CID Lookup Source"

4.  For "Source Description" enter "Data24-7"

5.  For "Source Type", choose "HTTP"

6.  For "Host", enter "api.data24-7.com"

7.  For "Path", enter "/astid.php"

8.  For "Query", enter "username=MYUSER&password=MYPASS&p=[NUMBER]", but replace MYUSER and MYPASS with your Data24-7 username and API password.

9.  Leave "Port", "Username", and "Password" blank, and leave "Cache" unchecked.

10. Click "Submit Changes"

11. In the "Setup" tab on the left-hand menu, click "Inbound Routes"

12. From the right-hand menu, choose your existing inbound route (or create one)

13. Under "CID Lookup Source", set "Source" to "Data24-7"

14. Click the "Submit" button

15. At the top of the screen, click "Apply Configuration Changes"

Troubleshooting: If you are not getting caller id back, it could be because func_curl.so doesn't exist in your /usr/lib/asterisk/modules/ directory. To remedy this, make sure you have curl and curl-devel installed on your server, and recompile Asterisk. If this is not possible (for example, if you installed Asterisk from binaries), you can use the method below instead:

Adding ID24-7 to your Asterisk Dialplan

Add the following to your Asterisk dialplan for inbound calls:

1. On your Asterisk server, navigate to the /var/lib/asterisk/agi-bin/ directory.

2. Look for phpagi.php. If you don't have it, get it here: http://sourceforge.net/projects/phpagi/

3. Enter the following on the command line to retrieve the id24-7.agi script:  "wget http://www.data24-7.com/agi/id24-7.agi"

4. Edit this script, and change DATA247_USERNAME and DATA247_PASSWORD to your Data24-7 username and API password.

5. In your dialplan, after you answer an inbound call, add an AGI call to this script, like in the example below:

	exten => _1NXXNXXXXXX,1,Answer
	exten => _1NXXNXXXXXX,2,AGI(id247.agi)

Try placing an inbound call; the caller ID should now be populated into Asterisk's CALLERID(name) variable.

Troubleshooting: If an agi file gets edited in a Windows environment, it may not work properly on your Asterisk server. To fix this, us the dos2unix command to convert the file back to Linux format.

Personal tools