diff options
author | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-19 16:53:01 +0000 |
---|---|---|
committer | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-09-19 16:53:01 +0000 |
commit | efbfbe86bfb2dad3b3f71e2aa37da4b299b9e484 (patch) | |
tree | 1191a9bad4167a2b67e2c02a4054e90421a07fab /channels/h323 | |
parent | 701d17cfbf6ab8d1c31a4b8e392c255e571b9b67 (diff) |
protect against seg on busy systems. Bug #2249
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@3809 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/h323')
-rwxr-xr-x | channels/h323/ast_h323.cpp | 17 | ||||
-rwxr-xr-x | channels/h323/ast_h323.h | 1 | ||||
-rwxr-xr-x | channels/h323/chan_h323.h | 10 |
3 files changed, 17 insertions, 11 deletions
diff --git a/channels/h323/ast_h323.cpp b/channels/h323/ast_h323.cpp index ad52cbb76..480da4e73 100755 --- a/channels/h323/ast_h323.cpp +++ b/channels/h323/ast_h323.cpp @@ -359,7 +359,7 @@ void MyH323EndPoint::OnConnectionEstablished(H323Connection & connection, const 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 @@ MyH323Connection::MyH323Connection(MyH323EndPoint & ep, unsigned callReference, if (h323debug) { cout << " == New H.323 Connection created." << endl; } + return; } @@ -508,7 +509,9 @@ H323Connection::AnswerCallResponse MyH323Connection::OnAnswerCall(const PString 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 @@ BOOL MyH323Connection::OnAlerting(const H323SignalPDU & /*alertingPDU*/, const 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 @@ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capabilit 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 @@ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capabilit 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 @@ H323Channel * MyH323Connection::CreateRealTimeLogicalChannel(const H323Capabilit cout << " -- SessionID: " << sessionID << endl; cout << " -- Direction: " << dir << endl; } + return new MyH323_ExternalRTPChannel(*this, capability, dir, sessionID, externalIpAddress, externalPort); } @@ -793,7 +797,8 @@ BOOL MyH323_ExternalRTPChannel::OnReceivedAckPDU(const H245_H2250LogicalChannelA 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; diff --git a/channels/h323/ast_h323.h b/channels/h323/ast_h323.h index 5d50b58fb..a0c710194 100755 --- a/channels/h323/ast_h323.h +++ b/channels/h323/ast_h323.h @@ -241,6 +241,7 @@ class MyH323Connection : public H323Connection { WORD externalPort; WORD sessionId; BOOL bridging; + }; class MyH323_ExternalRTPChannel : public H323_ExternalRTPChannel { diff --git a/channels/h323/chan_h323.h b/channels/h323/chan_h323.h index 3e0e848f6..691fec635 100755 --- a/channels/h323/chan_h323.h +++ b/channels/h323/chan_h323.h @@ -119,7 +119,7 @@ extern send_digit_cb on_send_digit; /* 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 @@ extern setup_outbound_cb on_outgoing_call; /* 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 @@ extern con_established_cb on_connection_established; 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 */ |