<div dir="ltr"><div>freeswitch@wtosdev> 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> 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> <extension name="socket"></div><div> <condition field="destination_number" expression="^(10[01][0-9])$"></div>
<div> <action application="socket", data="<a href="http://192.168.1.128:8084">192.168.1.128:8084</a> full async"/></div><div> </condition></div><div> </extension></div>
</div><div><br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2013/10/22 Seven Du <span dir="ltr"><<a href="mailto:dujinfang@gmail.com" target="_blank">dujinfang@gmail.com</a>></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't hangup. what "show channels" tell you? What's your dialplan look like?
</div>
<div><div><br></div><div>-- </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 side, I can'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(&handle, client_sock, addr);</div><div><br></div><div><span style="white-space:pre-wrap">        </span>esl_log(ESL_LOG_INFO, "Connected! %d\n", handle.sock);</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>esl_filter(&handle, "unique-id", esl_event_get_header(handle.info_event, "caller-unique-id"));</div><div><span style="white-space:pre-wrap">        </span>esl_events(&handle, ESL_EVENT_TYPE_PLAIN, "CHANNEL_HANGUP_COMPLETE DTMF CUSTOM");</div>
<div><br></div><div><span style="white-space:pre-wrap">        </span>esl_send_recv(&handle, "linger");</div><div><br></div><div><br></div><div><span style="white-space:pre-wrap">        </span>esl_execute(&handle, "set", "hangup_after_bridge=true", NULL);</div>
<div><span style="white-space:pre-wrap">        </span>esl_execute(&handle, "bridge", "user/<a href="mailto:1001@192.168.1.128" target="_blank">1001@192.168.1.128</a>", 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(&handle, 1000)) != ESL_FAIL) {</div><div><span style="white-space:pre-wrap">                </span>printf("Thread:%d\n", i);</div><div>
<span style="white-space:pre-wrap">                </span>if (done) {</div><div><span style="white-space:pre-wrap">                        </span>if (time(NULL) >= 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, "content-type");</div>
<div><span style="white-space:pre-wrap">                        </span>if (type && !strcasecmp(type, "text/disconnect-notice")) {</div><div><span style="white-space:pre-wrap">                                </span>const char *dispo = esl_event_get_header(handle.last_event, "content-disposition");</div>
<div><span style="white-space:pre-wrap">                                </span>esl_log(ESL_LOG_INFO, "Got a disconnection notice dispostion: [%s]\n", dispo ? dispo : "");</div><div><span style="white-space:pre-wrap">                                </span>if (dispo && !strcmp(dispo, "linger")) {</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, "Waiting 5 seconds for any remaining events.\n");</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, "Disconnected! %d\n", handle.sock);</div><div><span style="white-space:pre-wrap">        </span>esl_disconnect(&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>