Ticket #455 (closed enhancement: fixed)
Allocate call id in round robin fashion
|Reported by:||bennylp||Owned by:||bennylp|
|Backport to 1.x milestone:||Backported:|
Description (last modified by bennylp) (diff)
Currently call id allocation is done by searching for empty slot from zero, so it will most likely to reuse call id of previous calls. This may cause problem when application defer call disconnection processing to an application worker thread, since when the application worker thread is handling the event, it's possible that another call arrives and uses the same call ID as the previously disconnected call.
Although approach of using worker thread like this is probably not a good idea, PJSUA-LIB can help avoiding this problem a bit (not completely!) by allocating the call id in round robin fashion. Note that even with the round robin call id allocation, application will still encounter the same problem when there is only one call id slot left in PJSUA-LIB. So the only way to get rid of this problem completely is by solving this problem in application code.