I add some code to log the pop function,just like below:switch_mutex_lock(mod_sofia_globals.mutex);n = msg_queue_threads;msg_queue_threads++;switch_mutex_unlock(mod_sofia_globals.mutex);switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MSG Thread %d Started\n", my_id);for(;;) {if (switch_queue_pop(q, &pop) != SWITCH_STATUS_SUCCESS) {switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "POP FAIL %s\n", "SELF");switch_cond_next();continue;}if (pop) {sofia_dispatch_event_t *de = (sofia_dispatch_event_t *) pop;switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MSG Thread %d Dispatcher Started\n", n);sofia_process_dispatch_event(&de);switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "MSG Thread %d Dispatcher Ended\n", n);} else {break;}}And I got logs like below:2014-04-28 21:23:54.229117 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:54.229174 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:54.231115 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:54.231137 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:54.894118 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:54.894157 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:54.894232 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:55.200100 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:55.200127 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:55.540108 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:55.540108 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:55.840114 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:55.840114 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:55.840114 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:55.840114 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:56.100116 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher Ended2014-04-28 21:23:56.100116 [WARNING] sofia.c:1922 MSG Thread 0 Dispatcher Started2014-04-28 21:23:56.380119 [WARNING] sofia.c:1924 MSG Thread 0 Dispatcher EndedI 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?2014-04-28 21:22 GMT+08:00 Michael Jerris <mike@jerris.com>: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.On Apr 28, 2014, at 9:07 AM, 李俊俊 <rockxsj@gmail.com> wrote:Yes,my code is pulled from the master branch on 4.23.It seems that the push is fast than pop.I add some code to log the queue length,just like below:if (!sofia_private) {if (sess_count >= sess_max || !sofia_test_pflag(profile, PFLAG_RUNNING) || !switch_core_ready_inbound()) {nua_respond(nh, 503, "Maximum Calls In Progress", SIPTAG_RETRY_AFTER_STR("300"), NUTAG_WITH_THIS(nua), TAG_END());goto end;}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));switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "critical:%d\n", (unsigned int)critical);if (switch_queue_size(mod_sofia_globals.msg_queue) > (unsigned int)critical) {nua_respond(nh, 503, "System Busy", SIPTAG_RETRY_AFTER_STR("300"), NUTAG_WITH_THIS(nua), TAG_END());goto end;}if (sofia_test_pflag(profile, PFLAG_STANDBY)) {nua_respond(nh, 503, "System Paused", NUTAG_WITH_THIS(nua), TAG_END());goto end;}}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:2014-04-28 18:55:31.416405 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561572014-04-28 18:55:31.436402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561582014-04-28 18:55:31.436402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561592014-04-28 18:55:31.476402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561602014-04-28 18:55:31.496402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561612014-04-28 18:55:31.496402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561622014-04-28 18:55:31.496402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561632014-04-28 18:55:31.516402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561642014-04-28 18:55:31.516402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561652014-04-28 18:55:31.536402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561662014-04-28 18:55:31.556402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561672014-04-28 18:55:31.576407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561682014-04-28 18:55:31.576407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561692014-04-28 18:55:31.576407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561702014-04-28 18:55:31.596403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561712014-04-28 18:55:31.616404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561692014-04-28 18:55:31.636404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561702014-04-28 18:55:31.656403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561722014-04-28 18:55:31.656403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561732014-04-28 18:55:31.656403 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561742014-04-28 18:55:31.676404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561752014-04-28 18:55:31.676404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561752014-04-28 18:55:31.716404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561772014-04-28 18:55:31.716404 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561782014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561802014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561812014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561822014-04-28 18:55:31.756407 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561832014-04-28 18:55:31.776414 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561842014-04-28 18:55:31.796402 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561852014-04-28 18:55:31.836415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561792014-04-28 18:55:31.856415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561802014-04-28 18:55:31.896415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561832014-04-28 18:55:31.896415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561842014-04-28 18:55:31.896415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561852014-04-28 18:55:31.916416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561862014-04-28 18:55:31.916416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561872014-04-28 18:55:31.916416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561882014-04-28 18:55:31.936415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561892014-04-28 18:55:31.936415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561902014-04-28 18:55:31.936415 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561912014-04-28 18:55:31.996416 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561922014-04-28 18:55:32.036417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561942014-04-28 18:55:32.036417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561952014-04-28 18:55:32.036417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):561962014-04-28 18:55:32.056417 [DEBUG] sofia.c:2081 switch_queue_size(mod_sofia_globals.msg_queue):56197Can you confirm again?2014-04-28 20:03 GMT+08:00 Michael Jerris <mike@jerris.com>:
I think we have already fixed this bug. Have you tried updating to more recent code?On Apr 28, 2014, at 7:46 AM, rockxsj <rockxsj@gmail.com> wrote:Hi guys!
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...
28e10f2e-c851-11e3-a146-85a8fadad1b0 2014-04-20 14:01:15.498169 [WARNING] switch_core_state_machine.c:567 28e10f2e-c851-11e3-a146-85a8fadad1b0 sofia/internal/123456@sipsj.236.cn Abandoned
28e10f2e-c851-11e3-a146-85a8fadad1b0 2014-04-20 14:01:15.498169 [NOTICE] switch_core_state_machine.c:570 Hangup sofia/internal/123456@sipsj.236.cn [CS_NEW] [WRONG_CALL_STATE]
What does Wrong call state mean and what can I do to fix this issue?
Everything else is working. I can make outgoing calls and call other
extensions.
Thanks in advance.
_________________________________________________________________________
Professional FreeSWITCH Consulting Services:
consulting@freeswitch.org
http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server
http://www.cudatel.com
Official FreeSWITCH Sites
http://www.freeswitch.org
http://wiki.freeswitch.org
http://www.cluecon.com
FreeSWITCH-users mailing list
FreeSWITCH-users@lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org
--