As I wait for the Sangoma CRM module to be fixed, I’m experimenting with AMI to see if I could pull events from the system and build something basic so I can at least start working on my CRM side of things. I only need to focus on “post call” events (i.e. missed calls, answered calls, voicemail), I do not need any control on ongoing calls.
My inbound numbers are on a ringall strategy. I’ve limited events to Cdr. The extensions in the ring all may not be answering (ie.e. phone not connected) or do so via Sangoma Talk or Desktop. We have no physical phones.
What happens after the call is that I get a record of all extensions that ring as well as the one which answers. I cannot figure out a way to either:
-
Not have those generated to start with (ie.e. above “asnwered elsewhere”). Perhaps softphones are not compatible?
-
Or a logic I could implement to ignore irrelevant “events” so that I can be 100% certain to not miss the true event record I need (i.e. I still need a record if a call actually does not get answered by anyone). I hoped I could somehow pull them using the unique ID (i.e. IF multiple events same ID, chose the one with longest duration), but the IDs seem always different (see below 1718305959 and 1718305958).
I have this enabled:
This is an example of output (I took out Source and Called ID which however display consistently and correctly per event):
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 90340
DestinationContext: zulu-call
Channel: Local/90340@zulu-call-00000012;2
DestinationChannel: Local/90340@zulu-desktop-phone-00000013;1
LastApplication: Dial
LastData: Local/90340@zulu-desktop-phone&Local/90340@zulu-mobile-phone-push,15,HhTtrM(aut
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: NO ANSWER
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.101
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 90340
DestinationContext: zulu-call
Channel: Local/90340@zulu-call-00000012;2
DestinationChannel: Local/90340@zulu-mobile-phone-push-00000014;1
LastApplication: Dial
LastData: Local/90340@zulu-desktop-phone&Local/90340@zulu-mobile-phone-push,15,HhTtrM(aut
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: NO ANSWER
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.101
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 90321
DestinationContext: zulu-call
Channel: Local/90321@zulu-call-00000015;2
DestinationChannel: Local/90321@zulu-desktop-phone-00000016;1
LastApplication: Dial
LastData: Local/90321@zulu-desktop-phone&Local/90321@zulu-mobile-phone-push,15,HhTtrM(aut
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: NO ANSWER
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.107
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 90321
DestinationContext: zulu-call
Channel: Local/90321@zulu-call-00000015;2
DestinationChannel: Local/90321@zulu-mobile-phone-push-00000017;1
LastApplication: Dial
LastData: Local/90321@zulu-desktop-phone&Local/90321@zulu-mobile-phone-push,15,HhTtrM(aut
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: NO ANSWER
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.107
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 340
DestinationContext: from-internal
Channel: Local/340@from-queue-0000000c;2
DestinationChannel: Local/90340@zulu-call-00000012;1
LastApplication: Dial
LastData: Local/90340@zulu-call,,HhtrM(auto-blkvm)Ib(func-apply-sipheaders^s^1)
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.89
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 321
DestinationContext: from-internal
Channel: Local/321@from-queue-00000010;2
DestinationChannel: Local/90321@zulu-call-00000015;1
LastApplication: Dial
LastData: Local/90321@zulu-call,,HhtrM(auto-blkvm)Ib(func-apply-sipheaders^s^1)
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.97
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 200
DestinationContext: ext-local
Channel: Local/200@from-queue-00000011;2
DestinationChannel: PJSIP/98200-0000003c
LastApplication: Dial
LastData: PJSIP/98200/sip:[email protected]:46108;transport=WS;x-ast-orig-host=klhtuju4u
StartTime: 2024-06-13 15:12:39
AnswerTime:
EndTime: 2024-06-13 15:12:40
Duration: 0
BillableSeconds: 0
Disposition: NO ANSWER
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.99
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 200
DestinationContext: ext-local
Channel: Local/200@from-queue-00000011;2
DestinationChannel: PJSIP/200-0000003d
LastApplication: Dial
LastData: PJSIP/98200/sip:[email protected]:46108;transport=WS;x-ast-orig-host=klhtuju4u
StartTime: 2024-06-13 15:12:39
AnswerTime: 2024-06-13 15:12:41
EndTime: 2024-06-13 15:12:45
Duration: 6
BillableSeconds: 4
Disposition: ANSWERED
AMAFlags: DOCUMENTATION
UniqueID: 1718305959.99
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 3000
DestinationContext: ext-queues
Channel: PJSIP/Twilio_NA_Virginia-0000003b
DestinationChannel: Local/340@from-queue-0000000c;1
LastApplication: Queue
LastData: 3000,tC,,,,,,,,
StartTime: 2024-06-13 15:12:38
AnswerTime: 2024-06-13 15:12:38
EndTime: 2024-06-13 15:12:40
Duration: 2
BillableSeconds: 1
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305958.87
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 3000
DestinationContext: ext-queues
Channel: PJSIP/Twilio_NA_Virginia-0000003b
DestinationChannel: Local/310@from-queue-0000000d;1
LastApplication: Queue
LastData: 3000,tC,,,,,,,,
StartTime: 2024-06-13 15:12:39
AnswerTime: 2024-06-13 15:12:39
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305958.87
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 3000
DestinationContext: ext-queues
Channel: PJSIP/Twilio_NA_Virginia-0000003b
DestinationChannel: Local/311@from-queue-0000000e;1
LastApplication: Queue
LastData: 3000,tC,,,,,,,,
StartTime: 2024-06-13 15:12:39
AnswerTime: 2024-06-13 15:12:39
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305958.87
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 3000
DestinationContext: ext-queues
Channel: PJSIP/Twilio_NA_Virginia-0000003b
DestinationChannel: Local/320@from-queue-0000000f;1
LastApplication: Queue
LastData: 3000,tC,,,,,,,,
StartTime: 2024-06-13 15:12:39
AnswerTime: 2024-06-13 15:12:39
EndTime: 2024-06-13 15:12:39
Duration: 0
BillableSeconds: 0
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305958.87
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 3000
DestinationContext: ext-queues
Channel: PJSIP/Twilio_NA_Virginia-0000003b
DestinationChannel: Local/321@from-queue-00000010;1
LastApplication: Queue
LastData: 3000,tC,,,,,,,,
StartTime: 2024-06-13 15:12:39
AnswerTime: 2024-06-13 15:12:39
EndTime: 2024-06-13 15:12:40
Duration: 1
BillableSeconds: 1
Disposition: FAILED
AMAFlags: DOCUMENTATION
UniqueID: 1718305958.87
UserField:
Event: Cdr
Privilege: cdr,all
AccountCode:
Destination: 3000
DestinationContext: ext-queues
Channel: PJSIP/Twilio_NA_Virginia-0000003b
DestinationChannel: Local/200@from-queue-00000011;1
LastApplication: Queue
LastData: 3000,tC,,,,,,,,
StartTime: 2024-06-13 15:12:39
AnswerTime: 2024-06-13 15:12:39
EndTime: 2024-06-13 15:12:45
Duration: 6
BillableSeconds: 6
Disposition: ANSWERED
AMAFlags: DOCUMENTATION
UniqueID: 1718305958.87
UserField:
I did initially try ring groups and currently they are setup as queue. They seem to behave similarly. Any pointer?