[asterisk-users] pjsip Hangupcause not working

cio-alves at playerschool.edu cio-alves at playerschool.edu
Tue Mar 1 16:38:32 CST 2022


I have a hangup handler on an outgoing PJSIP channel that grabs the SIP 
status
like this:

     NoOp(keys=${HANGUPCAUSE_KEYS()} 
sipmsg=${HANGUPCAUSE(${CHANNEL},tech)})


This works fine if the call connects to the other end but the caller for
example hangs up while it's still ringing:

     NoOp("PJSIP/custom-000000ab", "keys=PJSIP/custom-000000ab sipmsg=SIP 
180 Ringing") in new stack


It also works fine if the call was answered:

     NoOp("PJSIP/custom-000000ad", 
"keys=PJSIP/custom-000000ad,PJSIP/squiresvi-000000ac sipmsg=SIP 200 OK") 
in new stack


But if the remote end returns an error status (eg 404) then I get 
nothing:

     func_hangupcause.c:140 hangupcause_read: Unable to find information 
for channel PJSIP/custom-000000af
     -- Executing [sipdirect2 at hangup_handlers_egress:6] 
NoOp("PJSIP/custom-000000af", "keys= sipmsg=") in new stack


Any idea whether this is possible? It works fine in our old Asterisk
systems, but on Asterisk 16 with PJSIP I'm getting nowhere with it.




More information about the asterisk-users mailing list