Hello,

 

yes, if the priority is the same, records should be ordered by received_time. Acting in this way, when “presentity” table has more than one record of the same user with equal priority, to watcher would be send Notify message with last received status.

 

SQL like:

select * from presentity where username=X and priority=Y order by received_time desc;

 

 

Thanks,

 

Ales

 

 

 

From: Daniel-Constantin Mierla [mailto:miconda@gmail.com]
Sent: Wednesday, June 01, 2016 9:15 AM
To: Kamailio (SER) - Users Mailing List
Cc: 'Ales Sturm'
Subject: Re: [SR-Users] Wrong Publish status

 

Hello,

skipping the other content to fit in size limits for mailing list ...

On 27/05/16 11:59, Aleš Šturm wrote:

I think that statuses with equal “priority” are retrieved by “id” and not by “received_time”!?

Is the above the conclusion and the fix would be to order by received_time if the priority is the same?

At this moment I expect there is no further ordering than the priority in this case, mysql being the one returning the order within the priority as the records are found in the db. Like, if you just do a select without order by, there is no guarantee that the order of records is the one as the records were added.

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com - http://www.kamailio.org
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda