提交 5e2e0b36 authored 作者: Anthony Minessale's avatar Anthony Minessale

add sip info to event_socket gateway

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@13088 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 a1bca1e1
...@@ -2899,7 +2899,6 @@ static void general_event_handler(switch_event_t *event) ...@@ -2899,7 +2899,6 @@ static void general_event_handler(switch_event_t *event)
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile %s\n", profile_name); switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't find profile %s\n", profile_name);
return; return;
} }
nh = nua_handle(profile->nua, nh = nua_handle(profile->nua,
NULL, NULL,
...@@ -2909,7 +2908,10 @@ static void general_event_handler(switch_event_t *event) ...@@ -2909,7 +2908,10 @@ static void general_event_handler(switch_event_t *event)
SIPTAG_CONTACT_STR(profile->url), SIPTAG_CONTACT_STR(profile->url),
TAG_END()); TAG_END());
nua_handle_bind(nh, &mod_sofia_globals.destroy_private);
nua_info(nh, nua_info(nh,
NUTAG_WITH_THIS(profile->nua),
TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)), TAG_IF(ct, SIPTAG_CONTENT_TYPE_STR(ct)),
TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)), TAG_IF(!switch_strlen_zero(body), SIPTAG_PAYLOAD_STR(body)),
TAG_END()); TAG_END());
......
...@@ -3900,7 +3900,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -3900,7 +3900,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
} }
} else { } else {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "Bad signal\n"); 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))) { if ((signal_ptr = switch_stristr("Duration=", sip->sip_payload->pl_data))) {
...@@ -3916,7 +3916,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -3916,7 +3916,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
int tmp = atoi(sip->sip_payload->pl_data); int tmp = atoi(sip->sip_payload->pl_data);
dtmf.digit = switch_rfc2833_to_char(tmp); dtmf.digit = switch_rfc2833_to_char(tmp);
} else { } else {
goto fail; goto end;
} }
if (dtmf.digit) { if (dtmf.digit) {
...@@ -3944,11 +3944,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -3944,11 +3944,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
/* Send 200 OK response */ /* Send 200 OK response */
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END()); 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"))) { if ((clientcode_header = sofia_glue_get_unknown_header(sip, "x-clientcode"))) {
...@@ -3956,8 +3953,6 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -3956,8 +3953,6 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_channel_set_variable(channel, "call_clientcode", clientcode_header); 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); 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()); nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
} else {
goto fail;
} }
goto end; goto end;
} }
...@@ -3991,15 +3986,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -3991,15 +3986,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
} }
} }
} }
goto end;
} }
} }
goto end;
fail:
/* *shrug* just ok it */
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua), TAG_END());
end: end:
...@@ -4041,7 +4029,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -4041,7 +4029,7 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
} }
} }
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_event_add_body(event, "%s", sip->sip_payload->pl_data);
} }
...@@ -4049,6 +4037,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t ...@@ -4049,6 +4037,8 @@ void sofia_handle_sip_i_info(nua_t *nua, sofia_profile_t *profile, nua_handle_t
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "dispatched freeswitch event for INFO\n"); 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; return;
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论