# 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  * $Revision: 24606 $
    00028  * $Author: dereksmithies $
    00029  * $Date: 2010-07-28 22:51:05 -0500 (Wed, 28 Jul 2010) $
    00030  */
    00031
    00032 #ifndef OPAL_IAX2_CAUSECODE_H
    00033 #define OPAL_IAX2_CAUSECODE_H
    00034
    00035 #include <opal/buildopts.h>
    00036
    00037 #if OPAL_IAX2
    00038
    00039 #include <iax2/ies.h>
    00040
    00042
    00043 class IAX2IeCauseCode : public IAX2IeByte
    00044 {
    00045   PCLASSINFO(IAX2IeCauseCode, IAX2IeByte);
    00046  public:
    00048   enum CauseCodes {
    00049     Unallocated                      =   1,
    00050     NoRouteTransitNet                =   2,
    00051     NoRouteDestination               =   3,
    00052     ChannelUnacceptable              =   6,
    00053     CallAwardedDelivered             =   7,
    00054     NormalClearing                   =  16,
    00055     UserBusy                         =  17,
    00056     NoUserResponse                   =  18,
    00057     NoAnswer                         =  19,
    00058     CallRejected                     =  21,
    00059     NumberChanged                    =  22,
    00060     DestinationOutOfOrder            =  27,
    00061     InvalidNumberFormat              =  28,
    00062     FacilityRejected                 =  29,
    00063     ResponseToStatusEnquiry          =  30,
    00064     NormalUnspecified                =  31,
    00065     NormalCircuitCongestion          =  34,
    00066     NetworkOutOfOrder                =  38,
    00067     NormalTemporaryFailure           =  41,
    00068     SwitchCongestion                 =  42,
    00069     AccessInfoDiscarded              =  43,
    00070     RequestedChanUnavail             =  44,
    00071     PreEmpted                        =  45,
    00072     FacilityNotSubscribed            =  50,
    00073     OutgoingCallBarred               =  52,
    00074     IncomingCallBarred               =  54,
    00075     BearerCapabilityNotauth          =  57,
    00076     BearerCapabilityNotAvail         =  58,
    00077     BearerCapabilityNotimpl          =  65,
    00078     ChanNotImplemented               =  66,
    00079     FacilityNotImplemented           =  69,
    00080     InvalidCallReference             =  81,
    00081     IncompatibleDestination          =  88,
    00082     InvalidMsgUnspecified            =  95,
    00083     MandatoryIeMissing               =  96,
    00084     MessageTypeNonexist              =  97,
    00085     WrongMessage                     =  98,
    00086     IeNonexist                       =  99,
    00087     InvalidIeContents                = 100,
    00088     WrpngCallState                   = 101,
    00089     RecoveryOnTimerExpire            = 102,
    00090     MandatoryIeLengthError           = 103,
    00091     ProtocolError                    = 111,
    00092     Interworking                     = 127,
    00094     /* Special Asterisk aliases */
    00095     Busy                              =  UserBusy,
    00096     Failure                           =  NetworkOutOfOrder,
    00097     Normal                            =  NormalClearing,
    00098     Congestion                        =  NormalCircuitCongestion,
    00099     Unregistered                      =  NoRouteDestination,
    00100     NotDefined                        =  0,
    00101     NoSuchDriver                      =  ChanNotImplemented,
    00102   };
    00103
    00107   IAX2IeCauseCode(BYTE length, BYTE *srcData) : IAX2IeByte(length, srcData) { };
    00108
    00110   IAX2IeCauseCode(BYTE newValue) : IAX2IeByte(newValue) { }
    00111
    00113   virtual BYTE GetKeyValue() const { return ie_causeCode; }
    00114
    00116   void PrintOn(ostream & str) const;
    00117
    00120   virtual void StoreDataIn(IAX2IeData &res) { res.causeCode = dataValue; }
    00121
    00122 };
    00123
    00124 #endif // OPAL_IAX2
    00125
    00126 #endif // OPAL_IAX2_CAUSECODE_H
    00127
    00128 /* The comment below is magic for those who use emacs to edit this file.
    00129  * With the comment below, the tab key does auto indent to 2 spaces.
    00130  *
    00131  * Local Variables:
    00132  * mode:c
    00133  * c-basic-offset:2
    00134  * End:
    00135  */