Macro to hangup() a call with SIP 410 Gone

Hello,

I need to write a macro that disconnects/hangup the call with SIP 410, rather then the normal release.

My macro (macro-new) looks like something below.

Using “exten => s,n,Set(MACRO_RESULT=ABORT)” sends SIP 480. I tried specifying Hangup(23), 23 is ISDN mapping code for SIP 410. Any pointers how to achieve this?

[code]
[macro-trunkdial-failover-0.3]
exten = s,1,GotoIf($[${LEN(${FMCIDNUM})} > 6]?1-fmsetcid,1)
exten = s,n,GotoIf($[${LEN(${GLOBAL_OUTBOUNDCIDNAME})} > 1]?1-setgbobname,1)
exten = s,n,GotoIf($[${LEN(${CALLERID(num)})} > 6]?1-dial,1)
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${CID_${ARG3}})} > 6]?${CID_${ARG3}}:${GLOBAL_OUTBOUNDCID})})
exten = s,n,Set(CALLERID(all)=${IF($[${LEN(${ARG5})} > 2]?${ARG5}:)})
exten = s,n,SIPAddHeader(X-rahul-test: Just testing!)
exten = s,n,Goto(1-dial,1)
exten = 1-setgbobname,1,Set(CALLERID(name)=${GLOBAL_OUTBOUNDCIDNAME})
exten = 1-setgbobname,n,Goto(s,3)
exten = 1-fmsetcid,1,Set(CALLERID(num)=${FMCIDNUM})
exten = 1-fmsetcid,n,Set(CALLERID(name)=${FMCIDNAME})
exten = 1-fmsetcid,n,Goto(s,4)
exten = 1-dial,1,Dial(${ARG1},20,M(new,${EXTEN}))
exten = 1-dial,n,Gotoif(${LEN(${ARG2})} > 0 ?1-${DIALSTATUS},1:1-out,1)
exten = 1-CHANUNAVAIL,1,Dial(${ARG2})
exten = 1-CHANUNAVAIL,n,Hangup()
exten = 1-CONGESTION,1,Dial(${ARG2})
exten = 1-CONGESTION,n,Hangup()
exten = 1-out,1,Hangup()

[macro-new]
exten => s,1,Hangup(23)[/code]

How do I achieve 410 Gone?

Thanks!

Do not start new threads for the same subject.

You missed out an essential piece of information, which forces you to modify the source code, namely that you have a fundamental requirement to answer the incoming channel.

WIthout that requirement, you would simply use Hangup (22) on the unanswered channel.