Expand Callback Function

Both gsm and 3G gateway support to expand callback function, but you need config it in SSH way.

Please follow steps below:

Step 1:  define gsm channel entry:

root@Openvox-Wireless-Gateway:~# cd /etc/asterisk/
root@Openvox-Wireless-Gateway:~/memcfg/etc/asterisk# vi chan_extra.conf

#include extra-global.conf 
;#include extra-channels.conf  

#include extra-channels_custom.conf   //change default extra-channles to custom channels entry

root@Openvox-Wireless-Gateway:~/memcfg/etc/asterisk# cp extra-channels.conf extra-channels_custom.conf
root@Openvox-Wireless-Gateway:~/memcfg/etc/asterisk# vi extra-channels_custom.conf
group=1 
;context=gsm-1     //default calls go to [gsm-1] context in extensions_routing.conf
context=gsm-custom-1     //
//Now leading calls go to [gsm-custom-1] context in extensions_custom.conf
signalling = gsm 
vol=70 
mic=1 
dacgain=-15 
adcgain=-3 
debugat=on 
gsm_ec=off 
anonymouscall=off 
call_waiting=off 
.......
.......

step 2: Modify asterisk.conf to change dirrectory of agi

[directories]

astetcdir => /etc/asterisk
astmoddir => /usr/lib/asterisk/modules
astvarlibdir => /usr/lib/asterisk
astagidir => /etc/asterisk/agi-bin
astspooldir => /tmp/media/spool/asterisk
astrundir => /var/run
astlogdir => /tmp/log/asterisk
astdatadir => /etc/asterisk

 

step 3: Creat your own Dialpan:

Such as: any incoming call from gsm-1.1 will be hangup, gsm gateway will automatically callback through gsm-1.1 and connect the caller with sip ext 1001.

[gsm-custom-1]
exten => s,1,Set(DESTINATION=${CALLERID(num)})
exten => s,n,Noop(===========incoming call=============)
exten => s,n,hangup()
exten => h,1,Noop(=======call back start=========)
exten => h,n,DeadAGI(callback.php,${DESTINATION},"1001",gsm-callback.s.1,20)   ;1001 is  sip ext 
exten => h,n,Hangup()

[gsm-callback]
exten => s,1,Noop(====${CALLERID(num)}====)
exten => s,n,Dial(EXTRA/1/${CALLERID(num)})      ;using port gsm-1.1 to callback
exten => s,n,Hangup()

Please upload files below to your gsm gateway. Put them in this directory:  /etc/asterisk/agi-bin

phpagi-asmanager.php

phpagi.php

callback.php

 

Notice: As all confiugration is stored in RAM, so you need to run a tool to write them into files, otherwise all configuration will be lost once reboot.                                                                                
root@Openvox-Wireless-Gateway:~/memcfg/etc/asterisk# /my_tools/sync2flash