summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib/pjsua_acc.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-11-11 21:25:55 +0000
committerBenny Prijono <bennylp@teluu.com>2006-11-11 21:25:55 +0000
commit9115df1d57547f0d3747ddeb048e9ac87c0b9292 (patch)
tree98492d5270a02a683fb772aa15d93b0c3428c349 /pjsip/src/pjsua-lib/pjsua_acc.c
parent83a6cef9411b0d748450fb8e955ec8397979e252 (diff)
Add pjsip_regc_add_headers() APi to set headers to be added
to the REGISTER request. This solves the problem where headers registered in the initial REGISTER request (such as User-Agent header) are not sent in subsequent reregistration request. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@799 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_acc.c')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_acc.c18
1 files changed, 17 insertions, 1 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_acc.c b/pjsip/src/pjsua-lib/pjsua_acc.c
index 10cc2367..fd71f993 100644
--- a/pjsip/src/pjsua-lib/pjsua_acc.c
+++ b/pjsip/src/pjsua-lib/pjsua_acc.c
@@ -550,6 +550,22 @@ static pj_status_t pjsua_regc_init(int acc_id)
pjsip_regc_set_route_set( acc->regc, &acc->route_set );
}
+ /* Add other request headers. */
+ if (pjsua_var.ua_cfg.user_agent.slen) {
+ pjsip_hdr hdr_list;
+ const pj_str_t STR_USER_AGENT = { "User-Agent", 10 };
+ pjsip_generic_string_hdr *h;
+
+ pool = pj_pool_create_on_buf(NULL, contact_buf, sizeof(contact_buf));
+ pj_list_init(&hdr_list);
+
+ h = pjsip_generic_string_hdr_create(pool, &STR_USER_AGENT,
+ &pjsua_var.ua_cfg.user_agent);
+ pj_list_push_back(&hdr_list, (pjsip_hdr*)h);
+
+ pjsip_regc_add_headers(acc->regc, &hdr_list);
+ }
+
return PJ_SUCCESS;
}
@@ -596,7 +612,7 @@ PJ_DEF(pj_status_t) pjsua_acc_set_registration( pjsua_acc_id acc_id,
}
if (status == PJ_SUCCESS) {
- pjsua_process_msg_data(tdata, NULL);
+ //pjsua_process_msg_data(tdata, NULL);
status = pjsip_regc_send( pjsua_var.acc[acc_id].regc, tdata );
}