[asterisk-dev] bad AMI events order

Kevin Harwell kharwell at digium.com
Wed Apr 24 13:30:04 CDT 2019


On Wed, Apr 24, 2019 at 10:29 AM marek cervenka <cervajs2 at gmail.com> wrote:

> hi,
>
> in asterisk 13.24.1 is something "different" with AMI events (precisely
> Hangup event)
>
> scenario
>
> simple call to queue, call is answered by Agent
>
> in asterisk 13.23.1 is AMI flow like this
> { "event": "QueueCallerJoin", "uniqueid": "1555512600.457","linkedid":
> "1555512600.457" }
> { "event": "AgentCalled", "uniqueid": "1555512600.457","linkedid":
> "1555512600.457","destuniqueid": "1555512601.464","destlinkedid":
> "1555512600.457"}
> { "event": "AgentConnect", "uniqueid": "1555512600.457","linkedid":
> "1555512600.457","destuniqueid": "1555512601.464","destlinkedid":
> "1555512600.457",}
> { "event": "Hangup", "uniqueid": "1555512601.465","linkedid":
> "1555512600.457" }
> { "event": "Hangup", "uniqueid": "1555512601.471","linkedid":
> "1555512600.457" }
> { "event": "AgentComplete", "uniqueid": "1555512600.457","linkedid":
> "1555512600.457","destuniqueid": "1555512601.471","destlinkedid":
> "1555512600.457",}
> { "event": "Hangup", "uniqueid": "1555512601.464","linkedid":
> "1555512600.457" }
> { "event": "Hangup", "uniqueid": "1555512600.457","linkedid":
> "1555512600.457" }
>
> but it changed in asterisk 13.24.1 and later (ast 13.26.0 tested)
> { "event": "QueueCallerJoin","uniqueid": "1555512879.0" ,"linkedid":
> "1555512879.0" }
> { "event": "AgentCalled", "uniqueid": "1555512879.0" ,"linkedid":
> "1555512879.0","destuniqueid": "1555512879.7","destlinkedid":
> "1555512879.0" }
> { "event": "Hangup", "uniqueid": "1555512879.7" ,"linkedid":
> "1555512879.0" }
> { "event": "AgentConnect", "uniqueid": "1555512879.0" ,"linkedid":
> "1555512879.0","destuniqueid": "1555512879.7","destlinkedid":
> "1555512879.0" }
> { "event": "Hangup", "uniqueid": "1555512879.8" ,"linkedid":
> "1555512879.0" }
> { "event": "AgentComplete", "uniqueid": "1555512879.0" ,"linkedid":
> "1555512879.0","destuniqueid": "1555512879.14","destlinkedid":
> "1555512879.0" }
> { "event": "Hangup", "uniqueid": "1555512879.14","linkedid":
> "1555512879.0" }
> { "event": "Hangup", "uniqueid": "1555512879.0", "linkedid":
> "1555512879.0" }
>
> first Hangup is before AgentConnect
>
> do you think it can be considered bug?
>
Given the information it doesn't seem like a bug. Ordering between most AMI
events is not guaranteed.

> any ideas where this change happened?
>
If it's only due to threading and timing it'd be tough to track down.
Depending on timing an alteration could make it so any given thread is now
running slightly slower, or even faster, than before. Thus altering the
order.

>
> i found only these changes to app_queue
>
> https://issues.asterisk.org/jira/browse/ASTERISK-28125
>
>
> https://github.com/asterisk/asterisk/commit/f23a12244d8286e26554b7658a042f51497c1485
>
>
> Marek
>
>

-- 
Kevin Harwell
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: https://digium.com & https://asterisk.org
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-dev/attachments/20190424/c574ad3a/attachment.html>


More information about the asterisk-dev mailing list