[Asterisk-cvs] asterisk/channels/h323 ast_h323.cpp,1.35,1.36 h323.conf.sample,1.8,1.9

jeremy at lists.digium.com jeremy at lists.digium.com
Thu Mar 18 15:44:11 CST 2004


Update of /usr/cvsroot/asterisk/channels/h323
In directory mongoose.digium.com:/tmp/cvs-serv32653/channels/h323

Modified Files:
	ast_h323.cpp h323.conf.sample 
Log Message:
Properly deal with E.164 and Prefix routing


Index: ast_h323.cpp
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.cpp,v
retrieving revision 1.35
retrieving revision 1.36
diff -u -d -r1.35 -r1.36
--- ast_h323.cpp	4 Mar 2004 06:11:23 -0000	1.35
+++ ast_h323.cpp	18 Mar 2004 20:39:15 -0000	1.36
@@ -886,10 +886,7 @@
    
 int h323_set_alias(struct oh323_alias *alias)
 {
-	char *p;
-	char *num;
 	PString h323id(alias->name);
-	PString e164(alias->e164);
 	
 	if (!h323_end_point_exist()) {
 		cout << "ERROR: [h323_set_alias] No Endpoint, this is bad!" << endl;
@@ -900,18 +897,26 @@
 	endPoint->AddAliasName(h323id);	
 	endPoint->RemoveAliasName(localProcess->GetUserName());
 
-	if (!e164.IsEmpty()) {
-		cout << "  == Adding E.164 \"" << e164 << "\" to endpoint" << endl;
-		endPoint->AddAliasName(e164);
+	if(alias->e164) {
+		struct e164_number *num = alias->e164;
+		while(num) {
+			if(strlen(num->number)) {
+				cout << "  == Adding E.164 \"" << num->number << "\" to endpoint" << endl;
+				endPoint->AddAliasName(num->number);
+			}
+			num = num->next;
+		}
 	}
-	if (strlen(alias->prefix)) {
-		p = alias->prefix;
-		num = strsep(&p, ",");
+
+	if(alias->prefix) {
+		struct e164_number *num = alias->prefix;
 		while(num) {
-	        cout << "  == Adding Prefix \"" << num << "\" to endpoint" << endl;
-			endPoint->SupportedPrefixes += PString(num);
-			endPoint->SetGateway();
-	        num = strsep(&p, ",");		
+			if(strlen(num->number)) {
+				cout << "  == Adding Prefix \"" << num->number << "\" to endpoint" << endl;
+				endPoint->SupportedPrefixes += PString(num->number);
+				endPoint->SetGateway();
+			}
+			num = num->next;
 		}
 	}
 

Index: h323.conf.sample
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/h323.conf.sample,v
retrieving revision 1.8
retrieving revision 1.9
diff -u -d -r1.8 -r1.9
--- h323.conf.sample	24 Dec 2003 22:36:57 -0000	1.8
+++ h323.conf.sample	18 Mar 2004 20:39:15 -0000	1.9
@@ -49,14 +49,17 @@
 ; Default context gets used in siutations where you are using 
 ; the GK routed model or no type=user was found. This gives you 
 ; the ability to either play an invalid message or to simply not 
-; use user authentication at all.
+; use user authentication at all. Also, if a call is accepted for
+; a prefix or e164 number that cannot be matched to any of the
+; following sections, it will be sent here.
 ;
 ;context=default
 ;
 ; H.323 Alias definitions
 ;
 ; Type 'h323' will register aliases to the endpoint
-; and Gatekeeper, if there is one.
+; and Gatekeeper, if there is one. It will also offer
+; itself as a gateway for prefixes.
 ;
 ; Example: if someone calls time at your.asterisk.box.com
 ; Asterisk will send the call to the extension 'time' 
@@ -69,6 +72,11 @@
 ; Keyword's 'prefix' and 'e164' are only make sense when
 ; used with a gatekeeper. You can specify either a prefix 
 ; or E.164 this endpoint is responsible for terminating.
+; In the case of a prefix or e164, the context specified
+; in that section will receive the called extension. E164
+; numbers are matched before prefixes, so you can have
+; a prefix covering a general case, and a specific E164 in
+; another context.
 ; 
 ; Example: The H.323 alias 'det-gw' will tell the gatekeeper
 ; to route any call with the prefix 1248 to this alias. Keyword




More information about the svn-commits mailing list