Skip to content

Commit

Permalink
Merge branch 'pjsip:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
emretufekci authored Mar 14, 2022
2 parents e6a27ee + 601f0c7 commit 949705f
Showing 1 changed file with 19 additions and 10 deletions.
29 changes: 19 additions & 10 deletions pjsip/src/pjsua-lib/pjsua_acc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1067,12 +1067,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,

/* Transport */
if (acc->cfg.transport_id != cfg->transport_id) {
acc->cfg.transport_id = cfg->transport_id;

if (acc->cfg.transport_id != PJSUA_INVALID_ID)
acc->tp_type = pjsua_var.tpdata[acc->cfg.transport_id].type;
else
acc->tp_type = PJSIP_TRANSPORT_UNSPECIFIED;
pjsua_acc_set_transport(acc_id, cfg->transport_id);

update_reg = PJ_TRUE;
unreg_first = PJ_TRUE;
Expand Down Expand Up @@ -3877,11 +3872,25 @@ PJ_DEF(pj_status_t) pjsua_acc_set_transport( pjsua_acc_id acc_id,
PJ_ASSERT_RETURN(pjsua_acc_is_valid(acc_id), PJ_EINVAL);
acc = &pjsua_var.acc[acc_id];

PJ_ASSERT_RETURN(tp_id >= 0 && tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata),
PJ_EINVAL);

PJ_ASSERT_RETURN(tp_id < (int)PJ_ARRAY_SIZE(pjsua_var.tpdata), PJ_EINVAL);

if (acc->cfg.transport_id == tp_id)
return PJ_SUCCESS;

acc->cfg.transport_id = tp_id;
acc->tp_type = pjsua_var.tpdata[tp_id].type;

if (acc->cfg.transport_id != PJSUA_INVALID_ID) {
acc->tp_type = pjsua_var.tpdata[acc->cfg.transport_id].type;
if (acc->regc) {
/* Update client registration's transport. */
pjsip_tpselector tp_sel;

pjsua_init_tpselector(acc->cfg.transport_id, &tp_sel);
pjsip_regc_set_transport(acc->regc, &tp_sel);
}
} else {
acc->tp_type = PJSIP_TRANSPORT_UNSPECIFIED;
}

return PJ_SUCCESS;
}
Expand Down

0 comments on commit 949705f

Please sign in to comment.