From: Anthony Minessale Date: Wed, 21 Aug 2013 17:00:44 +0000 (+0500) Subject: fix rfc4579 method=bye handling X-Git-Tag: v1.5.5~19 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=655fe8408d875f9919fcebd27a77d65e082d2511;p=thirdparty%2Ffreeswitch.git fix rfc4579 method=bye handling --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index b399284337..a7e3818603 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -1299,19 +1299,18 @@ static void our_sofia_event_callback(nua_event_t event, } - if ((refer_to = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_refer_to))) { - - if ((tmp = sofia_glue_get_url_from_contact(refer_to, 0))) { - refer_to = tmp; - } - - if ((iparams = strrchr(refer_to, ';'))) { + if ((refer_to = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_refer_to))) { + if ((iparams = strchr(refer_to, ';'))) { *iparams++ = '\0'; - if (!switch_stristr("method=", iparams)) { + if (!params || !switch_stristr("method=", params)) { params = iparams; } } + + if ((tmp = sofia_glue_get_url_from_contact(refer_to, 0))) { + refer_to = tmp; + } } if (params) {