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/ast_h323.cpp | |
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/ast_h323.cpp')
-rwxr-xr-x | channels/h323/ast_h323.cpp | 17 |
1 files changed, 11 insertions, 6 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; |