OPAL  Version 3.14.3
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  * $Revision: 29536 $
29  * $Author: rjongbloed $
30  * $Date: 2013-04-19 18:55:15 +1000 (Fri, 19 Apr 2013) $
31  */
32 
33 #ifndef OPAL_IAX2_REGPROCESSOR_H
34 #define OPAL_IAX2_REGPROCESSOR_H
35 
36 #ifndef _PTLIB_H
37 #include <ptlib.h>
38 #endif
39 
40 #include <opal_config.h>
41 
42 #if OPAL_IAX2
43 
44 #include <ptclib/random.h>
45 #include <opal/connection.h>
46 
47 #include <iax2/frame.h>
48 #include <iax2/processor.h>
49 #include <iax2/iedata.h>
50 #include <iax2/remote.h>
51 #include <iax2/safestrings.h>
52 #include <iax2/sound.h>
53 
54 class IAX2EndPoint;
55 class IAX2Connection;
56 
58 {
59  PCLASSINFO(IAX2RegProcessor, IAX2Processor);
60 
61  public:
64  const PString & host,
65  const PString & username,
66  const PString & password,
67  PINDEX inRegistrationRefreshTime
68  );
69 
71  virtual ~IAX2RegProcessor();
72 
76  void Unregister();
77 
78  PString GetHost() const { return host; };
79  PString GetUserName() const { return userName; };
80  PString GetPassword() const { return password; };
81 
82  protected:
83  PString host;
84  PString userName;
85  PString password;
86 
88 
98  };
99 
102 
105  PMutex stateMutex;
106 
107 #ifdef DOC_PLUS_PLUS
108 
109  void OnDoRegistration(PTimer &, INT);
110 #else
111  PDECLARE_NOTIFIER(PTimer, IAX2RegProcessor, OnDoRegistration);
112 #endif
113 
116 
119 
122 
125 
129 
132 
135 
138  void OnNoResponseTimeout();
139 
142  void PrintOn(ostream & strm) const;
143 
145  virtual void ProcessLists();
146 
149  virtual void ProcessFullFrame(IAX2FullFrame & fullFrame);
150 
152  virtual void ProcessNetworkFrame(IAX2MiniFrame * src);
153 
156  virtual PBoolean ProcessNetworkFrame(IAX2FullFrameProtocol * src);
157 
163  void ResetCall();
164 
172  { return false; };
173 
174 
177  PRandom regRandom;
178 };
179 
180 
181 #endif // OPAL_IAX2
182 
183 #endif // OPAL_IAX2_REGPROCESSOR_H