switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile %s\n", profile_name);
return;
}
-
nh = nua_handle(profile->nua,
NULL,
SIPTAG_CONTACT_STR(profile->url),
TAG_END());
+ nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
+
nua_info(nh,
+ NUTAG_WITH_THIS(profile->nua),
TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
TAG_END());
}
} else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Bad signal\n");
- goto fail;
+ goto end;
}
if ((signal_ptr = switch_stristr("Duration=", sip->sip_payload->pl_data))) {
int tmp = atoi(sip->sip_payload->pl_data);
dtmf.digit = switch_rfc2833_to_char(tmp);
} else {
- goto fail;
+ goto end;
}
if (dtmf.digit) {
/* Send 200 OK response */
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
-
- goto end;
- } else {
- goto fail;
}
+ goto end;
}
if ((clientcode_header = sofia_glue_get_unknown_header(sip, "x-clientcode"))) {
switch_channel_set_variable(channel, "call_clientcode", clientcode_header);
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "Setting CMC to %s\n", clientcode_header);
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
- } else {
- goto fail;
}
goto end;
}
}
}
}
- goto end;
}
}
- goto end;
-
- fail:
-
- /* *shrug* just ok it */
- nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
end:
}
}
- if (sip->sip_payload->pl_data) {
+ if (sip->sip_payload && sip->sip_payload->pl_data) {
switch_event_add_body(event, "%s", sip->sip_payload->pl_data);
}
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "dispatched freeswitch event for INFO\n");
}
+ nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
+
return;
}