Program Calls in the future with Asterisk

Some lines to program/reserve calls in the future using callfiles.

exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(id=${CALLERID(num)})
exten => s,n(begin),Playback(telephone-number&astcc-followed-by-the-pound-key) 
exten => s,n,Read(appoint,,15,,2,10)
exten => s,n,SayDigits(${appoint})
exten => s,n,Wait(1)
exten => s,n,Playback(year&month&day)
exten => s,n,Read(date,,8,,2,10)
exten => s,n,SayDigits(${date})
exten => s,n,Playback(hours)
exten => s,n,Read(hour,,4,,2,10)
exten => s,n,Saydigits(${hour})
exten => s,n,Playback(if-this-is-correct-press&digits/1&if-this-is-not-correct&digits/2)
exten => s,n,Read(yesno,,1,,,5)
exten => s,n,GotoIf($[["${yesno}" = "1"]?app:begin)
exten => s,n(app),System(echo Channel:SIP/${id} >> /tmp/callback)
exten => s,n,System(echo Callerid:apptel >> /tmp/callback)
exten => s,n,System(echo WaitTime:30 >> /tmp/callback)
exten => s,n,System(echo Maxretries:3 >> /tmp/callback)
exten => s,n,System(echo RetryTime:300 >> /tmp/callback)
exten => s,n,System(echo Account:${id} >> /tmp/callback)
exten => s,n,System(echo Application:Dial >> /tmp/callback)
exten => s,n,Gotoif($[["${appoint:0:2}" = "00"]?provider:local)
exten => s,n(local),System(echo Data:SIP/${apppint},45,m >> /tmp/callback)
exten => s,n,System(touch -t ${date}${hour} /tmp/callback)
exten => s,n,System(mv /tmp/callback /var/spool/asterisk/outgoing/${date}${hour})
exten => s,n,Hangup
exten => s,n(provider),System(echo Data:SIP/provider/${appoint},45,m >> /tmp/callback)
exten => s,n,System(touch -t ${date}${hour} /tmp/callback)
exten => s,n,System(mv /tmp/callback /var/spool/asterisk/outgoing/${date}${hour})
exten => s,n,Hangup


Limits of this code:

  • The calls only can be reserved from internal extensions
  • For outgoing calls only we can indicate one VoIP provider
  • we can't delete the calls after they are programmed

Any suggestions?

You can read the Spanish version with comments here


Some lines to program/reserve calls in the future using callfiles.

exten => s,1,Answer
exten => s,n,Wait(1)
exten => s,n,Set(id=${CALLERID(num)})
exten => s,n(begin),Playback(telephone-number&astcc-followed-by-the-pound-key) 
exten => s,n,Read(appoint,,15,,2,10)
exten => s,n,SayDigits(${appoint})
exten => s,n,Wait(1)
exten => s,n,Playback(year&month&day)
exten => s,n,Read(date,,8,,2,10)
exten => s,n,SayDigits(${date})
exten => s,n,Playback(hours)
exten => s,n,Read(hour,,4,,2,10)
exten => s,n,Saydigits(${hour})
exten => s,n,Playback(if-this-is-correct-press&digits/1&if-this-is-not-correct&digits/2)
exten => s,n,Read(yesno,,1,,,5)
exten => s,n,GotoIf($[["${yesno}" = "1"]?app:begin)
exten => s,n(app),System(echo Channel:SIP/${id} >> /tmp/callback)
exten => s,n,System(echo Callerid:apptel >> /tmp/callback)
exten => s,n,System(echo WaitTime:30 >> /tmp/callback)
exten => s,n,System(echo Maxretries:3 >> /tmp/callback)
exten => s,n,System(echo RetryTime:300 >> /tmp/callback)
exten => s,n,System(echo Account:${id} >> /tmp/callback)
exten => s,n,System(echo Application:Dial >> /tmp/callback)
exten => s,n,Gotoif($[["${appoint:0:2}" = "00"]?provider:local)
exten => s,n(local),System(echo Data:SIP/${apppint},45,m >> /tmp/callback)
exten => s,n,System(touch -t ${date}${hour} /tmp/callback)
exten => s,n,System(mv /tmp/callback /var/spool/asterisk/outgoing/${date}${hour})
exten => s,n,Hangup
exten => s,n(provider),System(echo Data:SIP/provider/${appoint},45,m >> /tmp/callback)
exten => s,n,System(touch -t ${date}${hour} /tmp/callback)
exten => s,n,System(mv /tmp/callback /var/spool/asterisk/outgoing/${date}${hour})
exten => s,n,Hangup


Limits of this code:

  • The calls only can be reserved from internal extensions
  • For outgoing calls only we can indicate one VoIP provider
  • we can't delete the calls after they are programmed

Any suggestions?

You can read the Spanish version with comments here


Created by: asannucci, Last modification: Fri 05 of Nov, 2010 (23:36 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+