;Outbound calling / Authentication
exten => _X.,1,Set(gateway=${CALLERID(num)})
exten => _X.,n,Answer
exten => _X.,n,Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1})
exten => _X.,n,Read(USERKEY,shipsat/enter-pin-number,10)
exten => _X.,n,Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)})
exten => _X.,n,Set(CDR(accountcode)=${USERKEY})
exten => _X.,n,Set(CDR(userfield)=${BOXID}@${GW_ID})
;exten => _X./8554,n,Set(CALLERID(num)=85258192231)
exten => _X.,n,AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN})
exten => _X.,n,Hangup(18) ;Check script fails
commenting out the X/8554 fixed It but I’d like to understand why.
here is the dialplan before commenting out.
[ Context ‘app_dial_gosub_virtual_context’ created by ‘app_dial’ ]
‘s’ => 1. NoOp() [app_dial]
[ Context ‘parkedcalls’ created by ‘features’ ]
‘700’ => 1. Park() [features]
[ Context ‘DirectCall’ created by ‘pbx_config’ ]
‘makecallEMC’ => 1. NoOp( DialOut ${DST1} ) [pbx_config]
2. Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC})) [pbx_config]
3. Hangup() [pbx_config]
[ Context ‘shipsat’ created by ‘pbx_config’ ]
‘19546727881’ => 1. Set(DSTNUM=${EXTEN}) [pbx_config]
2. Set(CALID=${CALLERID(num)}) [pbx_config]
3. Dial(SIP/8556) [pbx_config]
4. Hangup() [pbx_config]
‘600’ => 1. Playback(demo-echotest) [pbx_config]
2. Echo() [pbx_config]
3. Playback(demo-echodone) [pbx_config]
4. Handup(21) [pbx_config]
‘61862053995’ => 1. Set(DSTNUM=${EXTEN}) [pbx_config]
2. Set(CALID=${CALLERID(num)}) [pbx_config]
3. Dial(SIP/8551&SIP/8555&SIP/8558) [pbx_config]
4. Hangup() [pbx_config]
‘625’ => 1. Answer() [pbx_config]
2. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
3. Read(USERPIN,shipsat/enter_account,10) [pbx_config]
4. AGI(checkBalance.agi,${USERPIN},${BOXID},${GW_ID}) [pbx_config]
5. Playback(account-balance-is) [pbx_config]
6. AGI(d2ms.agi,${BALANCE},usd,1) [pbx_config]
‘6531637079’ => 1. Set(DSTNUM=${EXTEN}) [pbx_config]
2. Set(CALID=${CALLERID(num)}) [pbx_config]
3. Dial(SIP/8552&SIP/8556&/SIP/8559) [pbx_config]
4. Hangup() [pbx_config]
‘85258192231’ => 1. Set(DSTNUM=${EXTEN}) [pbx_config]
2. Set(CALID=${CALLERID(num)}) [pbx_config]
3. Dial(SIP/8553&SIP/8557&SIP/8560) [pbx_config]
4. Hangup() [pbx_config]
‘badauth’ => 1. Playback(shipsat/auth-fail) [pbx_config]
2. Hangup(21) [pbx_config]
‘h’ => 1. NoOp(Call data : ${DIALSTATUS} : ${ANSWEREDTIME} : ${CDR(billsec)} : ${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)} ) [pbx_config]
2. AGI(writeCdr.agi, ${DSTNUM}, ${CDR(start)}, ${STRFTIME(${EPOCH},%Y-%m-%d %H:%M:%S)}, ${CDR(duration)}, ${CDR(disposition)}, ${CDR(userfield)}, ${CDR(accountcode)}, ${CDR(billsec)}) [pbx_config]
‘makecall’ => 1. NoOp( DialOut ${DST1} ) [pbx_config]
2. Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC})) [pbx_config]
3. Hangup() [pbx_config]
‘makecallMTNSAT’ => 1. NoOp( DialOut ${DST1} ) [pbx_config]
2. Dial(SIP/${DST1}@mtnsat-outbound,30,S(${AVALSEC})) [pbx_config]
3. Hangup() [pbx_config]
‘nomoney’ => 1. Playback(shipsat/no-credits) [pbx_config]
2. Hangup(21) [pbx_config]
‘readbalance’ => 1. Playback(shipsat/account-balance-is) [pbx_config]
2. AGI(d2ms.agi,${BALANCE},usd,1) [pbx_config]
3. Hangup() [pbx_config]
’_ZXXX’ => 1. Dial(SIP/${EXTEN},20,tr) [pbx_config]
’_X.’ (CID match ‘8551’) => 1. Set(gateway=${CALLERID(num)}) [pbx_config]
2. Answer() [pbx_config]
3. Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1}) [pbx_config]
4. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
5. Set(USERKEY=92976110) [pbx_config]
6. Set(USERKEY=92976110) [pbx_config]
7. Set(CDR(accountcode)=${USERKEY}) [pbx_config]
8. Set(CALLERID(num)=61862053995) [pbx_config]
9. Set(CDR(userfield)=${BOXID}@${GW_ID}) [pbx_config]
10. AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN}) [pbx_config]
11. Hangup(18) [pbx_config]
’_X.’ (CID match ‘8552’) => 1. Set(gateway=${CALLERID(num)}) [pbx_config]
2. Answer() [pbx_config]
3. Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1}) [pbx_config]
4. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
5. Set(USERKEY=66665555) [pbx_config]
6. Set(CDR(accountcode)=${USERKEY}) [pbx_config]
7. Set(CALLERID(num)=6531637079) [pbx_config]
8. Set(CDR(userfield)=${BOXID}@${GW_ID}) [pbx_config]
9. AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN}) [pbx_config]
10. Hangup(18) [pbx_config]
’_X.’ (CID match ‘8553’) => 1. Set(gateway=${CALLERID(num)}) [pbx_config]
2. Answer() [pbx_config]
3. Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1}) [pbx_config]
4. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
5. Set(USERKEY=77778888) [pbx_config]
6. Set(CDR(accountcode)=${USERKEY}) [pbx_config]
7. Set(CALLERID(num)=85258192231) [pbx_config]
8. Set(CDR(userfield)=${BOXID}@${GW_ID}) [pbx_config]
9. AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN}) [pbx_config]
10. Hangup(18) [pbx_config]
’_X.’ (CID match ‘8554’) => 8. Set(CALLERID(num)=85258192231) [pbx_config]
’_X.’ (CID match ‘8555’) => 1. Set(gateway=${CALLERID(num)}) [pbx_config]
2. Answer() [pbx_config]
3. Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1}) [pbx_config]
4. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
5. Set(USERKEY=88889999) [pbx_config]
6. Set(CDR(accountcode)=${USERKEY}) [pbx_config]
7. Set(CALLERID(num)=61862053995) [pbx_config]
8. Set(CDR(userfield)=${BOXID}@${GW_ID}) [pbx_config]
9. AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN}) [pbx_config]
10. Hangup(18) [pbx_config]
‘_X.’ (CID match ‘8561’) => 1. Set(gateway=${CALLERID(num)}) [pbx_config]
2. Answer() [pbx_config]
3. Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1}) [pbx_config]
4. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
5. Set(USERKEY=88889999) [pbx_config]
6. Set(CDR(accountcode)=${USERKEY}) [pbx_config]
7. Set(CALLERID(num)=61862053995) [pbx_config]
8. Set(CDR(userfield)=${BOXID}@${GW_ID}) [pbx_config]
9. AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN}) [pbx_config]
10. Hangup(18) [pbx_config]
’_X.’ => 1. Set(gateway=${CALLERID(num)}) [pbx_config]
2. Answer() [pbx_config]
3. Set(GW_ID=${SHELL(/storage/asterisk/scripts/getgwid):0:-1}) [pbx_config]
4. Read(USERKEY,shipsat/enter-pin-number,10) [pbx_config]
5. Set(BOXID=${SHELL(/bin/cat /etc/shipsatid)}) [pbx_config]
6. Set(CDR(accountcode)=${USERKEY}) [pbx_config]
7. Set(CDR(userfield)=${BOXID}@${GW_ID}) [pbx_config]
9. AGI(checkUserAuth.agi,${USERKEY},${BOXID},${GW_ID},${EXTEN}) [pbx_config]
10. Hangup(18) [pbx_config]