extern su_log_t stun_log[];
extern su_log_t su_log_default[];
+
+void sofia_handle_sip_i_reinvite(switch_core_session_t *session,
+ nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[]);
+
static void set_variable_sip_param(switch_channel_t *channel, char *header_type, sip_param_t const *params);
sofia_handle_sip_i_options(status, phrase, nua, profile, nh, sofia_private, sip, tags);
break;
case nua_i_invite:
- if (!session) sofia_handle_sip_i_invite(nua, profile, nh, sofia_private, sip, tags);
+ if (session) {
+ sofia_handle_sip_i_reinvite(session, nua, profile, nh, sofia_private, sip, tags);
+ } else {
+ sofia_handle_sip_i_invite(nua, profile, nh, sofia_private, sip, tags);
+ }
break;
case nua_i_publish:
sofia_presence_handle_sip_i_publish(nua, profile, nh, sofia_private, sip, tags);
return uri;
}
+void sofia_handle_sip_i_reinvite(switch_core_session_t *session,
+ nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
+{
+ char *call_info = NULL;
+
+ if (sofia_test_pflag(profile, PFLAG_MANAGE_SHARED_APPEARANCE)) {
+ switch_channel_t *channel = switch_core_session_get_channel(session);
+ if (channel && sip->sip_call_info) {
+ char *p;
+ if ((call_info = sip_header_as_string(nua_handle_home(nh), (void *) sip->sip_call_info))) {
+ if ((p = strchr(call_info, ';'))) {
+ switch_channel_set_variable(channel, "presence_call_info", p+1);
+ }
+ su_free(nua_handle_home(nh), call_info);
+ }
+ }
+ }
+}
+
void sofia_handle_sip_i_invite(nua_t *nua, sofia_profile_t *profile, nua_handle_t *nh, sofia_private_t *sofia_private, sip_t const *sip, tagi_t tags[])
{
switch_core_session_t *session = NULL;
if (!switch_channel_up(channel)) {
call_info_state = "idle";
- } else if (!strcasecmp(status, "hold")) {
- call_info_state = "held";
} else if (!strcasecmp(status, "hold-private")) {
call_info_state = "held-private";
+ } else if (!strcasecmp(status, "hold")) {
+ call_info_state = "held";
} else if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
if (channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND) {
call_info_state = "progressing";
if (ts.tv_nsec / 1000 > 1500) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Timer resolution of %ld microseconds detected!\n"
- "Do you have your kernel timer set to higher than 1khz? You may experience audio problems.\n", ts.tv_nsec / 1000);
+ "Do you have your kernel timer set to higher than 1 kHz? You may experience audio problems.\n", ts.tv_nsec / 1000);
do_sleep(5000000);
switch_time_set_cond_yield(SWITCH_TRUE);
return;
if (diff > 1500) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING,
"Abnormally large timer gap %d detected!\n"
- "Do you have your kernel timer set to higher than 1khz? You may experience audio problems.\n", diff);
+ "Do you have your kernel timer set to higher than 1 kHz? You may experience audio problems.\n", diff);
do_sleep(5000000);
switch_time_set_cond_yield(SWITCH_TRUE);
return;