Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@lgaetz
Last active April 14, 2023 14:50
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save lgaetz/480582a1827cc98db1ee539c249f074b to your computer and use it in GitHub Desktop.
Save lgaetz/480582a1827cc98db1ee539c249f074b to your computer and use it in GitHub Desktop.
[send-sip-response-code]
; Context to send a specific SIP response code and terminate the channel
; Create Custom Destination in FreePBX with a dial string of the format
; send-sip-response-code,404,1
; substitute the appropriate response code in place of the 404
; Reference: https://wiki.asterisk.org/wiki/display/AST/Hangup+Cause+Mappings
;
; latest version: https://gist.github.com/lgaetz/480582a1827cc98db1ee539c249f074b
;
; License GPL/2
;
; History 2019-10-08 First attempt supports 404, 480 and 486
; 2023-04-14 added 501
exten => 404,1,NoOp(Entering user defined context send-sip-response-code in extensions_custom.conf)
exten => 404,n,NoOp(Sending SIP 404 Not Found)
exten => 404,n,hangup(1)
exten => 480,1,NoOp(Entering user defined context send-sip-response-code in extensions_custom.conf)
exten => 480,n,NoOp(Sending SIP 480 Temporarily Unavailable)
exten => 480,n,hangup(19)
exten => 486,1,NoOp(Entering user defined context send-sip-response-code in extensions_custom.conf)
exten => 486,n,NoOp(Sending SIP 486 Busy)
exten => 486,n,hangup(17)
exten => 501,1,NoOp(Entering user defined context send-sip-response-code in extensions_custom.conf)
exten => 501,n,NoOp(Sending SIP 501 Busy)
exten => 501,n,hangup(29)
; end context send-sip-response-code
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment