-
Notifications
You must be signed in to change notification settings - Fork 801
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fixed Buddy to use correct account during subscription #4227
Conversation
What happens to the buddy when the account is deleted? |
Good question. I just add validity check in pjsua. In pjsua2 though, if the associated Account instance has been destroyed, then it will be a problem indeed, though I suppose it will be the app developer's fault? The best we can do is add doc in |
|
I tried returning error but encountered a few issues:
So, I opted to remove the buddy-account association. There's still a possibility of race, but then the doc has specifically warned (in three locations now) to keep the Account alive when Buddy is alive: pjproject/pjsip/include/pjsua2/presence.hpp Lines 206 to 208 in cb85368
(the other two warnings in pjsua_buddy_config and Buddy::Create() in this patch). Also fixed bug in Account::findBuddy2() and enumBuddies2() to only return buddies associated with the account. |
To fix #4226
The issue occurs because in pjsua, buddy is not tied to any account, so it will always call
pjsua_acc_find_for_outgoing()
to find the appropriate account for outgoing subscription.Also in this PR:
Fixed bug in Account::findBuddy2() and enumBuddies2() to only return buddies associated with the account.