Hi,
Asterisk 18.20.1
I’ve added a custom column to the asteriskcdrdb.cdr table “hangupside”, and I’m struggling to find to the correct dialplan pattern to use in order to detect who hung up the call, I have a macro-hangupcall that being executed on every hang up, here is the log for the different events:
Trunk name for outbound calls: PJSIP/OUT-Kamailio
Trunk names for inbound calls: PJSIP/IN-Hulk & PJSIP/IN-Spunk
Inbound call to a queue with skip busy agents = no where ext 899 is ringing but not answering, 5998 is offline, caller hung up:
root@idan-testing:~# asterisk -rvvv | grep hangup_channel
-- Executing [s@macro-hangupcall:86] Set("Local/5998@from-queue-00000003;2", "hangup_channel=dialplan/builtin") in new stack
-- Executing [s@macro-hangupcall:86] Set("Local/899@from-queue-00000002;2", "hangup_channel=") in new stack
-- Executing [s@macro-hangupcall:86] Set("PJSIP/IN-Hulk-00000002", "hangup_channel=PJSIP/IN-Hulk-00000002") in new stack
Inbound call to a queue with skip busy agents = no where ext 899 is ringing and then answering, 5998 is offline, caller hung up:
root@idan-testing:~# asterisk -rvvv | grep hangup_channel
-- Executing [s@macro-hangupcall:86] Set("Local/5998@from-queue-00000005;2", "hangup_channel=dialplan/builtin") in new stack
-- Executing [s@macro-hangupcall:86] Set("Local/899@from-queue-00000004;2", "hangup_channel=") in new stack
-- Executing [s@macro-hangupcall:86] Set("PJSIP/IN-Hulk-00000004", "hangup_channel=PJSIP/IN-Hulk-00000004") in new stack
Inbound call to a queue with skip busy agents = no where ext 899 is ringing and then answering, 5998 is offline, calle hung up (ext 899):
root@idan-testing:~# asterisk -rvvv | grep hangup_channel
-- Executing [s@macro-hangupcall:86] Set("Local/5998@from-queue-00000007;2", "hangup_channel=dialplan/builtin") in new stack
-- Executing [s@macro-hangupcall:86] Set("Local/899@from-queue-00000006;2", "hangup_channel=PJSIP/899-00000007") in new stack
-- Executing [s@macro-hangupcall:86] Set("PJSIP/IN-Spunk-00000006", "hangup_channel=") in new stack
Outbound call from ext 899, caller hung up:
root@idan-testing:~# asterisk -rvvv | grep hangup_channel
-- Executing [s@macro-hangupcall:86] Set("PJSIP/899-0000000b", "hangup_channel=PJSIP/899-0000000b") in new stack
Outbound call from ext 899, calle hung up:
root@idan-testing:~# asterisk -rvvv | grep hangup_channel
-- Executing [s@macro-hangupcall:86] Set("PJSIP/899-0000000b", "hangup_channel=PJSIP/899-0000000b") in new stack
-- Executing [s@macro-hangupcall:86] Set("PJSIP/899-0000000d", "hangup_channel=PJSIP/OUT-Kamailio-0000000e") in new stack
The main issue is with inbound calls to a queue where there are Local channels..
If someone has some idea how to detect it correctly for all legs (channels) I will appreciate it.
Thanks, Idan