[Asterisk-cvs] asterisk/channels/h323 ast_h323.cpp,1.36,1.37 ast_h323.h,1.17,1.18 h323.conf.sample,1.9,1.10

jeremy at lists.digium.com jeremy at lists.digium.com
Sat Mar 20 09:18:26 CST 2004


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

Modified Files:
	ast_h323.cpp ast_h323.h h323.conf.sample 
Log Message:
try to work around CCM interop, UNTESTED! Someone with a CCM needs to test this


Index: ast_h323.cpp
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.cpp,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- ast_h323.cpp	18 Mar 2004 20:39:15 -0000	1.36
+++ ast_h323.cpp	20 Mar 2004 14:14:00 -0000	1.37
@@ -687,7 +687,7 @@
 		cout << "		-- SessionID: " << sessionID << endl;
 		cout << "		-- Direction: " << dir << endl;
 	}
-	return new H323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort);
+	return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort);
 }
 
 /** This callback function is invoked once upon creation of each
@@ -720,6 +720,63 @@
 	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 */
 
@@ -1101,6 +1158,4 @@
 }
 
 } /* extern "C" */
-
-
 

Index: ast_h323.h
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.h,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- ast_h323.h	13 Jan 2004 03:06:06 -0000	1.17
+++ ast_h323.h	20 Mar 2004 14:14:00 -0000	1.18
@@ -253,6 +253,26 @@
 	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). 
@@ -268,5 +288,4 @@
 	
 	
 };
-
 

Index: h323.conf.sample
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/h323.conf.sample,v
retrieving revision 1.9
retrieving revision 1.10
diff -u -d -r1.9 -r1.10
--- h323.conf.sample	18 Mar 2004 20:39:15 -0000	1.9
+++ h323.conf.sample	20 Mar 2004 14:14:00 -0000	1.10
@@ -49,17 +49,14 @@
 ; 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. 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.
+; use user authentication at all.
 ;
 ;context=default
 ;
 ; H.323 Alias definitions
 ;
 ; Type 'h323' will register aliases to the endpoint
-; and Gatekeeper, if there is one. It will also offer
-; itself as a gateway for prefixes.
+; and Gatekeeper, if there is one.
 ;
 ; Example: if someone calls time at your.asterisk.box.com
 ; Asterisk will send the call to the extension 'time' 
@@ -72,11 +69,6 @@
 ; 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