From: Giovanni Maruzzelli Date: Wed, 25 Apr 2012 09:21:55 +0000 (+0200) Subject: gsmopen: correct sequence of callflow when got CEND: (nocarrier)->(hangup)->(idle) X-Git-Tag: v1.2-rc1~17^2~133 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=893d7eff9d112a7392152668abec772626b253e2;p=thirdparty%2Ffreeswitch.git gsmopen: correct sequence of callflow when got CEND: (nocarrier)->(hangup)->(idle) --- diff --git a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp index 33afb72e29..33b06c82d6 100644 --- a/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp +++ b/src/mod/endpoints/mod_gsmopen/gsmopen_protocol.cpp @@ -988,16 +988,6 @@ read: } if ((strncmp(tech_pvt->line_array.result[i], "^CEND:1", 7) == 0)) { - tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; - if (option_debug > 1) - DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); - if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { - DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); - tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; - gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); - DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); - } - tech_pvt->phone_callflow = CALLFLOW_CALL_NOCARRIER; if (option_debug > 1) DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_NOCARRIER\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); @@ -1015,6 +1005,17 @@ read: switch_core_session_rwunlock(session); switch_channel_hangup(channel, SWITCH_CAUSE_NONE); } + tech_pvt->phone_callflow = CALLFLOW_CALL_IDLE; + if (option_debug > 1) + DEBUGA_GSMOPEN("|%s| CALLFLOW_CALL_IDLE\n", GSMOPEN_P_LOG, tech_pvt->line_array.result[i]); + if (tech_pvt->interface_state != GSMOPEN_STATE_DOWN && tech_pvt->owner) { + DEBUGA_GSMOPEN("just received a remote HANGUP\n", GSMOPEN_P_LOG); + tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_NORMAL; + gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP); + DEBUGA_GSMOPEN("just sent GSMOPEN_CONTROL_HANGUP\n", GSMOPEN_P_LOG); + } + + // //tech_pvt->owner->hangupcause = GSMOPEN_CAUSE_FAILURE; //gsmopen_queue_control(tech_pvt->owner, GSMOPEN_CONTROL_HANGUP);