PJSIPHangup(Cause)
Full arguments reference
Causerequired - May be one of...Response code- A numeric response code in the range 400 ->699Response code name- A response code name fromthird-party/pjproject/source/pjsip/include/pjsip/sip_msg.hsuch asUSE_IDENTITY_HEADERorPJSIP_SC_USE_IDENTITY_HEADER
Hangs up an incoming PJSIP channel and returns the specified SIP response code in the final response to the caller.
Warning
This function must be called BEFORE anything that might cause any other final (non 1XX) response to be sent. For example calling Answer() or Playback without the noanswer option will cause the call to be answered and a final 200 response to be sent.
As with the Hangup application, the dialplan will terminate after calling this function.
The cause code set on the channel will be translated to a standard ISDN cause code using the table defined in ast_sip_hangup_sip2cause() in res_pjsip.c
``` title="Terminate call with 437 response code" same = n,PJSIPHangup(437)
``` title="Terminate call with 437 response code using the response code name"
same = n,PJSIPHangup(UNSUPPORTED_CERTIFICATE)
title="Terminate call with 437 response code based on condition"
same = n,ExecIf($[${SOMEVALUE} = ${SOME_BAD_VALUE}]?PJSIPHangup(437))
Causerequired - May be one of...Response code- A numeric response code in the range 400 ->699Response code name- A response code name fromthird-party/pjproject/source/pjsip/include/pjsip/sip_msg.hsuch asUSE_IDENTITY_HEADERorPJSIP_SC_USE_IDENTITY_HEADER
User Notes
No notes yet. Be the first to contribute a tip or example.
Contribute a note
Share a tip, gotcha, or practical example. Keep it under 2000 characters. No questions (use the Asterisk community forums for support). Wrap code in backticks.