causecode.h

Go to the documentation of this file.
00001 /*
00002  *
00003  * Inter Asterisk Exchange 2
00004  * 
00005  * Open Phone Abstraction Library (OPAL)
00006  *
00007  * List of the defines which enumerate the reason why calls end.
00008  *
00009  * Copyright (c) 2005 Indranet Technologies Ltd.
00010  *
00011  * The contents of this file are subject to the Mozilla Public License
00012  * Version 1.0 (the "License"); you may not use this file except in
00013  * compliance with the License. You may obtain a copy of the License at
00014  * http://www.mozilla.org/MPL/
00015  *
00016  * Software distributed under the License is distributed on an "AS IS"
00017  * basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
00018  * the License for the specific language governing rights and limitations
00019  * under the License.
00020  *
00021  * The Original Code is Open Phone Abstraction Library.
00022  *
00023  * The Initial Developer of the Original Code is Indranet Technologies Ltd.
00024  *
00025  * The author of this code is Derek J Smithies
00026  *
00027  *  $Log: causecode.h,v $
00028  *  Revision 1.2  2005/08/26 03:07:35  dereksmithies
00029  *  Change naming convention, so all class names contain the string "IAX2"
00030  *
00031  *  Revision 1.1  2005/07/30 07:01:32  csoutheren
00032  *  Added implementation of IAX2 (Inter Asterisk Exchange 2) protocol
00033  *  Thanks to Derek Smithies of Indranet Technologies Ltd. for
00034  *  writing and contributing this code
00035  *
00036  *
00037  *
00038  *
00039  */
00040 #ifndef CAUSECODE_H
00041 #define CAUSECODE_H
00042 
00043 #include <opal/buildopts.h>
00044 
00045 #include <iax2/ies.h>
00046 
00048 
00049 class IAX2IeCauseCode : public IAX2IeByte
00050 {
00051   PCLASSINFO(IAX2IeCauseCode, IAX2IeByte);
00052  public:
00054   enum CauseCodes {
00055     Unallocated                      =   1,               
00056     NoRouteTransitNet                =   2,               
00057     NoRouteDestination               =   3,               
00058     ChannelUnacceptable              =   6,               
00059     CallAwardedDelivered             =   7,               
00060     NormalClearing                   =  16,               
00061     UserBusy                         =  17,               
00062     NoUserResponse                   =  18,               
00063     NoAnswer                         =  19,               
00064     CallRejected                     =  21,               
00065     NumberChanged                    =  22,               
00066     DestinationOutOfOrder            =  27,               
00067     InvalidNumberFormat              =  28,               
00068     FacilityRejected                 =  29,               
00069     ResponseToStatusEnquiry          =  30,               
00070     NormalUnspecified                =  31,               
00071     NormalCircuitCongestion          =  34,               
00072     NetworkOutOfOrder                =  38,               
00073     NormalTemporaryFailure           =  41,               
00074     SwitchCongestion                 =  42,               
00075     AccessInfoDiscarded              =  43,               
00076     RequestedChanUnavail             =  44,               
00077     PreEmpted                        =  45,               
00078     FacilityNotSubscribed            =  50,               
00079     OutgoingCallBarred               =  52,               
00080     IncomingCallBarred               =  54,               
00081     BearerCapabilityNotauth          =  57,               
00082     BearerCapabilityNotAvail         =  58,               
00083     BearerCapabilityNotimpl          =  65,               
00084     ChanNotImplemented               =  66,               
00085     FacilityNotImplemented           =  69,               
00086     InvalidCallReference             =  81,               
00087     IncompatibleDestination          =  88,               
00088     InvalidMsgUnspecified            =  95,               
00089     MandatoryIeMissing               =  96,               
00090     MessageTypeNonexist              =  97,               
00091     WrongMessage                     =  98,               
00092     IeNonexist                       =  99,               
00093     InvalidIeContents                = 100,               
00094     WrpngCallState                   = 101,               
00095     RecoveryOnTimerExpire            = 102,               
00096     MandatoryIeLengthError           = 103,               
00097     ProtocolError                    = 111,               
00098     Interworking                     = 127,               
00100     /* Special Asterisk aliases */
00101     Busy                              =  UserBusy,                         
00102     Failure                           =  NetworkOutOfOrder,                
00103     Normal                            =  NormalClearing,                   
00104     Congestion                        =  NormalCircuitCongestion,          
00105     Unregistered                      =  NoRouteDestination,               
00106     NotDefined                        =  0,                                
00107     NoSuchDriver                      =  ChanNotImplemented,               
00108   };
00109 
00113   IAX2IeCauseCode(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
00114      
00116   IAX2IeCauseCode(BYTE newValue) : IAX2IeByte(newValue) { }
00117 
00119   virtual BYTE GetKeyValue() const { return ie_causeCode; }
00120 
00122   void PrintOn(ostream & str) const;
00123 
00126   virtual void StoreDataIn(IAX2IeData &res) { res.causeCode = dataValue; }     
00127 
00128 };
00129 
00130 #endif //CAUSECODE_H
00131 
00132 /* The comment below is magic for those who use emacs to edit this file. */
00133 /* With the comment below, the tab key does auto indent to 4 spaces.     */
00134 
00135 /*
00136  * Local Variables:
00137  * mode:c
00138  * c-file-style:linux
00139  * c-basic-offset:2
00140  * End:
00141  */

Generated on Mon Sep 22 12:24:20 2008 for OPAL by  doxygen 1.5.1