<div dir="ltr"><div>You can do it by setting the variable <b>api_hangup_hook</b>.<br><br><a href="http://wiki.freeswitch.com/wiki/Channel_Variables#api_hangup_hook">http://wiki.freeswitch.com/wiki/Channel_Variables#api_hangup_hook</a><br>
<br></div>In dialplan you set an originate to be done on hangup and then, you hangup.<br><br><pre style="padding:1em;border:1px dashed rgb(47,111,171);color:rgb(0,0,0);background-color:rgb(249,249,249);line-height:1.1em;font-style:normal;font-variant:normal;font-weight:normal;letter-spacing:normal;text-align:start;text-indent:0px;text-transform:none;word-spacing:0px">
<action application="set" data="api_hangup_hook=originate user/1001 &bridge(sofia/gateway/<YOUR GATEWAY>/${caller_id_number})"/> <br><action application="hangup" /><br></pre>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/5 Vincent Xia <span dir="ltr"><<a href="mailto:gmangudai@gmail.com" target="_blank">gmangudai@gmail.com</a>></span><br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr"><div>how to do callback with dialplan?</div><div><br></div><div>the idea is when user A(his phone number is, for example 1001) calls a number with a prefix, e.g. **1002, the </div><div><br></div><div>freeswitch will hangup the call leg with user A and originate calls to 1001 and 1002, then bridge 1001 and 1002 after </div>
<div><br></div><div>both are connected. since originate is a console command, how could i make dialplan to do callback?</div><div><br></div><div>maybe it's something like:</div><div> <extension name="callback"></div>
<div> <condition field="destination_number" expression="^\*\*(\d+)$"></div><div><span style="white-space:pre-wrap">        </span><action application="hangup"/></div><div><span style="white-space:pre-wrap">        </span><action application="originate" data="sofia/${use_profile}/$1"/></div>
<div><span style="white-space:pre-wrap">        </span><action application="originate" data="sofia/${use_profile}/${caller_id_number}"/></div><div><span style="white-space:pre-wrap">        </span><action application="bridge" data="sofia/${use_profile}/$1 sofia/${use_profile}/${caller_id_number}"/></div>
<div> </condition></div><div> </extension></div><div>but certainly it's not gonna work, can anybody give a hand?</div><div><br></div></div>
<br>_________________________________________________________________________<br>
Professional FreeSWITCH Consulting Services:<br>
<a href="mailto:consulting@freeswitch.org">consulting@freeswitch.org</a><br>
<a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a><br>
<br>
FreeSWITCH-powered IP PBX: The CudaTel Communication Server<br>
<a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a><br>
<br>
Official FreeSWITCH Sites<br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a><br>
<a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a><br>
<br>
FreeSWITCH-users mailing list<br>
<a href="mailto:FreeSWITCH-users@lists.freeswitch.org">FreeSWITCH-users@lists.freeswitch.org</a><br>
<a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a><br>
UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a><br>
<a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a><br>
<br></blockquote></div><br></div>