OPAL  Version 3.14.3
causecode.h
Go to the documentation of this file.
1 /*
2  *
3  * Inter Asterisk Exchange 2
4  *
5  * Open Phone Abstraction Library (OPAL)
6  *
7  * List of the defines which enumerate the reason why calls end.
8  *
9  * Copyright (c) 2005 Indranet Technologies Ltd.
10  *
11  * The contents of this file are subject to the Mozilla Public License
12  * Version 1.0 (the "License"); you may not use this file except in
13  * compliance with the License. You may obtain a copy of the License at
14  * http://www.mozilla.org/MPL/
15  *
16  * Software distributed under the License is distributed on an "AS IS"
17  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
18  * the License for the specific language governing rights and limitations
19  * under the License.
20  *
21  * The Original Code is Open Phone Abstraction Library.
22  *
23  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
24  *
25  * The author of this code is Derek J Smithies
26  *
27  * $Revision: 29536 $
28  * $Author: rjongbloed $
29  * $Date: 2013-04-19 18:55:15 +1000 (Fri, 19 Apr 2013) $
30  */
31 
32 #ifndef OPAL_IAX2_CAUSECODE_H
33 #define OPAL_IAX2_CAUSECODE_H
34 
35 #include <opal_config.h>
36 
37 #if OPAL_IAX2
38 
39 #include <iax2/ies.h>
40 
42 
44 {
45  PCLASSINFO(IAX2IeCauseCode, IAX2IeByte);
46  public:
48  enum CauseCodes {
55  UserBusy = 17,
57  NoAnswer = 19,
58  CallRejected = 21,
71  PreEmpted = 45,
85  WrongMessage = 98,
86  IeNonexist = 99,
91  ProtocolError = 111,
92  Interworking = 127,
94  /* Special Asterisk aliases */
102  };
103 
107  IAX2IeCauseCode(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
108 
110  IAX2IeCauseCode(BYTE newValue) : IAX2IeByte(newValue) { }
111 
113  virtual BYTE GetKeyValue() const { return ie_causeCode; }
114 
116  void PrintOn(ostream & str) const;
117 
120  virtual void StoreDataIn(IAX2IeData &res) { res.causeCode = dataValue; }
121 
122 };
123 
124 #endif // OPAL_IAX2
125 
126 #endif // OPAL_IAX2_CAUSECODE_H
127 
128 /* The comment below is magic for those who use emacs to edit this file.
129  * With the comment below, the tab key does auto indent to 2 spaces.
130  *
131  * Local Variables:
132  * mode:c
133  * c-basic-offset:2
134  * End:
135  */