summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorNanang Izzuddin <nanang@teluu.com>2014-11-28 10:17:55 +0000
committerNanang Izzuddin <nanang@teluu.com>2014-11-28 10:17:55 +0000
commit21947418c443ca7318649476bc5d113af9746315 (patch)
tree9820fa7b71daabfc2a2ea9cf70e0d145f7e15834 /pjsip
parentaedb223d3a2690682b709fe3667d2ac0b635959e (diff)
Misc (re #1782): Fixed bug of missing SIP header "Supported: outbound, path" after a registration failure (thanks Mateusz Olejnik for the report).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4965 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 89ecd257..98216c3b 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -363,6 +363,8 @@ static pj_status_t initialize_acc(unsigned acc_id)
acc_cfg->rfc5626_reg_id.ptr);
acc->rfc5626_regprm.slen = len;
}
+
+ acc->rfc5626_status = OUTBOUND_WANTED;
}
/* Mark account as valid */
@@ -652,6 +654,7 @@ PJ_DEF(pj_status_t) pjsua_acc_del(pjsua_acc_id acc_id)
acc->valid = PJ_FALSE;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
pj_bzero(&acc->via_addr, sizeof(acc->via_addr));
acc->via_tp = NULL;
acc->next_rtp_port = 0;
@@ -1346,6 +1349,7 @@ PJ_DEF(pj_status_t) pjsua_acc_modify( pjsua_acc_id acc_id,
acc->regc = NULL;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
}
if (!cfg->reg_uri.slen) {
@@ -2163,6 +2167,7 @@ static void regc_cb(struct pjsip_regc_cbparam *param)
acc->regc = NULL;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
/* Stop keep-alive timer if any. */
update_keep_alive(acc, PJ_FALSE, NULL);
@@ -2175,6 +2180,7 @@ static void regc_cb(struct pjsip_regc_cbparam *param)
acc->regc = NULL;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
/* Stop keep-alive timer if any. */
update_keep_alive(acc, PJ_FALSE, NULL);
@@ -2190,6 +2196,7 @@ static void regc_cb(struct pjsip_regc_cbparam *param)
acc->regc = NULL;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
/* Stop keep-alive timer if any. */
update_keep_alive(acc, PJ_FALSE, NULL);
@@ -2305,6 +2312,7 @@ static pj_status_t pjsua_regc_init(int acc_id)
acc->regc = NULL;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
}
/* initialize SIP registration if registrar is configured */
@@ -2354,6 +2362,8 @@ static pj_status_t pjsua_regc_init(int acc_id)
acc->regc = NULL;
acc->contact.slen = 0;
acc->reg_mapped_addr.slen = 0;
+ acc->rfc5626_status = OUTBOUND_UNKNOWN;
+
return status;
}
@@ -2436,7 +2446,9 @@ static pj_status_t pjsua_regc_init(int acc_id)
}
/* If SIP outbound is used, add "Supported: outbound, path header" */
- if (acc->rfc5626_status == OUTBOUND_WANTED) {
+ if (acc->rfc5626_status == OUTBOUND_WANTED ||
+ acc->rfc5626_status == OUTBOUND_ACTIVE)
+ {
pjsip_hdr hdr_list;
pjsip_supported_hdr *hsup;