[Asterisk-cvs] asterisk/channels/h323 ast_h323.cpp,1.37,1.38 ast_h323.h,1.18,1.19

jeremy at lists.digium.com jeremy at lists.digium.com
Sat Mar 20 09:28:46 CST 2004


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

Modified Files:
	ast_h323.cpp ast_h323.h 
Log Message:
rollback everything to known good state. E.164 and prefix routing patches are broken


Index: ast_h323.cpp
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.cpp,v
retrieving revision 1.37
retrieving revision 1.38
diff -u -d -r1.37 -r1.38
--- ast_h323.cpp	20 Mar 2004 14:14:00 -0000	1.37
+++ ast_h323.cpp	20 Mar 2004 14:24:20 -0000	1.38
@@ -687,7 +687,7 @@
 		cout << "		-- SessionID: " << sessionID << endl;
 		cout << "		-- Direction: " << dir << endl;
 	}
-	return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort);
+	return new H323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort);
 }
 
 /** This callback function is invoked once upon creation of each
@@ -720,63 +720,6 @@
 	return TRUE;	
 }
 
-/* MyH323_ExternalRTPChannel */
-MyH323_ExternalRTPChannel::MyH323_ExternalRTPChannel(MyH323Connection & connection,
-													const H323Capability & capability,
-													Directions direction,
-													unsigned sessionID,
-													const PIPSocket::Address & ip,
-													WORD dataPort)
-	: H323_ExternalRTPChannel(connection, capability, direction, sessionID, ip, dataPort)
-{
-	if (h323debug) {
-		cout << "	== New H.323 ExternalRTPChannel created." << endl;
-	}
-	return;
-}
-
-MyH323_ExternalRTPChannel::~MyH323_ExternalRTPChannel()
-{
-	if (h323debug) {
-		cout << "	== H.323 ExternalRTPChannel deleted." << endl;
-	}
-	return;
-}
-
-BOOL MyH323_ExternalRTPChannel::OnReceivedPDU(
-				const H245_H2250LogicalChannelParameters & param,
-				unsigned & errorCode)
-{
-	if (h323debug) {
-		cout << "	MyH323_ExternalRTPChannel::OnReceivedPDU " << endl;
-	}
-	return H323_ExternalRTPChannel::OnReceivedPDU( param, errorCode );
-}
-
-BOOL MyH323_ExternalRTPChannel::OnReceivedAckPDU(
-				const H245_H2250LogicalChannelAckParameters & param)
-{
-
-	PIPSocket::Address remoteIpAddress;		// IP Address of remote endpoint
-	WORD			   remotePort;			// remote endpoint Data port (control is dataPort+1)
-
-	if (h323debug) {
-		cout << "	MyH323_ExternalRTPChannel::OnReceivedAckPDU " << endl;
-	}
-
-	if (H323_ExternalRTPChannel::OnReceivedAckPDU( param )) {
-		GetRemoteAddress(remoteIpAddress, remotePort);
-		if (h323debug) {
-			cout << "		-- remoteIpAddress: " << remoteIpAddress << endl;
-			cout << "		-- remotePort: " << remotePort << endl;
-		}
-		/* Notify Asterisk of remote RTP information */
-		on_start_logical_channel(connection.GetCallReference(), (const char *)remoteIpAddress.AsString(), remotePort);
-		return TRUE;
-	}
-	return FALSE;
-}
-
 
 /** IMPLEMENTATION OF C FUNCTIONS */
 
@@ -943,7 +886,10 @@
    
 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;
@@ -954,26 +900,18 @@
 	endPoint->AddAliasName(h323id);	
 	endPoint->RemoveAliasName(localProcess->GetUserName());
 
-	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 (!e164.IsEmpty()) {
+		cout << "  == Adding E.164 \"" << e164 << "\" to endpoint" << endl;
+		endPoint->AddAliasName(e164);
 	}
-
-	if(alias->prefix) {
-		struct e164_number *num = alias->prefix;
+	if (strlen(alias->prefix)) {
+		p = alias->prefix;
+		num = strsep(&p, ",");
 		while(num) {
-			if(strlen(num->number)) {
-				cout << "  == Adding Prefix \"" << num->number << "\" to endpoint" << endl;
-				endPoint->SupportedPrefixes += PString(num->number);
-				endPoint->SetGateway();
-			}
-			num = num->next;
+	        cout << "  == Adding Prefix \"" << num << "\" to endpoint" << endl;
+			endPoint->SupportedPrefixes += PString(num);
+			endPoint->SetGateway();
+	        num = strsep(&p, ",");		
 		}
 	}
 
@@ -1158,4 +1096,6 @@
 }
 
 } /* extern "C" */
+
+
 

Index: ast_h323.h
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.h,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -d -r1.18 -r1.19
--- ast_h323.h	20 Mar 2004 14:14:00 -0000	1.18
+++ ast_h323.h	20 Mar 2004 14:24:20 -0000	1.19
@@ -253,26 +253,6 @@
 	BOOL			   bridging;			// Used to help determine which IP to use
 };
 
-class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel {
-
-	PCLASSINFO(MyH323_ExternalRTPChannel, H323_ExternalRTPChannel);
-
-	public:
-
-    MyH323_ExternalRTPChannel(MyH323Connection &, const H323Capability &, Directions,
-    						unsigned, const PIPSocket::Address &, WORD);
-
-	~MyH323_ExternalRTPChannel();
-
-    BOOL OnReceivedPDU(
-      const H245_H2250LogicalChannelParameters & param, /// Acknowledgement PDU
-      unsigned & errorCode                              /// Error on failure
-    );
-
-    BOOL OnReceivedAckPDU(const H245_H2250LogicalChannelAckParameters & param);
-
-};
-
 /**
  * The MyProcess is a necessary descendant PProcess class so that the H323EndPoint 
  * objected to be created from within that class. (Who owns main() problem). 
@@ -288,4 +268,5 @@
 	
 	
 };
+
 




More information about the svn-commits mailing list