/** This function tells the h.323 stack to either 
    answer or deny an incoming call  */
int h323_answering_call(const char *token, int busy) 
{
	const PString currentToken(token);
	H323Connection * connection;
	
	connection = endPoint->FindConnectionWithLock(currentToken);
	
	if (!connection) {
		cout << "No connection found for " << token << endl;
		return -1;
	}
	if (!busy) {
		if (h323debug) {
			cout << "\tAnswering call " << token << endl;
		}
		connection->AnsweringCall(H323Connection::AnswerCallNow);
	} else {
		if (h323debug) {
			cout << "\tdenying call " << token << endl;
		}
		connection->AnsweringCall(H323Connection::AnswerCallDenied);
	}
	connection->Unlock();
	return 0;
}
예제 #2
0
void InputTonePlugin::sendTone( char tone )
{
	if( !endPoint ) return;
	
	H323Connection *c = endPoint->FindConnectionWithLock( currentCallToken.latin1() );
	if( !c ) return;

	c->SendUserInputTone(tone);
	c->Unlock();
}
void MyH323EndPoint::SendUserTone(const PString &token, char tone)
{
	H323Connection *connection = NULL;
		
	connection = FindConnectionWithLock(token);
	if (connection != NULL) {
		connection->SendUserInputTone(tone, 500);
		connection->Unlock();
	}
}
/* Send Progress PDU to H.323 caller */
int h323_send_progress(const char *token)
{
        const PString currentToken(token);
        H323Connection * connection;

        connection = endPoint->FindConnectionWithLock(currentToken);
        if (!connection) {
                cout << "No connection found for " << token << endl;
                return -1;
        }
        connection->AnsweringCall(H323Connection::AnswerCallDeferredWithMedia);
        connection->Unlock();
        return 0;  
}
/* Send Alerting PDU to H.323 caller */
int h323_send_alerting(const char *token)
{
        const PString currentToken(token);
        H323Connection * connection;

        if (h323debug) {
        	cout << "\tSending alerting\n" << endl;
        }
        connection = endPoint->FindConnectionWithLock(currentToken);
        if (!connection) {
                cout << "No connection found for " << token << endl;
                return -1;
        }
        connection->AnsweringCall(H323Connection::AnswerCallPending);
        connection->Unlock();
        return 0; 

}