Conference slot issue with simultaneous call end / call begin

3
301@free.fr
Wed, Jul 12, 2017 11:00 PM

Hi,

I have a bug in pjsua2 where a tone generator fails to connect to the
conference bridge:

When a first call is disconnected, I play a tone to indicate the end of
connection:
In the onCallState callback of my call class, on DISCONNECTED state I
start playing the tones and before deleting the call object, I wait for the
tone to finish playing (less than a second).

The problem is when I make a second call while the tone is playing: a new
call object is created with its tone generator, but when I ask to play the
ringing tone, the connection to the conference bridge fails.

Actually after deep looking, it appears that:

  • when the first call is disconnected, pjsua2 delete all AudioMedia
    instances which lead to removing all media from conference bridge.
  • when the second call is created, the createToneGenerator function takes
    the first conference bridge slot available which is the previously slot
    released by the first call media
  • the first call object delete is done a little while after, and then pjsip
    release all the streams (linked to the Audio Media in pjsua2) from the
    conference bridge. In a "regular" case, nothing is done here because the
    slot is NULL (it has been emptied before by the AudioMedia deletion).
    But here the slot is not empty so the slot used by the tone generator of
    the second call is removed by the deletion of the first call
    So bad!

I would suggest that in pjsua2, when we remove all medias in Call class
onCallState function, pjsip stream count is also updated.

I don't very well how to do this and if it is relevant, so I raise the
point.
Thanks in advance for advices/discussion/decision

Regards,
Thibault

Hi, I have a bug in pjsua2 where a tone generator fails to connect to the conference bridge: When a first call is disconnected, I play a tone to indicate the end of connection: In the onCallState callback of my call class, on DISCONNECTED state I start playing the tones and before deleting the call object, I wait for the tone to finish playing (less than a second). The problem is when I make a second call while the tone is playing: a new call object is created with its tone generator, but when I ask to play the ringing tone, the connection to the conference bridge fails. Actually after deep looking, it appears that: - when the first call is disconnected, pjsua2 delete all AudioMedia instances which lead to removing all media from conference bridge. - when the second call is created, the createToneGenerator function takes the first conference bridge slot available which is the previously slot released by the first call media - the first call object delete is done a little while after, and then pjsip release all the streams (linked to the Audio Media in pjsua2) from the conference bridge. In a "regular" case, nothing is done here because the slot is NULL (it has been emptied before by the AudioMedia deletion). But here the slot is not empty so the slot used by the tone generator of the second call is removed by the deletion of the first call So bad! I would suggest that in pjsua2, when we remove all medias in Call class onCallState function, pjsip stream count is also updated. I don't very well how to do this and if it is relevant, so I raise the point. Thanks in advance for advices/discussion/decision Regards, Thibault