Source

h323ac / ep.h

/***************************************************************************
    ep.h

    Copyright (c) 2002-2003  Vladimir Toncar

    The contents of this file are subject to the Mozilla Public License
    Version 1.1 (the "License"); you may not use this file except in
    compliance with the License. You may obtain a copy of the License at
    http://www.mozilla.org/MPL/

    Software distributed under the License is distributed on an "AS IS"
    basis, WITHOUT WARRANTY OF ANY KIND, either express or implied.
    See the License for the specific language governing rights and
    limitations under the License.

    The Original Code is oh323tut.

    The Initial Developer of the Original Code is Vladimir Toncar.
    All Rights Reserved.

    Contributor: Peter Nixon <codemonkey@peternixon.net>

 ***************************************************************************/

#ifndef _EP_H
#define _EP_H

#include <h323.h>
#include "pconf.h"

class MyEndPoint: public H323EndPoint 
{
	PCLASSINFO(MyEndPoint, H323EndPoint)
	const ProgConf & progConf;  
public:
	MyEndPoint(const ProgConf & conf, PSyncPoint &_exitFlag);
	~MyEndPoint();

	bool Init(void); 
	
	virtual void OnConnectionEstablished(H323Connection &connection, 
					const PString &token);
	virtual void OnConnectionCleared(H323Connection &connection,
					const PString &token);
	virtual BOOL OpenAudioChannel(H323Connection &connection,
					BOOL isEncoding, unsigned bufferSize,
					H323AudioCodec &codec);
	virtual H323Connection::AnswerCallResponse OnAnswerCall(
					H323Connection &connection,
					const PString &caller,
					const H323SignalPDU & signalPDU,
					H323SignalPDU &);
	virtual BOOL OnStartLogicalChannel(H323Connection & connection,
					H323Channel & channel); 

	void CloseProgramNow() { exitFlag.Signal(); }

	PString currentCallToken;
protected:
	PSyncPoint &exitFlag;
};


#endif