<div dir="ltr">I add some code to log the pop function,just like below:<div><div>switch_mutex_lock(mod_sofia_globals.mutex);</div><div><span class="" style="white-space:pre">        </span>n = msg_queue_threads;</div><div><span class="" style="white-space:pre">        </span>msg_queue_threads++;</div>
<div><span class="" style="white-space:pre">        </span>switch_mutex_unlock(mod_sofia_globals.mutex);</div><div><br></div><div><span class="" style="white-space:pre">        </span>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MSG Thread %d Started\n", my_id);</div>
<div><br></div><div><br></div><div><span class="" style="white-space:pre">        </span>for(;;) {</div><div><br></div><div><span class="" style="white-space:pre">                </span>if (switch_queue_pop(q, &pop) != SWITCH_STATUS_SUCCESS) {</div>
<div><span class="" style="white-space:pre">                        </span>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "POP FAIL %s\n", "SELF");</div><div><span class="" style="white-space:pre">                        </span>switch_cond_next();</div>
<div><span class="" style="white-space:pre">                        </span>continue;</div><div><span class="" style="white-space:pre">                </span>}</div><div><br></div><div><span class="" style="white-space:pre">                </span>if (pop) {</div><div><span class="" style="white-space:pre">                        </span>sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop;</div>
<div><span class="" style="white-space:pre">                        </span>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MSG Thread %d Dispatcher Started\n", n);</div><div><span class="" style="white-space:pre">                        </span>sofia_process_dispatch_event(&de);</div>
<div><span class="" style="white-space:pre">                        </span>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MSG Thread %d Dispatcher Ended\n", n);</div><div><span class="" style="white-space:pre">                </span>} else {</div>
<div><span class="" style="white-space:pre">                        </span>break;</div><div><span class="" style="white-space:pre">                </span>}</div><div><span class="" style="white-space:pre">        </span>}</div></div><div><br></div><div>And I got logs like below:</div>
<div><div>2014-04-28 21:23:54.229117 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div><div>2014-04-28 21:23:54.229174 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div><div>2014-04-28 21:23:54.231115 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div>
<div>2014-04-28 21:23:54.231137 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div><div>2014-04-28 21:23:54.894118 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div><div>2014-04-28 21:23:54.894157 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div>
<div>2014-04-28 21:23:54.894232 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div><div>2014-04-28 21:23:55.200100 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div><div>2014-04-28 21:23:55.200127 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div>
<div>2014-04-28 21:23:55.540108 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div><div>2014-04-28 21:23:55.540108 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div><div>2014-04-28 21:23:55.840114 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div>
<div>2014-04-28 21:23:55.840114 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div><div>2014-04-28 21:23:55.840114 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div><div>2014-04-28 21:23:55.840114 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div>
<div>2014-04-28 21:23:56.100116 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div><div>2014-04-28 21:23:56.100116 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started</div><div>2014-04-28 21:23:56.380119 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended</div>
</div><div><br></div><div>I found it is too long between a pop ended and other stated.I think this will make the pop function execute slow than push.Will it?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">
2014-04-28 21:22 GMT+08:00 Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>></span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div style="word-wrap:break-word">This is a completely different issue than i was talking about. What rate of traffic are you putting on this box? it seems your box is way underpowered for whatever your doing, or your using something to lookup users or something of the sort that is blocking or taking way too long.<div>
<div class="h5"><div><br><div><div>On Apr 28, 2014, at 9:07 AM, 李俊俊 <<a href="mailto:rockxsj@gmail.com" target="_blank">rockxsj@gmail.com</a>> wrote:</div><br><blockquote type="cite"><div dir="ltr">Yes,my code is pulled from the master branch on <a href="http://4.23.it/" target="_blank">4.23.It</a> seems that the push is fast than pop.I add some code to log the queue length,just like below:<div>
<div>if (!sofia_private) {</div>
<div><span style="white-space:pre-wrap">                        </span>if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready_inbound()) {</div><div><span style="white-space:pre-wrap">                                </span>nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), NUTAG_WITH_THIS(nua), TAG_END());</div>
<div><span style="white-space:pre-wrap">                                </span>goto end;</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "switch_queue_size(mod_sofia_globals.msg_queue):%d\n", switch_queue_size(mod_sofia_globals.msg_queue));</div>
<div><span style="white-space:pre-wrap">                        </span>switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "critical:%d\n", (unsigned int)critical);</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>if (switch_queue_size(mod_sofia_globals.msg_queue) > (unsigned int)critical) {</div>
<div><span style="white-space:pre-wrap">                                </span>nua_respond(nh, 503, "System Busy", SIPTAG_RETRY_AFTER_STR("300"), NUTAG_WITH_THIS(nua), TAG_END());</div><div><span style="white-space:pre-wrap">                                </span>goto end;</div>
<div><span style="white-space:pre-wrap">                        </span>}</div><div><br></div><div><span style="white-space:pre-wrap">                        </span>if (sofia_test_pflag(profile, PFLAG_STANDBY)) {</div><div><span style="white-space:pre-wrap">                                </span>nua_respond(nh, 503, "System Paused", NUTAG_WITH_THIS(nua), TAG_END());</div>
<div><span style="white-space:pre-wrap">                                </span>goto end;</div><div><span style="white-space:pre-wrap">                        </span>}</div><div><span style="white-space:pre-wrap">                </span>}</div></div><div><br></div><div>And I found the switch_queue_size(mod_sofia_globals.msg_queue) is increase so fast and almost did not decrease,the below is the log:</div>
<div><div>2014-04-28 18:55:31.416405 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56157</div><div>2014-04-28 18:55:31.436402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56158</div>
<div>2014-04-28 18:55:31.436402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56159</div><div>2014-04-28 18:55:31.476402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56160</div>
<div>2014-04-28 18:55:31.496402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56161</div><div>2014-04-28 18:55:31.496402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56162</div>
<div>2014-04-28 18:55:31.496402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56163</div><div>2014-04-28 18:55:31.516402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56164</div>
<div>2014-04-28 18:55:31.516402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56165</div><div>2014-04-28 18:55:31.536402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56166</div>
<div>2014-04-28 18:55:31.556402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56167</div><div>2014-04-28 18:55:31.576407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56168</div>
<div>2014-04-28 18:55:31.576407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56169</div><div>2014-04-28 18:55:31.576407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56170</div>
<div>2014-04-28 18:55:31.596403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56171</div><div>2014-04-28 18:55:31.616404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56169</div>
<div>2014-04-28 18:55:31.636404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56170</div><div>2014-04-28 18:55:31.656403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56172</div>
<div>2014-04-28 18:55:31.656403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56173</div><div>2014-04-28 18:55:31.656403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56174</div>
<div>2014-04-28 18:55:31.676404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56175</div><div>2014-04-28 18:55:31.676404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56175</div>
<div>2014-04-28 18:55:31.716404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56177</div><div>2014-04-28 18:55:31.716404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56178</div>
<div>2014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56180</div><div>2014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56181</div>
<div>2014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56182</div><div>2014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56183</div>
<div>2014-04-28 18:55:31.776414 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56184</div><div>2014-04-28 18:55:31.796402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56185</div>
<div>2014-04-28 18:55:31.836415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56179</div><div>2014-04-28 18:55:31.856415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56180</div>
<div>2014-04-28 18:55:31.896415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56183</div><div>2014-04-28 18:55:31.896415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56184</div>
<div>2014-04-28 18:55:31.896415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56185</div><div>2014-04-28 18:55:31.916416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56186</div>
<div>2014-04-28 18:55:31.916416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56187</div><div>2014-04-28 18:55:31.916416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56188</div>
<div>2014-04-28 18:55:31.936415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56189</div><div>2014-04-28 18:55:31.936415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56190</div>
<div>2014-04-28 18:55:31.936415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56191</div><div>2014-04-28 18:55:31.996416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56192</div>
<div>2014-04-28 18:55:32.036417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56194</div><div>2014-04-28 18:55:32.036417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56195</div>
<div>2014-04-28 18:55:32.036417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56196</div><div>2014-04-28 18:55:32.056417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56197</div>
</div><div><br></div><div><br></div><div>Can you confirm again?</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">2014-04-28 20:03 GMT+08:00 Michael Jerris <span dir="ltr"><<a href="mailto:mike@jerris.com" target="_blank">mike@jerris.com</a>></span>:<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div style="word-wrap:break-word">I think we have already fixed this bug. Have you tried updating to more recent code?<div>
<br><div><div><div><div>On Apr 28, 2014, at 7:46 AM, rockxsj <<a href="mailto:rockxsj@gmail.com" target="_blank">rockxsj@gmail.com</a>> wrote:</div><br></div></div><blockquote type="cite"><div><div>
<div bgcolor="#FFFFFF" text="#000000">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">Hi guys!<span><br>
<br>
I found that the some of the incoming call will hangup with
case: WRONG_CALL_STATE,but else will be ok.After a hour,almost
every incoming call will be hangup with the same cause.Then I
will restart the freeswitch,it will server like before:some call
will be hangup with the cause...<br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
</span></span><br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">28e10f2e-c851-11e3-a146-85a8fadad1b0 2014-04-20
14:01:15.498169 [WARNING] switch_core_state_machine.c:567
28e10f2e-c851-11e3-a146-85a8fadad1b0
<a href="mailto:sofia/internal/123456@sipsj.236.cn" target="_blank">sofia/internal/123456@sipsj.236.cn</a> Abandoned<br>
28e10f2e-c851-11e3-a146-85a8fadad1b0 2014-04-20 14:01:15.498169
[NOTICE] switch_core_state_machine.c:570 Hangup
<a href="mailto:sofia/internal/123456@sipsj.236.cn" target="_blank">sofia/internal/123456@sipsj.236.cn</a> [CS_NEW] [WRONG_CALL_STATE]</span><br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">What does Wrong call state mean and what can I do to
fix this issue?<span> </span></span><br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">Everything else is working. I can make outgoing
calls and call other<span> </span></span><br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">extensions.<span> </span></span><br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">Thanks in advance.<span> </span></span><br style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;font-weight:normal;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px">
<span style="text-indent:0px;letter-spacing:normal;font-variant:normal;text-align:start;font-style:normal;display:inline!important;font-weight:normal;float:none;line-height:normal;text-transform:none;font-size:13px;white-space:normal;font-family:Verdana,Geneva,Helvetica,Arial,sans-serif;word-spacing:0px"> </span></div>
</div></div></blockquote></div></div></div></blockquote></div></div></blockquote></div></div></div></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><br clear="all"><div><br></div>-- <br><div dir="ltr">个人主页:<a href="http://yazi.whoknow.me" target="_blank">http://yazi.whoknow.me</a></div>
</div>