From: Anthony Minessale Date: Thu, 19 Jul 2012 22:03:23 +0000 (-0500) Subject: treate no method as INVITE X-Git-Tag: v1.2.0~100 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f50d14a7d14e982a3e45af4390420f7e95caffaf;p=thirdparty%2Ffreeswitch.git treate no method as INVITE --- diff --git a/src/mod/endpoints/mod_sofia/sofia.c b/src/mod/endpoints/mod_sofia/sofia.c index 3533c29d49..e331e6d4f6 100644 --- a/src/mod/endpoints/mod_sofia/sofia.c +++ b/src/mod/endpoints/mod_sofia/sofia.c @@ -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; } }