<div dir="ltr"><div>freeswitch@wtosdev&gt; show channels</div><div><br></div><div>uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,application,application_data,dialplan,context,read_codec,read_rate,read_bit_rate,write_codec,write_rate,write_bit_rate,secure,hostname,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,sent_callee_name,sent_callee_num</div>
<div>56eb412a-3ace-11e3-b62f-956876d28f28,inbound,2013-10-22 11:59:24,1382414364,sofia/internal/<a href="mailto:1000@192.168.1.128">1000@192.168.1.128</a>,CS_EXECUTE,1000,1000,192.168.1.6,1001,bridge,user/<a href="mailto:1001@192.168.1.128">1001@192.168.1.128</a>,XML,default,PCMU,8000,64000,PCMU,8000,64000,,wtosdev,<a href="mailto:1000@192.168.1.128">1000@192.168.1.128</a>,,ACTIVE,Outbound Call,1001,SEND,56eb412a-3ace-11e3-b62f-956876d28f28,Outbound Call,1001</div>
<div><br></div><div><div>freeswitch@wtosdev&gt; show calls</div><div><br></div><div>uuid,direction,created,created_epoch,name,state,cid_name,cid_num,ip_addr,dest,presence_id,presence_data,callstate,callee_name,callee_num,callee_direction,call_uuid,hostname,sent_callee_name,sent_callee_num,b_uuid,b_direction,b_created,b_created_epoch,b_name,b_state,b_cid_name,b_cid_num,b_ip_addr,b_dest,b_presence_id,b_presence_data,b_callstate,b_callee_name,b_callee_num,b_callee_direction,b_sent_callee_name,b_sent_callee_num,call_created_epoch</div>
<div>56eb412a-3ace-11e3-b62f-956876d28f28,inbound,2013-10-22 11:59:24,1382414364,sofia/internal/<a href="mailto:1000@192.168.1.128">1000@192.168.1.128</a>,CS_EXECUTE,1000,1000,192.168.1.6,1001,<a href="mailto:1000@192.168.1.128">1000@192.168.1.128</a>,,ACTIVE,Outbound Call,1001,SEND,56eb412a-3ace-11e3-b62f-956876d28f28,wtosdev,Outbound Call,1001,,,,,,,,,,,,,,,,,,,</div>
</div><div><br></div><div><br></div><div>My Dialplan Like This</div><div><br></div><div><div><br></div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;extension name=&quot;socket&quot;&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;condition field=&quot;destination_number&quot; expression=&quot;^(10[01][0-9])$&quot;&gt;</div>
<div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &lt;action application=&quot;socket&quot;, data=&quot;<a href="http://192.168.1.128:8084">192.168.1.128:8084</a> full async&quot;/&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;&lt;/condition&gt;</div><div>&nbsp; &nbsp; &nbsp; &nbsp; &lt;/extension&gt;</div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/22 Seven Du <span dir="ltr">&lt;<a href="mailto:dujinfang@gmail.com" target="_blank">dujinfang@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>
                    chances are the calling side didn&#39;t hangup. what &quot;show channels&quot; tell you? What&#39;s your dialplan look like?
                </div>
                <div><div><br></div><div>--&nbsp;</div><div>Seven Du</div><div><span style="font-size:10pt"><a href="http://www.freeswitch.org.cn" target="_blank">http://www.freeswitch.org.cn</a></span></div><div><a href="http://about.me/dujinfang" target="_blank">http://about.me/dujinfang</a></div>
<div><div><a href="http://www.dujinfang.com" target="_blank">http://www.dujinfang.com</a></div></div><div><br></div><div>Sent with <a href="http://www.sparrowmailapp.com/?sig" target="_blank">Sparrow</a></div><div><br></div>
</div><div><div class="h5">
                 
                <p style="color:#a0a0a8">On Monday, October 21, 2013 at 6:44 PM, ÍõÓÀÌΠwrote:</p>
                </div></div><blockquote type="cite" style="border-left-style:solid;border-width:1px;margin-left:0px;padding-left:10px">
                    <span><div><div><div class="h5"><div><div dir="ltr">Hi<div><div>I made some changes on testserver.c. Then I call a sipnumber from the flex client to a x-lite client. When I hang up from the flex side, can receive CHANNEL_HANGUP_COMPLETE event loop can be ended. When I hang up from the x-lite &nbsp;side, I can&#39;t receive CHANNEL_HANGUP_COMPLETE event and loop can not be ended, the variable status value is ESL_BREAK.</div>

<div><br></div><div>Thanks.</div><div><br></div><div>Code is as follows</div></div><div><br></div><div><div>static void mycallback(esl_socket_t server_sock, esl_socket_t client_sock,</div><div><span style="white-space:pre-wrap">                </span>struct sockaddr_in *addr) {</div>

<div><span style="white-space:pre-wrap">        </span>esl_handle_t handle = {{0}};</div><div><span style="white-space:pre-wrap">        </span>int done = 0;</div><div><span style="white-space:pre-wrap">        </span>esl_status_t status;</div>

<div><span style="white-space:pre-wrap">        </span>time_t exp = 0;</div><div><br></div><div><span style="white-space:pre-wrap">        </span>esl_attach_handle(&amp;handle, client_sock, addr);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>esl_log(ESL_LOG_INFO, &quot;Connected! %d\n&quot;, handle.sock);</div>

<div><br></div><div><span style="white-space:pre-wrap">        </span>esl_filter(&amp;handle, &quot;unique-id&quot;, esl_event_get_header(handle.info_event, &quot;caller-unique-id&quot;));</div><div><span style="white-space:pre-wrap">        </span>esl_events(&amp;handle, ESL_EVENT_TYPE_PLAIN, &quot;CHANNEL_HANGUP_COMPLETE DTMF CUSTOM&quot;);</div>

<div><br></div><div><span style="white-space:pre-wrap">        </span>esl_send_recv(&amp;handle, &quot;linger&quot;);</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>esl_execute(&amp;handle, &quot;set&quot;, &quot;hangup_after_bridge=true&quot;, NULL);</div>

<div><span style="white-space:pre-wrap">        </span>esl_execute(&amp;handle, &quot;bridge&quot;, &quot;user/<a href="mailto:1001@192.168.1.128" target="_blank">1001@192.168.1.128</a>&quot;, NULL);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>int i=rand();</div>

<div><span style="white-space:pre-wrap">        </span>while((status = esl_recv_timed(&amp;handle, 1000)) != ESL_FAIL) {</div><div><span style="white-space:pre-wrap">                </span>printf(&quot;Thread:%d\n&quot;, i);</div><div>
<span style="white-space:pre-wrap">                </span>if (done) {</div><div><span style="white-space:pre-wrap">                        </span>if (time(NULL) &gt;= exp) {</div><div><span style="white-space:pre-wrap">                                </span>break;</div><div>
<span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>} else if (status == ESL_SUCCESS) {</div><div><span style="white-space:pre-wrap">                        </span>const char *type = esl_event_get_header(handle.last_event, &quot;content-type&quot;);</div>

<div><span style="white-space:pre-wrap">                        </span>if (type &amp;&amp; !strcasecmp(type, &quot;text/disconnect-notice&quot;)) {</div><div><span style="white-space:pre-wrap">                                </span>const char *dispo = esl_event_get_header(handle.last_event, &quot;content-disposition&quot;);</div>

<div><span style="white-space:pre-wrap">                                </span>esl_log(ESL_LOG_INFO, &quot;Got a disconnection notice dispostion: [%s]\n&quot;, dispo ? dispo : &quot;&quot;);</div><div><span style="white-space:pre-wrap">                                </span>if (dispo &amp;&amp; !strcmp(dispo, &quot;linger&quot;)) {</div>

<div><span style="white-space:pre-wrap">                                        </span>done = 1;</div><div><span style="white-space:pre-wrap">                                        </span>esl_log(ESL_LOG_INFO, &quot;Waiting 5 seconds for any remaining events.\n&quot;);</div><div><span style="white-space:pre-wrap">                                        </span>exp = time(NULL) + 5;</div>

<div><span style="white-space:pre-wrap">                                </span>}</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>}</div><div><span style="white-space:pre-wrap">        </span>}</div>

<div><br></div><div><span style="white-space:pre-wrap">        </span>esl_log(ESL_LOG_INFO, &quot;Disconnected! %d\n&quot;, handle.sock);</div><div><span style="white-space:pre-wrap">        </span>esl_disconnect(&amp;handle);</div>
<div>}</div></div><div><br></div></div>
</div></div></div><div><div>_________________________________________________________________________</div><div>Professional FreeSWITCH Consulting Services:</div><div><a href="mailto:consulting@freeswitch.org" target="_blank">consulting@freeswitch.org</a></div>
<div><a href="http://www.freeswitchsolutions.com" target="_blank">http://www.freeswitchsolutions.com</a></div><div><br></div><div>FreeSWITCH-powered IP PBX: The CudaTel Communication Server</div><div><a href="http://www.cudatel.com" target="_blank">http://www.cudatel.com</a></div>
<div><br></div><div>Official FreeSWITCH Sites</div><div><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></div><div><a href="http://wiki.freeswitch.org" target="_blank">http://wiki.freeswitch.org</a></div>
<div><a href="http://www.cluecon.com" target="_blank">http://www.cluecon.com</a></div><div><br></div><div>FreeSWITCH-users mailing list</div><div><a href="mailto:FreeSWITCH-users@lists.freeswitch.org" target="_blank">FreeSWITCH-users@lists.freeswitch.org</a></div>
<div><a href="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</a></div><div>UNSUBSCRIBE:<a href="http://lists.freeswitch.org/mailman/options/freeswitch-users" target="_blank">http://lists.freeswitch.org/mailman/options/freeswitch-users</a></div>
<div><a href="http://www.freeswitch.org" target="_blank">http://www.freeswitch.org</a></div></div></div></span>
                 
                 
                 
                 
                </blockquote>
                 
                <div>
                    <br>
                </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>