<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">
&lt;action application=&quot;set&quot; data=&quot;api_hangup_hook=originate user/1001 &amp;bridge(sofia/gateway/&lt;YOUR GATEWAY&gt;/${caller_id_number})&quot;/&gt; <br>&lt;action application=&quot;hangup&quot; /&gt;<br></pre>
</div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/6/5 Vincent Xia <span dir="ltr">&lt;<a href="mailto:gmangudai@gmail.com" target="_blank">gmangudai@gmail.com</a>&gt;</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&#39;s something like:</div><div>    &lt;extension name=&quot;callback&quot;&gt;</div>

<div>      &lt;condition field=&quot;destination_number&quot; expression=&quot;^\*\*(\d+)$&quot;&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;hangup&quot;/&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;originate&quot; data=&quot;sofia/${use_profile}/$1&quot;/&gt;</div>

<div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;originate&quot; data=&quot;sofia/${use_profile}/${caller_id_number}&quot;/&gt;</div><div><span style="white-space:pre-wrap">        </span>&lt;action application=&quot;bridge&quot; data=&quot;sofia/${use_profile}/$1 sofia/${use_profile}/${caller_id_number}&quot;/&gt;</div>

<div>      &lt;/condition&gt;</div><div>    &lt;/extension&gt;</div><div>but certainly it&#39;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>