tweak the logic in MakeCall
authorJeremy McNamara <jj@nufone.net>
Mon, 12 May 2003 03:57:43 +0000 (03:57 +0000)
committerJeremy McNamara <jj@nufone.net>
Mon, 12 May 2003 03:57:43 +0000 (03:57 +0000)
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@1001 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/h323/ast_h323.cpp

index e4fe560..5146908 100755 (executable)
@@ -185,7 +185,8 @@ int MyH323EndPoint::MakeCall(const PString & dest, PString & token,
                                                                                unsigned int *callReference, unsigned int port)
 {
        PString fullAddress;
-       
+       MyH323Connection * connection;
+
        /* Determine whether we are using a gatekeeper or not. */
        if (GetGatekeeper() != NULL) {
                fullAddress = dest;
@@ -197,18 +198,14 @@ int MyH323EndPoint::MakeCall(const PString & dest, PString & token,
                                cout << " -- Making call to " << fullAddress << "." << endl;
                }
 
-       if (!H323EndPoint::MakeCall(fullAddress, token)) {
+       if (!(connection = (MyH323Connection *)H323EndPoint::MakeCallLocked(fullAddress, token))) {
                if (h323debug)
                        cout << "Error making call to \"" << fullAddress << '"' << endl;
                return 1;
        }
        
-       MyH323Connection * connection = (MyH323Connection *)FindConnectionWithLock(token);
-
-       if (connection != NULL) {
-               *callReference = connection->GetCallReference();
-               connection->Unlock();
-       }
+       *callReference = connection->GetCallReference();
+       connection->Unlock();
        
        if (h323debug) {
                cout << "       -- " << GetLocalUserName() << " is calling host " << fullAddress << endl;