Ticket #455 (closed enhancement: fixed)

Opened 10 years ago

Last modified 10 years ago

Allocate call id in round robin fashion

Reported by: bennylp Owned by: bennylp
Priority: normal Milestone: release-0.9.0
Component: pjsua-lib Version: trunk
Keywords: Cc:
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.

Change History

comment:1 Changed 10 years ago by bennylp

  • Status changed from new to closed
  • Resolution set to fixed

Done in r1717

comment:2 Changed 10 years ago by bennylp

  • Description modified (diff)

comment:3 Changed 10 years ago by bennylp

In r1821:

  • fixed bug in call ID allocation (thanks Truong Thanh Quang)
Note: See TracTickets for help on using tickets.