[asterisk-commits] jrose: branch jrose/bridge_projects r385544 - /team/jrose/bridge_projects/res...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Apr 12 16:34:33 CDT 2013


Author: jrose
Date: Fri Apr 12 16:34:30 2013
New Revision: 385544

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=385544
Log:
fix flatten peer function

Modified:
    team/jrose/bridge_projects/res/parking/parking_controller.c

Modified: team/jrose/bridge_projects/res/parking/parking_controller.c
URL: http://svnview.digium.com/svn/asterisk/team/jrose/bridge_projects/res/parking/parking_controller.c?view=diff&rev=385544&r1=385543&r2=385544
==============================================================================
--- team/jrose/bridge_projects/res/parking/parking_controller.c (original)
+++ team/jrose/bridge_projects/res/parking/parking_controller.c Fri Apr 12 16:34:30 2013
@@ -246,9 +246,18 @@
 static void flatten_peername(char *peername)
 {
 	int i;
+	char *dash;
+
+	/* Truncate after the dash */
+	dash = strrchr(peername, '-');
+	if (dash) {
+		*dash = '\0';
+	}
+
+	/* Replace slashes with underscores since slashes are reserved characters for extension matching */
 	for (i = 0; peername[i]; i++) {
 		if (peername[i] == '/') {
-			/* The underscore is, of course, the flattest character of them all. */
+			/* The underscore is the flattest character of all. */
 			peername[i] = '_';
 		}
 	}




More information about the asterisk-commits mailing list