On Mon, Jul 13, 2009 at 9:30 PM, Dome Charoenyost
<dome@tel.co.th> wrote:
2009/7/14 Michael Collins <msc@freeswitch.org>:
> What phone number do you call back? I mean, how do you know what the
> customer's number is? Do you go by the caller id number?
yes callback to caller id
Okay, here's a dialplan snippet that I used to successfully do the autocallback. In my case I used ext 1001 as the customer and portaudio as the "agent" if you get my meaning. Extension 1001 dials 9902, hangs up, and immediately the api_hangup_hook's originate command is executed. In this case it calls portaudio/auto_answer for the A-leg and user/1001 as the B-leg. I don't claim that it's the prettiest thing in the world but it definitely works. You'll need to adjust according to your specific situation.
<extension name="callback-test-answer-ib-call">
<!-- From mailing list - a question about how to do this:
Caller calls in, ring (no answer), capture Caller ID, wait for caller to hangup
Generate outbound call to captured caller ID number
Only use dialplan, no scripting
-->
<condition field="destination_number" expression="^9902$">
<action application="pre_answer"/>
<action application="set" data="callbacknum=${caller_id_number}"/>
<action application="log" data="INFO Callback number is '${callbacknum}'"/>
<action application="set" data="api_hangup_hook=originate portaudio/auto_answer CBTEST${callbacknum}"/>
<action application="sleep" data="10000"/> <!-- wait 10 sec for caller to hangup, otherwise we hangup -->
<action application="hangup"/>
</condition>
</extension>
<extension name="callback-test-generate-ob-call">
<condition field="destination_number" expression="^CBTEST(\d+)$">
<action application="bridge" data="user/$1"/>
</condition>
</extension>
Let us know how it goes. BTW, what is the reason for this type of scenario? Just curious.
-MC