]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
fix rfc4579 method=bye handling
authorAnthony Minessale <anthm@freeswitch.org>
Wed, 21 Aug 2013 17:00:44 +0000 (22:00 +0500)
committerAnthony Minessale <anthm@freeswitch.org>
Wed, 21 Aug 2013 17:00:47 +0000 (22:00 +0500)
src/mod/endpoints/mod_sofia/sofia.c

index b3992843374cb40e31334adec26f04df6be135df..a7e38186030f7eaca876224e41a01e131833b241 100644 (file)
@@ -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) {