OPAL  Version 3.18.8
regprocessor.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Inter Asterisk Exchange 2
5  *
6  * A class to describe the node we are talking to.
7  *
8  * Open Phone Abstraction Library (OPAL)
9  *
10  * Copyright (c) 2005 Indranet Technologies Ltd.
11  *
12  * The contents of this file are subject to the Mozilla Public License
13  * Version 1.0 (the "License"); you may not use this file except in
14  * compliance with the License. You may obtain a copy of the License at
15  * http://www.mozilla.org/MPL/
16  *
17  * Software distributed under the License is distributed on an "AS IS"
18  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
19  * the License for the specific language governing rights and limitations
20  * under the License.
21  *
22  * The Original Code is Open Phone Abstraction Library.
23  *
24  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
25  *
26  * The author of this code is Derek J Smithies
27  */
28 
29 #ifndef OPAL_IAX2_REGPROCESSOR_H
30 #define OPAL_IAX2_REGPROCESSOR_H
31 
32 #ifndef _PTLIB_H
33 #include <ptlib.h>
34 #endif
35 
36 #include <opal_config.h>
37 
38 #if OPAL_IAX2
39 
40 #include <ptclib/random.h>
41 #include <opal/connection.h>
42 
43 #include <iax2/frame.h>
44 #include <iax2/processor.h>
45 #include <iax2/iedata.h>
46 #include <iax2/remote.h>
47 #include <iax2/safestrings.h>
48 #include <iax2/sound.h>
49 
50 class IAX2EndPoint;
51 class IAX2Connection;
52 
54 {
55  PCLASSINFO(IAX2RegProcessor, IAX2Processor);
56 
57  public:
60  const PString & host,
61  const PString & username,
62  const PString & password,
63  PINDEX inRegistrationRefreshTime
64  );
65 
67  virtual ~IAX2RegProcessor();
68 
72  void Unregister();
73 
74  PString GetHost() const { return host; };
75  PString GetUserName() const { return userName; };
76  PString GetPassword() const { return password; };
77 
78  protected:
79  PString host;
80  PString userName;
81  PString password;
82 
84 
94  };
95 
98 
101  PDECLARE_MUTEX(stateMutex);
102 
103 #ifdef DOC_PLUS_PLUS
104 
105  void OnDoRegistration(PTimer &, INT);
106 #else
107  PDECLARE_NOTIFIER(PTimer, IAX2RegProcessor, OnDoRegistration);
108 #endif
109 
112 
115 
118 
121 
125 
128 
131 
134  void OnNoResponseTimeout();
135 
138  void PrintOn(ostream & strm) const;
139 
141  virtual void ProcessLists();
142 
145  virtual void ProcessFullFrame(IAX2FullFrame & fullFrame);
146 
148  virtual void ProcessNetworkFrame(IAX2MiniFrame * src);
149 
152  virtual PBoolean ProcessNetworkFrame(IAX2FullFrameProtocol * src);
153 
159  void ResetCall();
160 
168  { return false; };
169 
170 
173  PRandom regRandom;
174 };
175 
176 
177 #endif // OPAL_IAX2
178 
179 #endif // OPAL_IAX2_REGPROCESSOR_H
void ProcessIaxCmdUnRegAuth(IAX2FullFrameProtocol *src)
void ProcessIaxCmdUnRegAck(IAX2FullFrameProtocol *src)
Definition: iax2ep.h:100
PString password
Definition: regprocessor.h:81
Definition: iax2con.h:59
Definition: regprocessor.h:53
Definition: frame.h:365
Definition: frame.h:303
Definition: regprocessor.h:88
RegistrationState
Definition: regprocessor.h:86
void ProcessIaxCmdRegAck(IAX2FullFrameProtocol *src)
virtual void ProcessFullFrame(IAX2FullFrame &fullFrame)
PTimer registrationTimer
Definition: regprocessor.h:111
PRandom regRandom
Definition: regprocessor.h:168
void ProcessIaxCmdRegRej(IAX2FullFrameProtocol *src)
virtual PBoolean IncomingMessageOutOfOrder(IAX2FullFrame *)
Definition: regprocessor.h:167
void OnDoRegistration(PTimer &, INT)
Definition: regprocessor.h:93
Definition: frame.h:872
RegistrationState registrationState
Definition: regprocessor.h:97
Definition: regprocessor.h:90
Definition: processor.h:132
unsigned registrationRefreshTime
Definition: regprocessor.h:83
void ProcessIaxCmdUnRegRej(IAX2FullFrameProtocol *src)
Definition: regprocessor.h:91
Definition: regprocessor.h:87
void PrintOn(ostream &strm) const
PString GetUserName() const
Definition: regprocessor.h:75
IAX2RegProcessor(IAX2EndPoint &ep, const PString &host, const PString &username, const PString &password, PINDEX inRegistrationRefreshTime)
PString userName
Definition: regprocessor.h:80
PDECLARE_MUTEX(stateMutex)
virtual void ProcessNetworkFrame(IAX2MiniFrame *src)
virtual ~IAX2RegProcessor()
void ProcessIaxCmdRegAuth(IAX2FullFrameProtocol *src)
void OnNoResponseTimeout()
PString GetPassword() const
Definition: regprocessor.h:76
PString GetHost() const
Definition: regprocessor.h:74
PString host
Definition: regprocessor.h:76
virtual void ProcessLists()