Asterisk tips call through
Created by: Boris,Last modification on Mon 19 of Jun, 2006 [02:39 UTC] by damianmontero
Asterisk call through
This is a simple call through example, after calling the system (extension 500), enter a phonenumber and the system dials it after pressing '#'. You can reenter the number after pressing '*'. After the "call through call" you can enter a new number, it is also possible to disconnect a call with '*' and enter a new number. If the called party hangs up, you can even dial a new number, this is because of the g option in the Dial command.To end it, just hang up.
The sound files are not optimal, but I think these are the best ones, which are availible in the standard distribution.
In extensions.conf:
exten => 500,1,Goto(callthrough,s,1)
[callthrough]
exten => s,1,Set(NR=)
exten => s,2,Background(privacy-prompt)
exten => s,3,ResponseTimeout(10)
exten => s,4,WaitExten
exten => _X,1,Set(NR=${NR}${EXTEN})
exten => _X,2,Goto(s,3)
exten => *,1,Goto(s,1)
exten => #,1,Dial(${TRUNK}/${NR},30,H|g)
exten => #,2,GotoIf($[${DIALSTATUS} = NOANSWER]?4)
exten => #,3,GotoIf($[${DIALSTATUS} = CONGESTION]?4:5)
exten => #,4,Playback(vm-nobodyavail)
exten => #,5,Goto(s,1)
exten => #,102,Playback(tt-allbusy)
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
Comments
333One question
any way to prevent that?
JD
333Re: Re: Did you tried this?
Note, you need to put the 500 thing somewhere that it will get seen.
If you start out with a menu, you need to put the code in the menu.
Look in extensions_additional.conf to see what your trunk is called mine is OUT_2.
I put this in the first line of my main menu:
exten => _*888,1,Goto(callthrough-auth,s,1);
callthrough-auth ; note brackets around this
exten => s,1,Background(vm-password)
exten => s,2,ResponseTimeout(10)
exten => s,3,WaitExten
exten => s,4,WaitExten
exten => 1234,1,Goto(callthrough,s,1)
exten => 1225,1,Goto(callthrough,s,1)
exten => 6373,1,Goto(callthrough,s,1)
exten => *,1,Goto(s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
callthrough ; note brackets around this
exten => s,1,SetVar(NR=)
exten => s,2,Background(privacy-prompt)
exten => s,3,ResponseTimeout(10)
exten => s,4,WaitExten
exten => _X,1,SetVar(NR=${NR}${EXTEN})
exten => _X,2,Goto(s,3)
exten => *,1,Goto(s,1)
exten => #,1,Dial(${OUT_2}/${NR},30,H|g)
exten => #,3,GotoIf($${DIALSTATUS} = NOANSWER?4)
exten => #,4,GotoIf($${DIALSTATUS} = CONGESTION?4:5)
exten => #,5,Playback(vm-nobodyavail)
exten => #,6,Goto(s,1)
exten => #,102,Playback(tt-allbusy)
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
333password auth
change the exten 500 line to:
exten => 500,1,Goto(callthrough-auth,s,1)
and add:
callthrough-auth
exten => s,1,Background(vm-password)
exten => s,2,ResponseTimeout(10)
exten => s,3,WaitExten
exten => 4253,1,Goto(callthrough,s,1)
exten => 1225,1,Goto(callthrough,s,1)
exten => 6373,1,Goto(callthrough,s,1)
exten => *,1,Goto(s,1)
exten => t,1,Playback(vm-goodbye)
exten => t,2,HangUp
"4253", "1225" and "6373" are 3 PIN's that could be used to access the system. you could add as many as you like.
another idea would be to write an agi that checked voicemail.conf, and did the goto only if it matched a password in there (or even prompt for both extension and password).
333Re: Did you tried this?
but, only if you will put in one more line:
s,4,WaitExten
(:mrgreen:)
333Re: Did you tried this?
333Did you tried this?
exten => #,1,Dial(${TRUNK}:${NR},30,H|g)
The colon (:) doesn't appears to be correct and when hangup is issued
the channel is killed, the idea is great and we would appreciated ,if it is working for you, to have additional details....