Cannot hangup channel with command

Hi,

I’m using asterisk 13.11.2 and I have notice a channel up even though it’s not active anymore.

You can see the channel up for 2 hours doing nothing

CLI>pjsip show channels

Channel: PJSIP/01-A-A4934CFE2736-000006a7/TrySystem Up 02:13:47
Exten: s CLCID: “Intercom” <*46>

I have requested a hangup but asterisk is not hangingup the channel:

channel request hangup PJSIP/01-A-A4934CFE2736-000006a7

Requested Hangup on channel ‘PJSIP/01-A-A4934CFE2736-000006a7’

pjsip show channels

Channel: <ChannelId…> <State…> <Time…>
Exten: <DialedExten…> CLCID: <ConnectedLineCID…>

Channel: PJSIP/01-A-A4934CFE2736-000006a7/TrySystem Up 02:38:18
Exten: s CLCID: “Intercom” <*46>

What can I do to force a hangup?

Here is part of my dialplan:

exten => *46,1,Verbose(2,Paging)
same => n,AGI(Paging.agi)
;Variable returned from agi
same => n,NoOp(${AST_PAGE_DEVICES})
same => n,Set(CHANNEL(hangup_handler_push)=hdlr_vol_cisco,s,1(args))
same => n,Page(${AST_PAGE_DEVICES},b(paging_handler^addheader^1)is)
same => n,Hangup()

;Hangup handler
[hdlr_vol_cisco]
exten => s,1,NoOp()
same => n,NoCDR()
same => n,TrySystem(/usr/local/bin/python2.7 /var/lib/asterisk/agi-bin/Set_Volume_Down_Cisco.py)
same => n,Return()

;Predial handler
[paging_handler]
exten => addheader,1,Set(PJSIP_HEADER(add,Call-Info)=;Answer-After=0)
same => n,Return()

What is the channel currently doing if you do “core show channels”?

Not much… It seems to executing a python script but I see no Python running.

core show channels concise

PJSIP/01-A-A4934CFE2736-000006a7!hdlr_vol_cisco!s!3!Up!TrySystem!/usr/local/bin/python2.7 /var/lib/asterisk/agi-bin/Set_Volume_Down_Cisco.py!2243!garneau!!3!14438!!1476370464.2495

By the way, my page is working great if I dial *46 again.The channel hangup correctly and does not appear in the channel list.

Hum the funny thing is that after the hangup handler is done, it does not return to the dialplan for the hangup…
It just stops.

I have added a hello message and I never see it in the console.


same => n,Page(${AST_PAGE_DEVICES},b(paging_handler^addheader^1)is)
same => n,NoOp(hello)
same => n,Hangup()

Executing [s@hdlr_vol_cisco:1] NoOp(“PJSIP/01-A-A4934CFE2736-00000ffd”, “”) in new stack
[Oct 13 15:09:01] – Executing [s@hdlr_vol_cisco:2] NoCDR(“PJSIP/01-A-A4934CFE2736-00000ffd”, “”) in new stack
[Oct 13 15:09:01] – Executing [s@hdlr_vol_cisco:3] TrySystem(“PJSIP/01-A-A4934CFE2736-00000ffd”, “/usr/local/bin/python2.7 /var/lib/asterisk/agi-bin/Set_Volume_Down_Cisco.py”) in new stack
[Oct 13 15:09:01] – Executing [s@hdlr_vol_cisco:4] Return(“PJSIP/01-A-A4934CFE2736-00000ffd”, “”) in new stack