Browse Source

changed SMS numbering

Jiri Kuthan 23 năm trước cách đây
mục cha
commit
8728d5caef
2 tập tin đã thay đổi với 15 bổ sung41 xóa
  1. 1 41
      etc/iptel.cfg
  2. 14 0
      etc/smsgw.cfg

+ 1 - 41
etc/iptel.cfg

@@ -568,21 +568,7 @@ route[3] {
 	# lack of serial interfaces)
 	if (method=="MESSAGE") {
 		# note that we don't do any admission control yet:
-		# anyone can call anywhere; we just check for valid
-		# german cell net prefix and strip the first
-		# zero 
-		if (uri=~"sip:001" ) {
-			strip(2);
-			prefix("49");
-		} else if (uri=~"sip:\+491") {
-			strip(1);
-		} else if (uri=~"sip:000491") {
-			strip(3);
-		} else {
-			sl_send_reply("403", "SMS only to German 01* networks");
-			break;
-		};
-		
+		# anyone can SMS anywhere; 
 		rewritehostport("195.37.77.100:5070");
 	} else  {
 		rewritehostport("195.37.77.110:5060");
@@ -595,29 +581,3 @@ route[3] {
 	};
 }
 
-/*
-
-if (! t_newtran()) { 
-	# # retransmit whatever we have 
-	t_retransmit_reply(); 
-} else {
-	# do what you want to do 
-	if (send_sms()) { 
-		# things went well, send ok upstream
-		if (!t_send_reply("200", "yes sir, SMS sent over")) {
-			# if replying failed, retry statelessly 
-			sl_reply_error(); 
-		};
-	} else {
-		if (!t_send_reply("500", "SMS error :-(")) {
-			# if replying failed, retry statelessly 
-			sl_reply_error(); 
-		};
-	};
-	# transaction concluded -- junk it now
-	t_release(); 
-}
-t_unref();
-
-*/
-

+ 14 - 0
etc/smsgw.cfg

@@ -82,6 +82,20 @@ route{
 		break;
 	};
 
+	# SMS expects the numbers as follows <int> <area> <nr>
+	# align numbering to it
+	if (uri=~"sip:001" ) {
+		strip(2);
+		prefix("49");
+	} else if (uri=~"sip:\+491") {
+		strip(1);
+	} else if (uri=~"sip:000491") {
+		strip(3);
+	} else {
+		sl_send_reply("403", "SMS only to German 01* networks");
+		break;
+	};
+
 	if (! t_newtran())
 	{
 		# retransmit whatever we have