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

Freeswitch SVN brian at freeswitch.org
Mon Dec 31 15:33:08 EST 2007


Author: brian
Date: Mon Dec 31 15:33:08 2007
New Revision: 7044

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

Log:
generic code for various presence protocols we support

Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	(original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_presence.c	Mon Dec 31 15:33:08 2007
@@ -742,21 +742,13 @@
 					stream.write_function(&stream, "<remote>\n<identity display=\"%s\">sip:%s@%s</identity>\n", clean_from_user, clean_from_user, host);
 					stream.write_function(&stream, "<target uri=\"sip:**%s@%s\"/>\n", clean_to_user, host);
 					stream.write_function(&stream, "</remote>\n");
-				} else if (!strcasecmp(proto, "park")) {
-					stream.write_function(&stream, "<local>\n<identity display=\"parking\">sip:parking@%s;fifo=%s</identity>\n", 
-										  host, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
-					stream.write_function(&stream, "<target uri=\"sip:parking@%s\">\n", host);
+				} else if (!strcasecmp(proto, "park") | !strcasecmp(proto, "conf") | !strcasecmp(proto, "ext")) {
+					stream.write_function(&stream, "<local>\n<identity display=\"%s\">sip:%s@%s;%s=%s</identity>\n", 
+										  proto, proto, host, proto, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
+					stream.write_function(&stream, "<target uri=\"sip:%s@%s\">\n", proto, host);
 					stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"no\"/>\n</target>\n</local>\n");  
-					stream.write_function(&stream, "<remote>\n<identity display=\"parking\">sip:%s</identity>\n", uuid);
-					stream.write_function(&stream, "<target uri=\"sip:park+%s\"/>\n", uuid);
-					stream.write_function(&stream, "</remote>\n");
-				} else if (!strcasecmp(proto, "conf")) {
-					stream.write_function(&stream, "<local>\n<identity display=\"conference\">sip:conference@%s;conference=%s</identity>\n", 
-										  host, !switch_strlen_zero(clean_to_user) ? clean_to_user : "unknown");
-					stream.write_function(&stream, "<target uri=\"sip:conference@%s\">\n", host);
-					stream.write_function(&stream, "<param pname=\"+sip.rendering\" pvalue=\"yes\"/>\n</target>\n</local>\n");  
-					stream.write_function(&stream, "<remote>\n<identity display=\"conference\">sip:%s@%s</identity>\n", uuid, host);
-					stream.write_function(&stream, "<target uri=\"sip:conf+%s@%s\"/>\n", uuid, host);
+					stream.write_function(&stream, "<remote>\n<identity display=\"%s\">sip:%s@%s</identity>\n", proto, uuid, host);
+					stream.write_function(&stream, "<target uri=\"sip:%s+%s@%s;%s=%s\"/>\n", proto, uuid, host, proto, uuid);
 					stream.write_function(&stream, "</remote>\n");
 				}
 			}



More information about the Freeswitch-svn mailing list