[asterisk-users] Simple Call Screener
Mark G. Thomas
Mark at Misty.com
Thu Jul 10 09:45:46 CDT 2008
Hi Ryan,
On Wed, Jul 09, 2008 at 05:54:28PM -0400, Ryan M. Colbert wrote:
> I'm trying to build a simple accept/reject screening app for inbound calls that * forwards to my cell phone. Basically I want * to announce the caller ID and then let me press 1 to accept the call or 2 to reject the call and send the outside party to voicemail.
I'm doing something similar, ringing a Zaptel port and calling a cellphone,
as per below. I had success using Read() to get the accept/reject.
Note that you need to Set(MACRO_RESULT=CONTINUE) if you do NOT want to accept
the call on the cellphone, and hence want the diaplan to CONTINUE.
In my case, I don't need to announce the caller ID since the cellphone
simply displays it, and I'm letting the human or analog voicemail on the
zaptel port take the call if the cellphone user doesn't press 1.
> I've been messing around with variation of the script below... can anyone tell me what I'm doing wrong? It's got to be something obvious that I've overlooked.
>
> Thanks!!!
>
> [main]
> exten => s,1,Answer
> exten => s,n,Ringing
> exten => s,n,Wait(1)
> exten => s,n,Dial(SIP/+1... at bandwidth.com_outbound,120,gM(screen))
> exten => s,n,PlayBack(vm-goodbye)
> exten => s,n,Hangup
>
> [macro-screen]
> exten => s,1,Wait(1)
> ;exten => s,n,SayDigits(${CALLERID(num)})
> exten => s,n,Set(TIMEOUT(digit)=5)
> exten => s,n,Set(TIMEOUT(response)=30)
> exten => s,n,Background(accept-reject)
>
> exten => 1,1,Set(MACRO_RESULT=CONTINUE)
> exten => 2,1,PlayBack(vm-goodbye)
> exten => 2,2,Hangup
>
> exten => s,6,Wait(10)
> exten => i,1,Goto(TT_VO,s,1)
...
[inbound]
exten => 2155551212,1,Playtones(ring)
exten => 2155551212,n,Dial(${PTNR}&local/101 at internals,,t)
[internals]
exten => 101,1,Dial(${MARKCELL},30,tM(screen))
[macro-screen]
exten => s,1,Wait(0.5)
exten => s,n,Read(ACCEPT,inbound,1,,1,20)
exten => s,n,GotoIf($["${ACCEPT}" = "1"]?yes:no)
exten => s,n(yes),Background(connecting)
exten => s,n,Goto(end)
exten => s,n(no),Set(MACRO_RESULT=CONTINUE)
exten => s,n(end),NoOp
--
Mark G. Thomas (Mark at Misty.com)
More information about the asterisk-users
mailing list