]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
treate no method as INVITE
authorAnthony Minessale <anthm@freeswitch.org>
Thu, 19 Jul 2012 22:03:23 +0000 (17:03 -0500)
committerAnthony Minessale <anthm@freeswitch.org>
Thu, 19 Jul 2012 22:03:23 +0000 (17:03 -0500)
src/mod/endpoints/mod_sofia/sofia.c

index 3533c29d49296f1ab882e93d679b700437c3a40f..e331e6d4f6b1d2696ce106588aea979268625d20 100644 (file)
@@ -1204,14 +1204,17 @@ static void our_sofia_event_callback(nua_event_t event,
                                refer_to = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_refer_to);
                                if ((params = strchr(refer_to, ';'))) {
                                        *params++ = '\0';
-                                       if ((method = switch_find_parameter(params, "method", NULL))) {
-                                               if (!strcasecmp(method, "INVITE")) {
-                                                       action = "call";
-                                               } else if (!strcasecmp(method, "BYE")) {
-                                                       action = "end";
-                                               } else {
-                                                       action = method;
-                                               }
+
+                                       if (!(method = switch_find_parameter(params, "method", NULL))) {
+                                               method = strdup("INVITE");
+                                       }
+
+                                       if (!strcasecmp(method, "INVITE")) {
+                                               action = "call";
+                                       } else if (!strcasecmp(method, "BYE")) {
+                                               action = "end";
+                                       } else {
+                                               action = method;
                                        }
                                }