login | register
Sat 30 of Aug, 2008 [16:27 UTC]

voip-info.org

Discuss [6] History

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

Comments Filter
222

333One question

by jedaustin, Friday 01 of April, 2005 [07:15:18 UTC]
When I reach the dialed number, if I hit the * key it hangs up,
any way to prevent that?

JD
222

333Re: Re: Did you tried this?

by jedaustin, Friday 01 of April, 2005 [07:10:08 UTC]
I finally got this to work with broadvoice, here's my setup.

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
222

333password auth

by , Friday 11 of February, 2005 [00:54:37 UTC]
Just posted this on IRC to someone, thought it may be useful (this is not tested).. for adding password protection:

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).


222

333Re: Did you tried this?

by , Friday 24 of December, 2004 [12:57:54 UTC]
Yes, its work fine (:razz:)
but, only if you will put in one more line:
s,4,WaitExten
(:mrgreen:)

222

333Re: Did you tried this?

by Boris, Friday 10 of December, 2004 [11:58:02 UTC]
I have tried it in a test system with a capi device (therefore the colon...) and it works. Maybe you have to adjust it a little bit to make it more comfortable and test it more intensiv.
222

333Did you tried this?

by , Friday 10 of December, 2004 [01:18:52 UTC]
Hi: Is this example a proof of concept, or you tried it in a working system?
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....