[Asterisk-Users] HANGUPCAUSE on SIP channels

Eric Futch efutch at nyct.net
Fri Apr 21 09:38:43 MST 2006


Hopefully I'm not just missing some little detail here.  We're trying to 
set the HANGUPCAUSE on SIP channels to have our softswitch play the proper 
recording instead of answering the call on Asterisk to play the message. 
It appears that no matter what the HANGUPCAUSE is set to, Asterisk always 
just sends "603 Declined".

I looked through the source code briefly and it appears that it *should* 
work.  It would be helpful to know if anyone actually uses this feature 
and if it is working properly for them before we go through with fully 
debugging and patching this to work for us.

Here is the our test extension from extensions.conf:
exten => 9218,1,Set(HANGUPCAUSE=1)
exten => 9218,2,Hangup

According to hangup_cause2sip in chan_sip.c a HANGUPCAUSE of 1 should 
cause Asterisk to reply to the softswitch with a "404 Not Found" SIP 
message.  That doesn't seem to be the case, however.

Here is a bit of the verbose console output:
(Please note that I added some extra ast_log calls to the source code to 
generate some extra debugging information.)

Apr 21 12:35:18 WARNING[16430]: pbx.c:5983 pbx_builtin_setvar_helper: 
chan=SIP/nyct-901-539f, name=SIPURI, value=sip:nyct-901 at 192.168.74.33:5060
Apr 21 12:35:18 WARNING[16430]: pbx.c:5983 pbx_builtin_setvar_helper: 
chan=SIP/nyct-901-539f, name=SIPDOMAIN, value=192.168.74.254
Apr 21 12:35:18 WARNING[16430]: pbx.c:5983 pbx_builtin_setvar_helper: 
chan=SIP/nyct-901-539f, name=SIPUSERAGENT, 
value=PolycomSoundPointIP-SPIP_501-UA/1.6.2.0041
Apr 21 12:35:18 WARNING[16430]: pbx.c:5983 pbx_builtin_setvar_helper: 
chan=SIP/nyct-901-539f, name=SIPCALLID, 
value=a6c4f7bd-bdfa66e3-c6fcf7a6 at 192.168.74.33
     -- Executing Set("SIP/nyct-901-539f", "HANGUPCAUSE=1") in new stack
Apr 21 12:35:18 WARNING[16815]: pbx.c:5983 pbx_builtin_setvar_helper: 
chan=SIP/nyct-901-539f, name=HANGUPCAUSE, value=1
Apr 21 12:35:18 WARNING[16815]: pbx.c:6057 pbx_builtin_setvar: 
chan=SIP/nyct-901-539f, name=HANGUPCAUSE, value=1
     -- Executing Hangup("SIP/nyct-901-539f", "") in new stack
Apr 21 12:35:18 WARNING[16815]: pbx.c:5548 pbx_builtin_hangup: 
chan->hangupcause=(null)
   == Spawn extension (nyct, 9218, 2) exited non-zero on 
'SIP/nyct-901-539f'
Apr 21 12:35:18 WARNING[16815]: chan_sip.c:2471 sip_hangup: 
ast->hangupcause=16 res=(null)

This is all on Asterisk 1.2.7.1.  Your line numbers may vary since there 
were some ast_log lines added.  Hopefully this makes some sense to 
someone.

Thanks for any help or input.

--
New York Connect                                 Technical Support Staff
Eric Futch <efutch at nyct.net>                     (212) 293-2620
Weather for KNYC: Apr 21 11:51a EDT, 59F (15C), Fair, Humidity 49%



More information about the asterisk-users mailing list