I’ve a very common use case: I’m managing Automatic outbound calls that go to a particular context:
[automatic-call] exten => s,n,Answer() exten => s,n,PlayBack(custom/hello) exten => s,n,WaitExten(10) exten => 2,n,Playback(custom/transfer) exten => 2,n,Goto(490423456789,1) exten => 2,n,Hangup() exten => 490423456789,1,Dial(SIP/outbound/490423456789) exten => 490423456789,n(hangup),Hangup()
In short: the user receive the call, he hear a simple audio and then can press the key <2> to speak with an operator.
When he press 2 is played another audio file and the call is forwarded to the final destination.
Here I done a small hack (that unfortunally don’t works always): I created the extension 2 of couse, and instead to do direclty Dial() I go to another extension.
Why I did this? Because to charge the user I check the mysql asterisk cdr table; and if I don’t do this the destination of the call is the number <2> and not the real phone number <490423456789>. So if I don’t do this I charge in wrong way the user.
Unfortunally also with this hack, sometime (maybe when the user hang up the call before it is dialed out), the cdr row has as dst column the value <2> instead the real number.
There is a more solid way to do this?
THanks very much!