summaryrefslogtreecommitdiff
path: root/pjsip/src
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2011-06-22 08:00:20 +0000
committerBenny Prijono <bennylp@teluu.com>2011-06-22 08:00:20 +0000
commitce6bdc7415d99992775a3c21126f3a3a7907cdda (patch)
treeb593f826d9a8869247206d28a99bc098e40d801d /pjsip/src
parent8b7ab1985b045d9002487bd12817cac0ee7b8c2b (diff)
Closed #1313 (Account option to disable registration when account is added) and closed #1314 (New callback to notify application when registration or unregistration has been initiated). Thanks Tony Jago Million for the patch
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3594 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c11
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c1
2 files changed, 9 insertions, 3 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 9cd93254..5398928f 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -452,9 +452,10 @@ PJ_DEF(pj_status_t) pjsua_acc_add( const pjsua_acc_config *cfg,
(int)cfg->id.slen, cfg->id.ptr, id));
/* If accounts has registration enabled, start registration */
- if (pjsua_var.acc[id].cfg.reg_uri.slen)
- pjsua_acc_set_registration(id, PJ_TRUE);
- else {
+ if (pjsua_var.acc[id].cfg.reg_uri.slen) {
+ if (pjsua_var.acc[id].cfg.register_on_acc_add)
+ pjsua_acc_set_registration(id, PJ_TRUE);
+ } else {
/* Otherwise subscribe to MWI, if it's enabled */
if (pjsua_var.acc[id].cfg.mwi_enabled)
pjsua_start_mwi(&pjsua_var.acc[id]);
@@ -2009,6 +2010,10 @@ PJ_DEF(pj_status_t) pjsua_acc_set_registration( pjsua_acc_id acc_id,
pjsip_regc_get_info(pjsua_var.acc[acc_id].regc, &reg_info);
pjsua_var.acc[acc_id].auto_rereg.reg_tp = reg_info.transport;
+
+ if (pjsua_var.ua_cfg.cb.on_reg_started) {
+ (*pjsua_var.ua_cfg.cb.on_reg_started)(acc_id, renew);
+ }
}
if (status != PJ_SUCCESS) {
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index 362ed0cd..393d3d1a 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -193,6 +193,7 @@ PJ_DEF(void) pjsua_acc_config_default(pjsua_acc_config *cfg)
pj_list_init(&cfg->reg_hdr_list);
pj_list_init(&cfg->sub_hdr_list);
cfg->call_hold_type = PJSUA_CALL_HOLD_TYPE_DEFAULT;
+ cfg->register_on_acc_add = PJ_TRUE;
}
PJ_DEF(void) pjsua_buddy_config_default(pjsua_buddy_config *cfg)