提交 7028acf9 authored 作者: Anthony Minessale's avatar Anthony Minessale

update

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@5817 d0543943-73ff-0310-b7d9-9358b9ac24b2
上级 90cd8e0c
......@@ -42,6 +42,18 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]);
void sofia_handle_sip_i_notify(int status,
char const *phrase,
nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
{
nua_respond(nh, SIP_200_OK, NUTAG_WITH_THIS(nua),TAG_END());
//nua_handle_destroy(nh);
}
void sofia_event_callback(nua_event_t event,
int status,
char const *phrase,
......@@ -136,15 +148,6 @@ void sofia_event_callback(nua_event_t event,
break;
case nua_r_invite:
{
if (channel) {
char *val;
if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END());
}
}
}
break;
case nua_r_get_params:
case nua_r_unregister:
case nua_r_options:
......@@ -155,7 +158,6 @@ void sofia_event_callback(nua_event_t event,
case nua_r_unsubscribe:
case nua_r_publish:
case nua_r_notify:
case nua_i_notify:
case nua_i_cancel:
case nua_i_error:
case nua_i_active:
......@@ -163,6 +165,9 @@ void sofia_event_callback(nua_event_t event,
case nua_i_terminated:
case nua_r_set_params:
break;
case nua_i_notify:
sofia_handle_sip_i_notify(status, phrase, nua, profile, nh, sofia_private, sip, tags);
break;
case nua_r_register:
sofia_reg_handle_sip_r_register(status, phrase, nua, profile, nh, sofia_private, sip, tags);
break;
......@@ -1072,6 +1077,15 @@ static void sofia_handle_sip_i_state(switch_core_session_t *session, int status,
if (status == 988) {
goto done;
}
if (channel && (status == 180 || status == 183)) {
char *val;
if ((val = switch_channel_get_variable(channel, "sip_auto_answer")) && switch_true(val)) {
nua_notify(nh, NUTAG_NEWSUB(1), NUTAG_SUBSTATE(nua_substate_active), SIPTAG_EVENT_STR("talk"), TAG_END());
}
}
switch ((enum nua_callstate) ss_state) {
case nua_callstate_init:
......@@ -2106,3 +2120,4 @@ void sofia_handle_sip_i_options(int status,
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论