FS-6540 #comment please test this patch for the added notify functionality

This commit is contained in:
Anthony Minessale 2014-07-17 22:35:04 -05:00
parent 458ffc4714
commit 3ce4ae962b
2 changed files with 35 additions and 2 deletions

View File

@ -1180,10 +1180,22 @@ static switch_status_t sofia_receive_message(switch_core_session_t *session, swi
break;
case SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE:
{
const char *event = switch_channel_get_variable(channel, "sip_blind_transfer_event");
const char *uuid = switch_channel_get_variable(channel, "blind_transfer_uuid");
const char *event;
const char *uuid;
char *xdest;
if (msg->string_arg) {
nua_notify(tech_pvt->nh, NUTAG_NEWSUB(1), SIPTAG_CONTENT_TYPE_STR("message/sipfrag;version=2.0"),
NUTAG_SUBSTATE(nua_substate_terminated),
SIPTAG_SUBSCRIPTION_STATE_STR("terminated;reason=noresource"),
SIPTAG_PAYLOAD_STR(msg->string_arg),
SIPTAG_EVENT_STR("refer"), TAG_END());
goto end;
}
event = switch_channel_get_variable(channel, "sip_blind_transfer_event");
uuid = switch_channel_get_variable(channel, "blind_transfer_uuid");
if (event && uuid) {
char payload_str[255] = "SIP/2.0 403 Forbidden\r\n";
if (msg->numeric_arg) {

View File

@ -550,6 +550,27 @@ void sofia_handle_sip_i_notify(switch_core_session_t *session, int status,
switch_assert(tech_pvt != NULL);
}
if (sofia_test_pflag(profile, PFLAG_PROXY_REFER) && sip->sip_payload && sip->sip_payload->pl_data &&
sip->sip_content_type && sip->sip_content_type->c_type &&
switch_stristr("sipfrag", sip->sip_content_type->c_type)) {
switch_core_session_t *other_session;
if (switch_core_session_get_partner(session, &other_session) == SWITCH_STATUS_SUCCESS) {
switch_core_session_message_t *msg;
msg = switch_core_session_alloc(other_session, sizeof(*msg));
MESSAGE_STAMP_FFL(msg);
msg->message_id = SWITCH_MESSAGE_INDICATE_BLIND_TRANSFER_RESPONSE;
msg->string_arg = switch_core_session_strdup(other_session, sip->sip_payload->pl_data);
msg->from = __FILE__;
switch_core_session_queue_message(other_session, msg);
switch_core_session_rwunlock(other_session);
nua_respond(nh, SIP_202_ACCEPTED, NUTAG_WITH_THIS_MSG(de->data->e_msg), TAG_END());
goto end;
}
}
/* For additional NOTIFY event packages see http://www.iana.org/assignments/sip-events. */
if (sip->sip_content_type &&
sip->sip_content_type->c_type && sip->sip_payload && sip->sip_payload->pl_data && !strcasecmp(sip->sip_event->o_type, "refer")) {