[Asterisk-cvs] asterisk/channels/h323 ast_h323.cpp, 1.57, 1.58 ast_h323.h, 1.24, 1.25 chan_h323.h, 1.25, 1.26

jeremy at lists.digium.com jeremy at lists.digium.com
Sun Sep 19 12:49:09 CDT 2004


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

Modified Files:
	ast_h323.cpp ast_h323.h chan_h323.h 
Log Message:
protect against seg on busy systems. Bug #2249

Index: ast_h323.cpp
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.cpp,v
retrieving revision 1.57
retrieving revision 1.58
diff -u -d -r1.57 -r1.58
--- ast_h323.cpp	22 Jul 2004 04:24:50 -0000	1.57
+++ ast_h323.cpp	19 Sep 2004 16:53:01 -0000	1.58
@@ -359,7 +359,7 @@
 	if (h323debug) {
 		cout << "	-- Connection Established with \"" << connection.GetRemotePartyName() << "\"" << endl;
 	}
-	on_connection_established(connection.GetCallReference());
+	on_connection_established(connection.GetCallReference(), (const char *)connection.GetCallToken());
 }
 
 /** OnConnectionCleared callback function is called upon the dropping of an established
@@ -493,6 +493,7 @@
 	if (h323debug) {
 		cout << "	== New H.323 Connection created." << endl;
 	}
+
 	return;
 }
 
@@ -508,7 +509,9 @@
 																   const H323SignalPDU & /*setupPDU*/,
 																   H323SignalPDU & /*connectPDU*/)
 {
-	if (!on_answer_call(GetCallReference()))
+
+	
+	if (!on_answer_call(GetCallReference(), (const char *)GetCallToken()))
 		return H323Connection::AnswerCallDenied;
 
 	/* The call will be answered later with "AnsweringCall()" function.
@@ -522,7 +525,7 @@
 	if (h323debug) {
 		cout << "	-- Ringing phone for \"" << username << "\"" << endl;
 	}
-	on_chan_ringing(GetCallReference());
+	on_chan_ringing(GetCallReference(), (const char *)GetCallToken());
 	return TRUE;
 }
 
@@ -712,7 +715,7 @@
 	WORD port;
 
 	/* Determine the Local (A side) IP Address and port */
-	info = on_create_connection(GetCallReference()); 
+	info = on_create_connection(GetCallReference(), (const char *)GetCallToken()); 
 
 	if (!info) {
 		return NULL;
@@ -720,7 +723,7 @@
 
 	GetControlChannel().GetLocalAddress().GetIpAndPort(externalIpAddress, port);
 	externalPort = info->port;
-	
+
 	if (h323debug) {
 		cout << "	=*= In CreateRealTimeLogicalChannel for call " << GetCallReference() << endl;
 		cout << "		-- externalIpAddress: " << externalIpAddress << endl;
@@ -728,6 +731,7 @@
 		cout << "		-- SessionID: " << sessionID << endl;
 		cout << "		-- Direction: " << dir << endl;
 	}
+
 	return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort);
 }
 
@@ -793,7 +797,8 @@
         if (H323_ExternalRTPChannel::OnReceivedAckPDU(param)) {
                H323_ExternalRTPChannel::GetRemoteAddress(remoteIpAddress, remotePort);
                /* Notify Asterisk of remote RTP information */
-               on_start_logical_channel(connection.GetCallReference(), (const char *)remoteIpAddress.AsString(), remotePort);
+               on_start_logical_channel(connection.GetCallReference(), (const char *)remoteIpAddress.AsString(), remotePort, 
+                                         (const char *)connection.GetCallToken() );
                 return TRUE;
         }
         return FALSE;

Index: ast_h323.h
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/ast_h323.h,v
retrieving revision 1.24
retrieving revision 1.25
diff -u -d -r1.24 -r1.25
--- ast_h323.h	26 Jun 2004 03:50:14 -0000	1.24
+++ ast_h323.h	19 Sep 2004 16:53:01 -0000	1.25
@@ -241,6 +241,7 @@
 	WORD externalPort;
 	WORD sessionId;
 	BOOL bridging;			
+        
 };
 
 class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel {

Index: chan_h323.h
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/h323/chan_h323.h,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- chan_h323.h	22 Jul 2004 04:24:50 -0000	1.25
+++ chan_h323.h	19 Sep 2004 16:53:01 -0000	1.26
@@ -119,7 +119,7 @@
 
 /* This is a callback prototype function, called to collect
    the external RTP port from Asterisk. */
-typedef rtp_info_t *(*on_connection_cb)(unsigned);
+typedef rtp_info_t *(*on_connection_cb)(unsigned, const char *);
 extern on_connection_cb	on_create_connection; 
 
 /* This is a callback prototype function, called upon
@@ -134,17 +134,17 @@
 
 /* This is a callback prototype function, called when the openh323 
    OnStartLogicalChannel is invoked. */
-typedef void (*start_logchan_cb)(unsigned int, const char *, int);
+typedef void (*start_logchan_cb)(unsigned int, const char *, int, const char *);
 extern start_logchan_cb	on_start_logical_channel; 
 
 /* This is a callback prototype function, called when openh323
    OnAlerting is invoked */
-typedef void (*chan_ringing_cb)(unsigned);
+typedef void (*chan_ringing_cb)(unsigned, const char *);
 extern chan_ringing_cb		on_chan_ringing;
 
 /* This is a callback protoype function, called when the openh323
    OnConnectionEstablished is inovked */
-typedef void (*con_established_cb)(unsigned);
+typedef void (*con_established_cb)(unsigned, const char *);
 extern con_established_cb		on_connection_established;
 
 /* This is a callback prototype function, called when the openH323
@@ -152,7 +152,7 @@
 typedef void (*clear_con_cb)(call_details_t);
 extern clear_con_cb		on_connection_cleared;
 
-typedef int (*answer_call_cb)(unsigned);
+typedef int (*answer_call_cb)(unsigned, const char *);
 extern answer_call_cb		on_answer_call;
 
 /* debug flag */




More information about the svn-commits mailing list