Revision
16315
Author
brian
Date
2010-01-14 18:31:43 -0600 (Thu, 14 Jan 2010)

Log Message

 finally fix private hold 

Modified Paths

Diff

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c (16314 => 16315)


--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-01-14 21:31:40 UTC (rev 16314)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	2010-01-15 00:31:43 UTC (rev 16315)
@@ -51,6 +51,10 @@
 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);
 
 
@@ -671,7 +675,11 @@
 		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);
@@ -5311,6 +5319,25 @@
 	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;

Modified: freeswitch/trunk/src/switch_channel.c (16314 => 16315)


--- freeswitch/trunk/src/switch_channel.c	2010-01-14 21:31:40 UTC (rev 16314)
+++ freeswitch/trunk/src/switch_channel.c	2010-01-15 00:31:43 UTC (rev 16315)
@@ -503,10 +503,10 @@
 
 			if (!switch_channel_up(channel)) {
 				call_info_state = "idle";
+			} else if (!strcasecmp(status, "hold-private")) {
+				call_info_state = "held-private";
 			} else if (!strcasecmp(status, "hold")) {
 				call_info_state = "held";
-			} else if (!strcasecmp(status, "hold-private")) {
-				call_info_state = "held-private";
 			} else if (!switch_channel_test_flag(channel, CF_ANSWERED)) {
 				if (channel->direction == SWITCH_CALL_DIRECTION_OUTBOUND) {
 					call_info_state = "progressing";

Modified: freeswitch/trunk/src/switch_time.c (16314 => 16315)


--- freeswitch/trunk/src/switch_time.c	2010-01-14 21:31:40 UTC (rev 16314)
+++ freeswitch/trunk/src/switch_time.c	2010-01-15 00:31:43 UTC (rev 16315)
@@ -189,7 +189,7 @@
 	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;
@@ -206,7 +206,7 @@
 		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;