1、The default code is NORMAL_CLEARING (if you do not specify one)The codes are documented in src/switch_channel.c and SIP Protocol MessagesIE stands for Information ElementQ.850 to SIP Code TableThe following table describes the mappings implemented by FreeSwitch (seemod_sofia.c:hangup_cause_to_sip).
2、Unspecified causes codes (no value in the “SIP Equiv.“ column in thetable) are translated to SIP “480 Temporarily Unavailable“ by FreeSwitch.The table also contains non-standard codes above 127 (ISUP and ISDN only specify codes up to 127). Thesecodes are used internally to FreeSwitch to indicate oth
3、er states. (These codes do not map directly to SIP errorcodes either.) The complete list of SWITCH_CAUSE_ codes (switch_call_cause_t) is defined ininclude/switch_types.h.See ITU-T Q.850 standard for a formal definition of standard telephony disconnect cause codes for ISDN, andthe mapping between Q.9
4、31 (DSSS1) and ISUP codes.See ITU Q.1912.5 for a formal definition of interoperability between ISUP and SIP, especially section 6.11which specifies the “Reason“ header and gives the mapping of the disconnect cause codes between ISUP andSIP.Another set of mappings are the Q.SIG / SIP mappings from RF
5、C 4497 section 8.4.1. (Q.SIG is one of manyextensions to Q.931 used for PBX-to-PBX signalling on private links.)In practice it appears that FreeSwitch implements neither Q.1912.5 nor RFC4497.ITU-TQ.850CodeSIPEquiv. Enumeration Cause Description0 UNSPECIFIEDUnspecified.No other causecodesapplicable.T
6、his is usually given by therouter when none of the othercodes apply. This causeusually occurs in the sametype of situations as cause 1,cause 88, and cause 100.1 404 UNALLOCATED_NUMBERUnallocated(unassigned)number Q.850value 1This cause indicates that thecalled party cannot bereached because, althoug
7、h thecalled party number is in avalid format, it is notcurrently allocated(assigned).2 404 NO_ROUTE_TRANSIT_NETHangup_CausesQ.850 to SIP Code Table 1No route tospecifiedtransit network(national use)Q.850This cause indicates that theequipment sending this causehas received a request toroute the call
8、through aparticular transit network,which it does not recognize.The equipment sending thiscause does not recognize thetransit network either becausethe transit network does notexist or because thatparticular transit network,while it does exist, does notserve the equipment which issending this cause.
9、3 404 NO_ROUTE_DESTINATIONNo route todestinationQ.850This cause indicates that thecalled party cannot bereached because the networkthrough which the call hasbeen routed does not servethe destination desired. Thiscause is supported on anetwork dependent basis.6 CHANNEL_UNACCEPTABLEchannelunacceptable
10、Q.850This cause indicates that thechannel most recentlyidentified is not acceptable tothe sending entity for use inthis call.7 CALL_AWARDED_DELIVEREDcall awarded,being deliveredin anestablishedchannelQ.850This cause indicates that theuser has been awarded theincoming call, and that theincoming call
11、is beingconnected to a channelalready established to thatuser for similar calls (e.g.packet-mode x.25 virtualcalls).16 NORMAL_CLEARINGnormal callclearingQ.850This cause indicates that thecall is being cleared becauseone of the users involved inthe call has requested that thecall be cleared. Under no
12、rmalsituations, the source of thiscause is not the network.17 486 USER_BUSY user busyQ.850This cause is used to indicatethat the called party is unableto accept another call becauseHangup_CausesQ.850 to SIP Code Table 2the user busy condition hasbeen encountered. This causevalue may be generated byt
13、he called user or by thenetwork. In the case of userdetermined user busy it isnoted that the user equipmentis compatible with the call.18 408 NO_USER_RESPONSEno userrespondingQ.850This cause is used when acalled party does not respondto a call establishmentmessage with either analerting or connect i
14、ndicationwithin the prescribed periodof time allocated.19 480 NO_ANSWERno answer fromuser (useralerted)Q.850This cause is used when thecalled party has been alertedbut does not respond with aconnect indication within aprescribed period of time.Note - This cause is notnecessarily generated byQ.931 pr
15、ocedures but may begenerated by internal networktimers.20 480 SUBSCRIBER_ABSENT subscriberabsent Q.850This cause value is usedwhen a mobile station haslogged off, radio contact isnot obtained with a mobilestation or if a personaltelecommunication user istemporarily not addressableat any user-network
16、 interface.Sofia SIP will normally raiseUSER_NOT_REGISTEREDin such situations.21 603 CALL_REJECTED call rejectedQ.850This cause indicates that theequipment sending this causedoes not wish to accept thiscall, although it could haveaccepted the call because theequipment sending this causeis neither bu
17、sy norincompatible. The networkmay also generate this cause,indicating that the call wascleared due to aHangup_CausesQ.850 to SIP Code Table 3supplementary serviceconstraint. The diagnosticfield may contain additionalinformation about thesupplementary service andreason for rejection.22 410 NUMBER_CH
18、ANGEDnumberchangedQ.850This cause is returned to acalling party when the calledparty number indicated by thecalling party is no longerassigned, The new calledparty number may optionallybe included in the diagnosticfield. If a network does notsupport this cause, cause no:1, unallocated (unassigned)nu
19、mber shall be used.23 410 REDIRECTION_TO_NEW_DESTINATIONThis cause is used by ageneral ISUP protocolmechanism that can beinvoked by an exchange thatdecides that the call should beset-up to a different callednumber. Such an exchangecan invoke a redirectionmechanism, by use of thiscause value, to requ
20、est apreceding exchange involvedin the call to route the call tothe new number.25 483 EXCHANGE_ROUTING_ERRORThis cause indicates that thedestination indicated by theuser cannot be reached,because an intermediateexchange has released the calldue to reaching a limit inexecuting the hop counterprocedur
21、e. This cause isgenerated by an intermediatenode, which whendecrementing the hop countervalue, gives the result 0.27 502 DESTINATION_OUT_OF_ORDER destination outof orderQ.850This cause indicates that thedestination indicated by theuser cannot be reachedbecause the interface to thedestination is not
22、functioningHangup_CausesQ.850 to SIP Code Table 4correctly. The term “notfunctioning correctly“indicates that a signalmessage was unable to bedelivered to the remote party;e.g. a physical layer or datalink layer failure at theremote party, or userequipment off-line.28 484 INVALID_NUMBER_FORMATinvali
23、d numberformat (addressincomplete)Q.850This cause indicates that thecalled party cannot bereached because the calledparty number is not in a validformat or is not complete.29 501 FACILITY_REJECTEDfacilitiesrejectedQ.850This cause is returned when asupplementary servicerequested by the user cannotbe
24、provide by the network.30 RESPONSE_TO_STATUS_ENQUIRYresponse toSTATUSINQUIRYQ.850This cause is included in theSTATUS message when thereason for generating theSTATUS message was theprior receipt of a STATUSINQUIRY.31 480 NORMAL_UNSPECIFIEDnormal,unspecifiedQ.850This cause is used to report anormal ev
25、ent only when noother cause in the normalclass applies.34 503 NORMAL_CIRCUIT_CONGESTIONnocircuit/channelavailableQ.850This cause indicates that thereis no appropriatecircuit/channel presentlyavailable to handle the call.38 503 NETWORK_OUT_OF_ORDER network out oforder Q.850This cause indicates that t
26、henetwork is not functioningcorrectly and that thecondition is likely to last arelatively long period of timee.g. immediatelyre-attempting the call is notlikely to be successful.41 503 NORMAL_TEMPORARY_FAILURE temporaryfailure Q.850This cause indicates that thenetwork is not functioningcorrectly and
27、 that thecondition is not likely to lasta long period of time; e.g. theuser may wish to try anotherHangup_CausesQ.850 to SIP Code Table 5call attempt almostimmediately.42 503 SWITCH_CONGESTIONswitchingequipmentcongestionQ.850This cause indicates that theswitching equipmentgenerating this cause isexp
28、eriencing a period of hightraffic.43 ACCESS_INFO_DISCARDEDaccessinformationdiscardedQ.850This cause indicates that thenetwork could not deliveraccess information to theremote user as requested, i.e.user-to-user information, lowlayer compatibility, highlayer compatibility orsub-address as indicated i
29、nthe diagnostic. It is noted thatthe particular type of accessinformation discarded isoptionally included in thediagnostic.44 503 REQUESTED_CHAN_UNAVAILrequestedcircuit/channelnot availableQ.850This cause is returned whenthe other side of the interfacecannot provide the circuit orchannel indicated b
30、y therequesting entity.45 PRE_EMPTED47resourceunavailable,unspecifiedQ.850This cause is used to report aresource unavailable eventonly when no other cause inthe resource unavailable classapplies.50 FACILITY_NOT_SUBSCRIBEDrequestedfacility notsubscribedQ.850This cause indicates that theuser has reque
31、sted asupplementary service, whichis available, but the user isnot authorized to use.52 403 OUTGOING_CALL_BARRED outgoing callsbarredThis cause indicates thatalthough the calling party is amember of the CUG for theoutgoing CUG call, outgoingcalls are not allowed for thismember of the CUG.54 403 INCO
32、MING_CALL_BARRED incoming callsbarredThis cause indicates thatalthough the called party is amember of the CUG for theHangup_CausesQ.850 to SIP Code Table 6incoming CUG call,incoming calls are notallowed to this member of theCUG.57 403 BEARERCAPABILITY_NOTAUTHbearercapability notauthorizedQ.850This c
33、ause indicates that theuser has requested a bearercapability that isimplemented by theequipment which generatedthis cause but the user is notauthorized to use.58 503 BEARERCAPABILITY_NOTAVAILbearercapability notpresentlyavailableQ.850This cause indicates that theuser has requested a bearercapability
34、 which isimplemented by theequipment which generatedthis cause but which is notavailable at this time.63 SERVICE_UNAVAILABLEservice oroption notavailable,unspecifiedQ.850This cause is used to report aservice or option notavailable event only when noother cause in the service oroption not available c
35、lassapplies.65 488 BEARERCAPABILITY_NOTIMPLbearercapability notimplementedQ.850This cause indicates that theequipment sending this causedoes not support the bearercapability requested.66 CHAN_NOT_IMPLEMENTEDchannel typenotimplementedQ.850This cause indicates that theequipment sending this causedoes
36、not support the channeltype requested69 501 FACILITY_NOT_IMPLEMENTEDrequestedfacility notimplementedQ.850This cause indicates that theequipment sending this causedoes not support therequested supplementaryservices.79 501 SERVICE_NOT_IMPLEMENTEDservice oroption notimplemented,unspecifiedQ.850This cau
37、se is used to report aservice or option notimplemented event onlywhen no other cause in theservice or option notimplemented class applies.81 INVALID_CALL_REFERENCE invalid callreference valueThis cause indicates that theequipment sending this causeHangup_CausesQ.850 to SIP Code Table 7Q.850 has rece
38、ived a message with acall reference which is notcurrently in use on theuser-network interface.88 488 INCOMPATIBLE_DESTINATIONincompatibledestinationQ.850This cause indicates that theequipment sending this causehas received a request toestablish a call which has lowlayer compatibility, highlayer comp
39、atibility or othercompatibility attributes (e.g.data rate) which cannot beaccommodated.95 INVALID_MSG_UNSPECIFIEDinvalidmessage,unspecifiedQ.850This cause is used to reportan invalid message event onlywhen no other cause in theinvalid message class applies.96 MANDATORY_IE_MISSINGmandatoryinformation
40、element ismissingQ.850This cause indicates that theequipment sending this causehas received a message whichis missing an informationelement which must bepresent in the message beforethat message can beprocessed.97 MESSAGE_TYPE_NONEXISTmessage typenon-existent ornotimplementedQ.850This cause indicate
41、s that theequipment sending this causehas received a message with amessage type it does notrecognize either because thisis a message not defined ofdefined but not implementedby the equipment sending thiscause.98 WRONG_MESSAGEmessage notcompatiblewith call stateor messagetypenon-existent ornotimpleme
42、nted.Q.850This cause indicates that theequipment sending this causehas received a message suchthat the procedures do notindicate that this is apermissible message toreceive while in the call state,or a STATUS message wasreceived indicating anincompatible call state.99 IE_NONEXIST Informationelement
43、/This cause indicates that theequipment sending this causeHangup_CausesQ.850 to SIP Code Table 8parameternon-existent ornotimplementedQ.850has received a message whichincludes informationelement(s)/parameter(s) notrecognized because theinformationelement(s)/parameter name(s)are not defined or are de
44、finedbut not implemented by theequipment sending the cause.This cause indicates that theinformationelement(s)/parameter(s) werediscarded. However, theinformation element is notrequired to be present in themessage in order for theequipment sending the causeto process the message.100 INVALID_IE_CONTEN
45、TSInvalidinformationelementcontentsQ.850This cause indicates that theequipment sending this causehas received and informationelement which it hasimplemented; however, oneor more fields in the I.E. arecoded in such a way whichhas not been implemented bythe equipment sending thiscause.101 WRONG_CALL_S
46、TATEmessage notcompatiblewith call stateQ.850This cause indicates that amessage has been receivedwhich is incompatible withthe call state.102 504 RECOVERY_ON_TIMER_EXPIRErecovery ontimer expiryQ.850This cause indicates that aprocedure has been initiatedby the expiration of a timer inassociation with
47、 errorhandling procedures. This isoften associated with NATproblems. Ensure that “NATMapping Enable“ is turned onin your ATA. If it is not NATrelated it can sometimes beprovider related, make sure toensure another outboundprovider does not solve theproblem.103 MANDATORY_IE_LENGTH_ERROR parameter Thi
48、s cause indicates that theHangup_CausesQ.850 to SIP Code Table 9non-existent ornotimplemented -passed on(national use)Q.850equipment sending this causehas received a message whichincludes parameters notrecognized because theparameters are not defined orare defined but notimplemented by theequipment
49、sending this cause.The cause indicates that theparameter(s) were ignored. Inaddition, if the equipmentsending this cause is anintermediate point, then thiscause indicates that theparameter(s) were passedunchanged.111 PROTOCOL_ERRORprotocol error,unspecifiedQ.850This cause is used to report aprotocol error event onlywhen no other cause in theprotocol error class applies.127 INTERWORKINGInterworking,unspecifiedQ.850This cause indicates that aninterworking call (usually acall to SW56 service) hasended.487 487