=============================================================================== === Data24-7 AGI API === =============================================================================== IMPORTANT NOTE: The Asterisk AGI package that goes with this document (found on Data24-7's "integrations" web page) is a big library which gives Asterisk users access to all of the Data24-7 services. These include carrier lookup, IP address lookup, phone append, CNAM, etc. IF ALL YOU WANT IS CNAM, you'll probably be better-off downloading our much simpler CNAM AGI script, which you can find here: http://www.data24-7.com/agi/id24-7.agi ------------------------------------------------------------------------------- --- WHAT IS Data24-7 API ? ------------------------------------------------------ --Data24-7 API is an AGI module written to integrate the Data24-7 web api to Asterisk Dialplan. This API allow a https based integration with Data24-7 web api. For more detail about data24-7 you can visit at: http://www.data24-7.com ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Description ----------------------------------------------- --This API allow Asterisk Dialplan to access Data24-7 web api. The data is fetched using https connection. The retrieved data is saved in channel variables and can be further used in call processing or CRM integation. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Dependencies ----------------------------------------------------------- --This API is written on using https connectivity to Data24-7 server. curl request is made to fetch the details. So dependncies are as follows * HTTP/HTTPS support * curl support ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Installation ----------------------------------------------------------- --Please follow the below mention steps to integrate the Data24-7 into the Asterisk Telephony. 1. tar -xvvf Data24-7.XX.tar.gz /var/lib/asterisk/agi-bin/ We need to untar the Data24-7.XX.tar.gz to agi-bin directory 2. mv /var/lib/asterisk/agi-bin/Data24-7.XX /var/lib/asterisk/agi-bin/Data24-7 Either move or change the name of Data24-7.XX Directory to Data24-7 3. chmod 777 -R /var/lib/asterisk/agi-bin/Data24-7 Change permission so that file can be executed by asterisk. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- ABOUT CONFIGURATION FILES ------------------------------------------------- --We need to set the configuration parameter in config.php. The location of the file is Data24-7/config/config.php. Username, Password and URL can be modified from the config file. Debug flag can be enable to capture HTTP Requets Response. The logs will be captured in Data24-7/logs/ directory. A help file for integating the API in dialplan is provided. extensions.conf You can use the mentioned examples for integration. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- List Of API ----------------------------------------------------------- Total 6 API support is given in version 1.0. The list of API are * caller_id * carrier_info * phone_append * email_append * reverse_phone * ip_geolocation ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- API DETAILS ----------------------------------------- --caller_id : This api accepts phone number passed by dialplan as argument and returns the name of the caller. On success return the status flag ${DP_STATUS} is set to 1 and caller name is set in ${DP_NAME} On failure return the status flag ${DP_STATUS} is set to 0 and failure reason is set in ${DP_FAILURE} e.g. exten=>s,n,AGI(Data24-7/Data24-7.php,caller_id,7818640108) exten=>s,n,NoOP(${DP_STATUS}---${DP_NAME}) --carrier_info : This api accepts phone number passed by dialplan as argument and return the carrier name, wireless flag (y/n), sms gateway address and mms gateway address On success return the status flag ${DP_STATUS} is set to 1 and carrier name, wireless flag, sms gateway address and mms gateway address is set in ${DP_CARRIER_NAME},${DP_WIRELESS},${DP_SMS_ADDRESS} ${DP_MMS_ADDRESS} On failure return the status flag ${DP_STATUS} is set to 0 and failure reason is set in ${DP_FAILURE} e.g. exten=>s,n,AGI(Data24-7/Data24-7.php,carrier_info,7818640108) exten=>s,n,NoOP(${DP_STATUS}---${DP_WIRELESS}---${DP_CARRIER_NAME}---${DP_SMS_ADDRESS}---${DP_MMS_ADDRESS}) --phone_append : This api accepts firstname,lastname,address,city,state,zip passed by dialplan as argument and returns the associated phone number On success return the status flag ${DP_STATUS} is set to 1 and phone number set to ${DP_PHONE} On failure return the status flag ${DP_STATUS} is set to 0 and failure reason is set in ${DP_FAILURE} e.g. exten=>s,n,AGI(Data24-7/Data24-7.php,phone_append,Marc,Orenberg,"24 Danforth Way","Franklin","MA",02038) exten=>s,n,NoOP(${DP_STATUS}---${DP_PHONE}) --email_append : This api accepts firstname,lastname,address,city,state,zip passed by dialplan as argument and returns the associated email address On success return the status flag ${DP_STATUS} is set to 1 and Email is set to ${DP_EMAIL} On failure return the status flag ${DP_STATUS} is set to 0 and failure reason is set in ${DP_FAILURE} e.g. exten=>s,n,AGI(Data24-7/Data24-7.php,email_append,Sandra,Valentine,"5491 Lockhaven Drive","Buena Park","California",) exten=>s,n,NoOP(${DP_STATUS}---${DP_EMAIL}) --reverse_phone : This api accepts a phone number passed by dialplan as argument and returns the associated name and address On success return the status flag ${DP_STATUS} is set to 1 and name is set to ${DP_NAME} and address is set to ${DP_ADDRESS} On failure return the status flag ${DP_STATUS} is set to 0 and failure reason is set in ${DP_FAILURE} e.g. exten=>s,n,AGI(Data24-7/Data24-7.php,reverse_phone,17818640108) exten=>s,n,NoOP(${DP_STATUS}---${DP_NAME}---${DP_ADDRESS}) --ip_geolocation : This api accepts a phone number passed by dialplan as argument and returns the associated location and latitude longitude On success return the status flag ${DP_STATUS} is set to 1 and location is set to ${DP_LOCATION} and latitude longitude is set to ${DP_LATITUDE_LONGITUDE} On failure return the status flag ${DP_STATUS} is set to 0 and failure reason is set in ${DP_FAILURE} e.g. exten=>s,n,AGI(Data24-7/Data24-7.php,ip_geolocation,123.45.67.89) exten=>s,n,NoOP(${DP_STATUS}---${DP_LOCATION}---${DP_LATITUDE_LONGITUDE}) ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Data24-7 Vicidial API ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Description ----------------------------------------------- --This API allow Vicidial Agent UI to access Data24-7 web api. The data is fetched using https connection. The retrieved data is passed to UI for api applications. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- Installation ----------------------------------------------------------- --Please follow the below mention steps to integrate the Data24-7 into the Asterisk Telephony. 1. tar -xvvf Data24-7-Vicidial.XX.tar.gz 2. mv Data24-7 /var/www/html/agc/data24-7 Either move or change the name of Data24-7.XX Directory to Data24-7 3. chmod 755 -R /var/www/html/agc/data24-7 Change permission so that file can be executed by Vicidial In Vicidia Admin pannel Create a Script VICIDIAL Use VICIDIAL script in Campaign or List to get the Data24-7 widget for Dat24-7 API integration. ------------------------------------------------------------------------------- ------------------------------------------------------------------------------- --- MORE INFORMATION ---------------------------------------------------------- ------------------------------------------------------------------------------- --- Data24-7 -------------------------------------------------------------------------------