[Freeswitch-svn] [commit] r13365 - freeswitch/trunk/src/mod/applications/mod_lcr

FreeSWITCH SVN intralanman at freeswitch.org
Fri May 15 13:03:17 PDT 2009


Author: intralanman
Date: Fri May 15 15:03:17 2009
New Revision: 13365

Log:
MODAPP-279

Modified:
   freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c

Modified: freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c
==============================================================================
--- freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c	(original)
+++ freeswitch/trunk/src/mod/applications/mod_lcr/mod_lcr.c	Fri May 15 15:03:17 2009
@@ -230,17 +230,26 @@
 	char *cid = NULL;
 
 	orig_destination_number = destination_number = switch_core_strdup(pool, dialed_number);
-
+	
 	tstrip = ((cur_route->digit_len - cur_route->tstrip) + 1);
 	lstrip = cur_route->lstrip;
 	
-	if (strlen(destination_number) > tstrip && cur_route->tstrip > 0) {
-		destination_number[tstrip] = '\0';
-	}
-	if (strlen(destination_number) > lstrip && cur_route->lstrip > 0) {
-		destination_number += lstrip;
-	}
-	
+	if (cur_route->tstrip > 0) {
+		if (strlen(destination_number) > tstrip) {
+			destination_number[tstrip] = '\0';
+		}
+		else {
+			destination_number[0] = '\0';
+			       }
+    }
+	if (cur_route->lstrip > 0) {
+		if (strlen(destination_number) > lstrip) {
+			destination_number += lstrip;
+		}
+		else {
+			destination_number[0] = '\0';
+		}
+	}	
 	codec = "";
 	if (!switch_strlen_zero(cur_route->codec)) {
 		codec = switch_core_sprintf(pool, ",absolute_codec_string=%s", cur_route->codec);



More information about the Freeswitch-svn mailing list