From f50d14a7d14e982a3e45af4390420f7e95caffaf Mon Sep 17 00:00:00 2001 From: Anthony Minessale Date: Thu, 19 Jul 2012 17:03:23 -0500 Subject: [PATCH] treate no method as INVITE --- src/mod/endpoints/mod_sofia/sofia.c | 19 +++++++++++-------- 1 file changed, 11 insertions(+), 8 deletions(-) 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; } }