Skip to content
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

Merged
merged 4 commits into from
Dec 23, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions pjsip/include/pjsua-lib/pjsua_internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,7 @@ typedef struct pjsua_buddy
{
pj_pool_t *pool; /**< Pool for this buddy. */
unsigned index; /**< Buddy index. */
pjsua_acc_id acc_id; /**< Account index. */
void *user_data; /**< Application data. */
pj_str_t uri; /**< Buddy URI. */
pj_str_t contact; /**< Contact learned from subscrp. */
Expand Down
4 changes: 3 additions & 1 deletion pjsip/src/pjsua-lib/pjsua_pres.c
Original file line number Diff line number Diff line change
Expand Up @@ -467,6 +467,7 @@ static void reset_buddy(pjsua_buddy_id id)
pj_bzero(&pjsua_var.buddy[id], sizeof(pjsua_var.buddy[id]));
pjsua_var.buddy[id].pool = pool;
pjsua_var.buddy[id].index = id;
pjsua_var.buddy[id].acc_id = PJSUA_INVALID_ID;
}


Expand Down Expand Up @@ -2013,7 +2014,8 @@ static void subscribe_buddy(pjsua_buddy_id buddy_id,
dlg_event_callback.on_rx_notify = &pjsua_evsub_on_rx_dlg_event_notify;

buddy = &pjsua_var.buddy[buddy_id];
acc_id = pjsua_acc_find_for_outgoing(&buddy->uri);
acc_id = (buddy->acc_id != PJSUA_INVALID_ID)? buddy->acc_id:
pjsua_acc_find_for_outgoing(&buddy->uri);

acc = &pjsua_var.acc[acc_id];

Expand Down
3 changes: 3 additions & 0 deletions pjsip/src/pjsua2/presence.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@
using namespace pj;
using namespace std;

#include <pjsua-lib/pjsua_internal.h>

#define THIS_FILE "presence.cpp"


Expand Down Expand Up @@ -141,6 +143,7 @@ void Buddy::create(Account &account, const BuddyConfig &cfg)
PJSUA2_CHECK_EXPR( pjsua_buddy_add(&pj_cfg, &id) );

account.addBuddy(this);
pjsua_var.buddy[id].acc_id = account.getId();
}

int Buddy::getId() const
Expand Down
Loading