diff options
author | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-13 03:07:15 +0000 |
---|---|---|
committer | jeremy <jeremy@f38db490-d61c-443f-a65b-d21fe96a405b> | 2004-01-13 03:07:15 +0000 |
commit | 8270caac975706bb0d9ed35365bf5cdec8d6eafc (patch) | |
tree | 653574342cc54642691b186821ad1fed9e1c9e9f /channels/h323 | |
parent | 50805a18f7706a53fd0ba83bca9d32f507500448 (diff) |
Fix it so we can be unloaded/loaded at will
git-svn-id: http://svn.digium.com/svn/asterisk/trunk@2003 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 | 3 |
2 files changed, 8 insertions, 12 deletions
diff --git a/channels/h323/ast_h323.cpp b/channels/h323/ast_h323.cpp index df6c26408..78774665c 100755 --- a/channels/h323/ast_h323.cpp +++ b/channels/h323/ast_h323.cpp @@ -25,8 +25,10 @@ * * Version Info: $Id$ */ +#include <asterisk/logger.h> #include "ast_h323.h" + /* PWlib Required Components */ #define MAJOR_VERSION 1 #define MINOR_VERSION 0 @@ -63,7 +65,7 @@ MyProcess::MyProcess(): PProcess("The NuFone Network's", "H.323 Channel Driver f void MyProcess::Main() { - cout << " == Creating H.323 Endpoint" << endl; + ast_verbose(" == Creating H.323 Endpoint\n"); endPoint = new MyH323EndPoint(); PTrace::Initialise(0, NULL, PTrace::Timestamp | PTrace::Thread | PTrace::FileAndLine); } @@ -492,7 +494,7 @@ BOOL MyH323Connection::OnReceivedSignalSetup(const H323SignalPDU & setupPDU) { if (h323debug) { - cout << " -- Received SETUP message..." << endl; + ast_verbose(" -- Received SETUP message\n"); } call_details_t cd; @@ -948,6 +950,7 @@ int h323_set_gk(int gatekeeper_discover, char *gatekeeper, char *secret) { PString gkName = PString(gatekeeper); PString pass = PString(secret); + H323TransportUDP *rasChannel; if (!h323_end_point_exist()) { cout << "ERROR: [h323_set_gk] No Endpoint, this is bad!" << endl; @@ -972,17 +975,13 @@ int h323_set_gk(int gatekeeper_discover, char *gatekeeper, char *secret) return 1; } } else { - /* Gatekeeper operations */ - if (endPoint->rasChannel) { - delete endPoint->rasChannel; - } - endPoint->rasChannel = new H323TransportUDP(*endPoint); + rasChannel = new H323TransportUDP(*endPoint); - if (!endPoint->rasChannel) { + if (!rasChannel) { cout << " *** No RAS Channel, this is bad" << endl; return 1; } - if (endPoint->SetGatekeeper(gkName, endPoint->rasChannel)) { + if (endPoint->SetGatekeeper(gkName, rasChannel)) { cout << " == Using " << (endPoint->GetGatekeeper())->GetName() << " as our Gatekeeper." << endl; } else { cout << " *** Error registering with gatekeeper \"" << gkName << "\". " << endl; diff --git a/channels/h323/ast_h323.h b/channels/h323/ast_h323.h index 71fd38924..e079d960e 100755 --- a/channels/h323/ast_h323.h +++ b/channels/h323/ast_h323.h @@ -215,9 +215,6 @@ class MyH323EndPoint : public H323EndPoint { void SetEndpointTypeInfo( H225_EndpointType & info ) const; void SetGateway(void); - - H323TransportUDP *rasChannel; - }; class MyH323Connection : public H323Connection { |