regprocessor.h
Go to the documentation of this file.
/*
*
*
* Inter Asterisk Exchange 2
*
* A class to describe the node we are talking to.
*
* Open Phone Abstraction Library (OPAL)
*
* Copyright (c) 2005 Indranet Technologies Ltd.
*
* The contents of this file are subject to the Mozilla Public License
* Version 1.0 (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 Open Phone Abstraction Library.
*
* The Initial Developer of the Original Code is Indranet Technologies Ltd.
*
* The author of this code is Derek J Smithies
*
* $Revision: 24178 $
* $Author: rjongbloed $
* $Date: 2010-04-05 19:10:56 -0500 (Mon, 05 Apr 2010) $
*/
#ifndef OPAL_IAX2_REGPROCESSOR_H
#define OPAL_IAX2_REGPROCESSOR_H
#ifndef _PTLIB_H
#include <ptlib.h>
#endif
#include <opal/buildopts.h>
#if OPAL_IAX2
#include <ptclib/random.h>
#include <opal/connection.h>
#include <iax2/frame.h>
#include <iax2/processor.h>
#include <iax2/iedata.h>
#include <iax2/remote.h>
#include <iax2/safestrings.h>
#include <iax2/sound.h>
class IAX2EndPoint;
class IAX2Connection;
class IAX2RegProcessor : public IAX2Processor
{
PCLASSINFO(IAX2RegProcessor, IAX2Processor);
public:
IAX2RegProcessor( IAX2EndPoint & ep,
const PString & host,
const PString & username,
const PString & password,
PINDEX inRegistrationRefreshTime
);
virtual ~IAX2RegProcessor();
void Unregister();
PString GetHost() const { return host; };
PString GetUserName() const { return userName; };
PString GetPassword() const { return password; };
protected:
PString host;
PString userName;
PString password;
INT registrationRefreshTime;
enum RegistrationState {
registrationStart = 1,
registrationHappening,
registrationUnregisterStart,
registrationUnregistering,
registrationUnregistered,
registrationWait
};
RegistrationState registrationState;
PMutex stateMutex;
#ifdef DOC_PLUS_PLUS
void OnDoRegistration(PTimer &, INT);
#else
PDECLARE_NOTIFIER(PTimer, IAX2RegProcessor, OnDoRegistration);
#endif
PTimer registrationTimer;
void ProcessIaxCmdRegAuth(IAX2FullFrameProtocol * src);
void ProcessIaxCmdRegAck(IAX2FullFrameProtocol * src);
void ProcessIaxCmdRegRej(IAX2FullFrameProtocol * src);
void ProcessIaxCmdUnRegAuth(IAX2FullFrameProtocol * src);
void ProcessIaxCmdUnRegAck(IAX2FullFrameProtocol * src);
void ProcessIaxCmdUnRegRej(IAX2FullFrameProtocol * src);
void OnNoResponseTimeout();
void PrintOn(ostream & strm) const;
virtual void ProcessLists();
virtual void ProcessFullFrame(IAX2FullFrame & fullFrame);
virtual void ProcessNetworkFrame(IAX2MiniFrame * src);
virtual PBoolean ProcessNetworkFrame(IAX2FullFrameProtocol * src);
void ResetCall();
virtual PBoolean IncomingMessageOutOfOrder(IAX2FullFrame *)
{ return false; };
PRandom regRandom;
};
#endif // OPAL_IAX2
#endif // OPAL_IAX2_REGPROCESSOR_H
IAX2RegProcessor::ProcessIaxCmdUnRegAuth
void ProcessIaxCmdUnRegAuth(IAX2FullFrameProtocol *src)
IAX2RegProcessor::stateMutex
PMutex stateMutex
Definition: regprocessor.h:105
sound.h
IAX2RegProcessor::ProcessIaxCmdUnRegAck
void ProcessIaxCmdUnRegAck(IAX2FullFrameProtocol *src)
IAX2EndPoint
Definition: iax2ep.h:104
connection.h
buildopts.h
IAX2RegProcessor::password
PString password
Definition: regprocessor.h:85
IAX2Connection
Definition: iax2con.h:63
IAX2RegProcessor
Definition: regprocessor.h:57
IAX2RegProcessor::registrationRefreshTime
INT registrationRefreshTime
Definition: regprocessor.h:87
IAX2FullFrame
Definition: frame.h:369
IAX2MiniFrame
Definition: frame.h:307
IAX2RegProcessor::registrationHappening
Definition: regprocessor.h:92
IAX2RegProcessor::RegistrationState
RegistrationState
Definition: regprocessor.h:90
IAX2RegProcessor::ProcessIaxCmdRegAck
void ProcessIaxCmdRegAck(IAX2FullFrameProtocol *src)
IAX2RegProcessor::ProcessFullFrame
virtual void ProcessFullFrame(IAX2FullFrame &fullFrame)
IAX2RegProcessor::ResetCall
void ResetCall()
IAX2RegProcessor::registrationTimer
PTimer registrationTimer
Definition: regprocessor.h:115
IAX2RegProcessor::regRandom
PRandom regRandom
Definition: regprocessor.h:172
IAX2RegProcessor::ProcessIaxCmdRegRej
void ProcessIaxCmdRegRej(IAX2FullFrameProtocol *src)
IAX2RegProcessor::IncomingMessageOutOfOrder
virtual PBoolean IncomingMessageOutOfOrder(IAX2FullFrame *)
Definition: regprocessor.h:171
IAX2RegProcessor::OnDoRegistration
void OnDoRegistration(PTimer &, INT)
IAX2RegProcessor::registrationWait
Definition: regprocessor.h:97
IAX2FullFrameProtocol
Definition: frame.h:885
frame.h
IAX2RegProcessor::registrationState
RegistrationState registrationState
Definition: regprocessor.h:101
IAX2RegProcessor::Unregister
void Unregister()
iedata.h
IAX2RegProcessor::registrationUnregistering
Definition: regprocessor.h:94
processor.h
IAX2Processor
Definition: processor.h:136
IAX2RegProcessor::ProcessIaxCmdUnRegRej
void ProcessIaxCmdUnRegRej(IAX2FullFrameProtocol *src)
IAX2RegProcessor::registrationUnregistered
Definition: regprocessor.h:95
IAX2RegProcessor::registrationStart
Definition: regprocessor.h:91
IAX2RegProcessor::PrintOn
void PrintOn(ostream &strm) const
IAX2RegProcessor::GetUserName
PString GetUserName() const
Definition: regprocessor.h:79
IAX2RegProcessor::IAX2RegProcessor
IAX2RegProcessor(IAX2EndPoint &ep, const PString &host, const PString &username, const PString &password, PINDEX inRegistrationRefreshTime)
IAX2RegProcessor::userName
PString userName
Definition: regprocessor.h:84
IAX2RegProcessor::registrationUnregisterStart
Definition: regprocessor.h:93
remote.h
IAX2RegProcessor::ProcessNetworkFrame
virtual void ProcessNetworkFrame(IAX2MiniFrame *src)
safestrings.h
IAX2RegProcessor::~IAX2RegProcessor
virtual ~IAX2RegProcessor()
IAX2RegProcessor::ProcessIaxCmdRegAuth
void ProcessIaxCmdRegAuth(IAX2FullFrameProtocol *src)
IAX2RegProcessor::OnNoResponseTimeout
void OnNoResponseTimeout()
IAX2RegProcessor::GetPassword
PString GetPassword() const
Definition: regprocessor.h:80
IAX2RegProcessor::GetHost
PString GetHost() const
Definition: regprocessor.h:78
IAX2RegProcessor::host
PString host
Definition: regprocessor.h:80
IAX2RegProcessor::ProcessLists
virtual void ProcessLists()