[Freeswitch-svn] [commit] r9149 - freeswitch/trunk/src/mod/endpoints/mod_sofia

Freeswitch SVN anthm at freeswitch.org
Wed Jul 23 18:21:24 EDT 2008


Author: anthm
Date: Wed Jul 23 18:21:24 2008
New Revision: 9149

Modified:
   freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c

Log:
shitsco should be embarrassed how damn stupid they are

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia.c	Wed Jul 23 18:21:24 2008
@@ -137,7 +137,10 @@
 
 	if (sip->sip_user_agent && !switch_strlen_zero(sip->sip_user_agent->g_string)) {
 		switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
+	} else if (sip->sip_user_agent && !switch_strlen_zero(sip->sip_server->g_string)) {
+		switch_channel_set_variable(channel, "sip_user_agent", sip->sip_server->g_string);
 	}
+
 	if ((tmp = sofia_glue_get_unknown_header(sip, "rtp-txstat"))) {
 		switch_channel_set_variable(channel, "sip_rtp_txstat", tmp);
 	}
@@ -2134,9 +2137,12 @@
 		status = 180;
 	}
 
-	if (channel && (status == 180 || status == 183 || status == 200) && 
-		sip && sip->sip_user_agent && sip->sip_user_agent->g_string && switch_channel_test_flag(channel, CF_OUTBOUND)) {
-		switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
+	if (sip && channel && (status == 180 || status == 183 || status == 200) && switch_channel_test_flag(channel, CF_OUTBOUND)) { 
+		if (sip->sip_user_agent && sip->sip_user_agent->g_string) {
+			switch_channel_set_variable(channel, "sip_user_agent", sip->sip_user_agent->g_string);
+		} else if (sip->sip_user_agent && sip->sip_server->g_string) {
+			switch_channel_set_variable(channel, "sip_user_agent", sip->sip_server->g_string);
+		}
 	}
 
 	if (channel && (status == 180 || status == 183) && switch_channel_test_flag(channel, CF_OUTBOUND)) {



More information about the Freeswitch-svn mailing list