SMS callback for Asterisk

this article was originally published in

SMS Callback for Asterisk PBX
SMS callback allows you to eliminate dtmf detection problems and inconvenience when using a callback solution. In this section I will show a generic example for accepting SMS messages and using them as a trigger for asterisk callback call.
For the integration of the sms gateway with asterisk server we will use Hypermedia SMS Server module to accept the SMS messages and open url in which the asterisk manager originate command will reside.
Hypermedia SMS Server Configuration
edit smsgw.ini:


Hypermedia SMS server will open the url for each incoming SMS. Do not forget to select allow SMS triggers for the modules in HMC.
Web page code
edit receivesms.php:
include "phpagi.php";
$callback_number = $_REQUEST['number'];
$destination_number = trim($_REQUEST['message']," ");
$unicode = $_REQUEST['unicode'];

if ($unicode=="8"){
if (substr($str,0,3)=="003"){

$agiManager = new AGI_AsteriskManager();
$manager = $agiManager->connect("","user","pasword");
if (!$manager) {
syslog(LOG_ERR, "Connection to Asterisk Manager Failed");
die("Connection to Asterisk Manager Failed");
} else {
$astVariable=array (
foreach ($astVariable as $variable) {
$eventData['Variable'].="Variable: ".$variable."\r\n";

Asterisk Dialplan
edit extensions.conf and add the following:

exten => _X.,1,answer
exten => _X.,n,dial(sip/hmgw/${destination_number})

edit sip.conf and add the following for using HG trunk:


more information about 1telecom solutions >>

Copyright © 2008 1Telecom Ltd

SMS Callback Software

  • MobiSnow VoIP SMS callback an android app enabled your regular Android phone to a SMS callback gateway. Small and easy application for VoIP Providers.

See also

Created by: liorm, Last modification: Sun 06 of Apr, 2014 (23:19 UTC) by admin
Please update this page with new information, just login and click on the "Edit" or "Discussion" tab. Get a free login here: Register Thanks! - Find us on Google+