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