treate no method as INVITE

This commit is contained in:
Anthony Minessale 2012-07-19 17:03:23 -05:00
parent 4f7122c866
commit f50d14a7d1
1 changed files with 11 additions and 8 deletions

View 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); refer_to = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_refer_to);
if ((params = strchr(refer_to, ';'))) { if ((params = strchr(refer_to, ';'))) {
*params++ = '\0'; *params++ = '\0';
if ((method = switch_find_parameter(params, "method", NULL))) {
if (!strcasecmp(method, "INVITE")) { if (!(method = switch_find_parameter(params, "method", NULL))) {
action = "call"; method = strdup("INVITE");
} else if (!strcasecmp(method, "BYE")) { }
action = "end";
} else { if (!strcasecmp(method, "INVITE")) {
action = method; action = "call";
} } else if (!strcasecmp(method, "BYE")) {
action = "end";
} else {
action = method;
} }
} }