[asterisk-dev] bad AMI events order

marek cervenka cervajs2 at gmail.com
Wed Apr 24 17:34:51 CDT 2019


ok. i understand ordering events which can be non deterministic


second problem which we found is in filled uniqueid and destuniqueid

in working scenario is

line with AgentConnect, destuniqueid": "1555512601.464

last but one Hangup has "uniqueid": "1555512601.464"  (which works for 
us, because we can pair the call)


in our problem scenario (ast 13.24 and newer)

line with AgentConnect, "destuniqueid": "1555512879.7"

but last but one Hangup neither last Hangup doesnt have this 
uniqueid=1555512879.7


it looks like Asterisk behavior changed from 13.23 to 13.24


Dne 24/04/2019 v 20:30 Kevin Harwell napsal(a):
> On Wed, Apr 24, 2019 at 10:29 AM marek cervenka <cervajs2 at gmail.com 
> <mailto: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/20190425/d535cfed/attachment-0001.html>


More information about the asterisk-dev mailing list