[asterisk-commits] oej: branch oej/oolong-path-1.4 r375360 - in /team/oej/oolong-path-1.4: chann...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Sun Oct 28 08:45:09 CDT 2012


Author: oej
Date: Sun Oct 28 08:45:05 2012
New Revision: 375360

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=375360
Log:
-- oo --

Modified:
    team/oej/oolong-path-1.4/channels/chan_sip.c
    team/oej/oolong-path-1.4/configs/sip.conf.sample

Modified: team/oej/oolong-path-1.4/channels/chan_sip.c
URL: http://svnview.digium.com/svn/asterisk/team/oej/oolong-path-1.4/channels/chan_sip.c?view=diff&rev=375360&r1=375359&r2=375360
==============================================================================
--- team/oej/oolong-path-1.4/channels/chan_sip.c (original)
+++ team/oej/oolong-path-1.4/channels/chan_sip.c Sun Oct 28 08:45:05 2012
@@ -832,6 +832,7 @@
 	SIP_PAGE2_UDPTL_DESTINATION | SIP_PAGE2_FORWARD_LOOP_DETECTED)
 
 #define SIP_PAGE3_USEPATH		(1 << 1)       /*!< 1: Path header supported */
+#define SIP_PAGE3_RT_SAVEPATH		(1 << 2)       /*!< 1: Realtime Path header supported */
 #define SIP_PAGE3_FLAGS_TO_COPY \
 	(SIP_PAGE3_USEPATH )
 
@@ -2706,14 +2707,25 @@
 	else if (ast_test_flag(&global_flags[1], SIP_PAGE2_RTSAVE_SYSNAME))
 		syslabel = "regserver";
 
-	if (fc)
-		ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr,
+	if(ast_test_flag(&global_flags[2], SIP_PAGE3_RT_SAVEPATH)) {
+		if (fc)
+			ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr,
+			"port", port, "regseconds", regseconds,
+			"username", username, fc, fullcontact, "path", path, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
+		else
+			ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr,
+			"port", port, "regseconds", regseconds,
+			"username", username, "path", path, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
+	} else {
+		if (fc)
+			ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr,
 			"port", port, "regseconds", regseconds,
 			"username", username, fc, fullcontact, syslabel, sysname, NULL); /* note fc and syslabel _can_ be NULL */
-	else
-		ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr,
+		else
+			ast_update_realtime("sippeers", "name", peername, "ipaddr", ipaddr,
 			"port", port, "regseconds", regseconds,
 			"username", username, syslabel, sysname, NULL); /* note syslabel _can_ be NULL */
+	}
 	if (seen_lastms) {
 		/* We cannot do this in the same statement as above, because the lack of
 		 * this field could cause the whole statement to fail. */
@@ -12293,6 +12305,7 @@
 		ast_cli(fd, "  Update:                 %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_RTUPDATE) ? "Yes" : "No");
 		ast_cli(fd, "  Ignore Reg. Expire:     %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_IGNOREREGEXPIRE) ? "Yes" : "No");
 		ast_cli(fd, "  Save sys. name:         %s\n", ast_test_flag(&global_flags[1], SIP_PAGE2_RTSAVE_SYSNAME) ? "Yes" : "No");
+		ast_cli(fd, "  Save path:              %s\n", ast_test_flag(&global_flags[2], SIP_PAGE3_RT_SAVEPATH) ? "Yes" : "No");
 		ast_cli(fd, "  Auto Clear:             %d (%s)", global_rtautoclear, ast_test_flag(&global_flags[1], SIP_PAGE2_RTAUTOCLEAR) ? "Enabled" : "Disabled");
 	}
 	ast_cli(fd, "\n----\n");
@@ -19342,6 +19355,8 @@
 			ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_RTCACHEFRIENDS);	
 		} else if (!strcasecmp(v->name, "rtsavesysname")) {
 			ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_RTSAVE_SYSNAME);	
+		} else if (!strcasecmp(v->name, "rtsavepath")) {
+			ast_set2_flag(&global_flags[2], ast_true(v->value), SIP_PAGE3_RT_SAVEPATH);	
 		} else if (!strcasecmp(v->name, "rtupdate")) {
 			ast_set2_flag(&global_flags[1], ast_true(v->value), SIP_PAGE2_RTUPDATE);	
 		} else if (!strcasecmp(v->name, "ignoreregexpire")) {

Modified: team/oej/oolong-path-1.4/configs/sip.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/oej/oolong-path-1.4/configs/sip.conf.sample?view=diff&rev=375360&r1=375359&r2=375360
==============================================================================
--- team/oej/oolong-path-1.4/configs/sip.conf.sample (original)
+++ team/oej/oolong-path-1.4/configs/sip.conf.sample Sun Oct 28 08:45:05 2012
@@ -431,6 +431,9 @@
                                 ; as-needed basis? (yes|no)
 
 ;rtsavesysname=yes              ; Save systemname in realtime database at registration
+                                ; Default= no
+
+;rtsavespath=yes                ; Save path header in realtime database
                                 ; Default= no
 
 ;rtupdate=yes                   ; Send registry updates to database using realtime? (yes|no)




More information about the asterisk-commits mailing list