summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsua-lib/pjsua_core.c
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2006-08-20 09:12:19 +0000
committerBenny Prijono <bennylp@teluu.com>2006-08-20 09:12:19 +0000
commitdc216fbe98f8335de253cf671528b6e0dc2cb509 (patch)
tree2b183cde7e288aa5c0fdc6a930e25e25d347c127 /pjsip/src/pjsua-lib/pjsua_core.c
parent540278de72f88da8853d86dc3b655fe9bb3013b5 (diff)
Added initial "norefersub" (RFC 4488) implementation in PJSUA-LIB, and also properly register all supported SIP method, accepted content type, and supported extensions to endpoint.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@688 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_core.c')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_core.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_core.c b/pjsip/src/pjsua-lib/pjsua_core.c
index c9bd2482..a0a87fbe 100644
--- a/pjsip/src/pjsua-lib/pjsua_core.c
+++ b/pjsip/src/pjsua-lib/pjsua_core.c
@@ -334,12 +334,6 @@ PJ_DEF(pj_status_t) pjsua_reconfigure_logging(const pjsua_logging_config *cfg)
}
}
- /* Unregister OPTIONS handler if it's previously registered */
- if (pjsua_options_handler.id >= 0) {
- pjsip_endpt_unregister_module(pjsua_var.endpt, &pjsua_options_handler);
- pjsua_options_handler.id = -1;
- }
-
/* Unregister msg logging if it's previously registered */
if (pjsua_msg_logger.id >= 0) {
pjsip_endpt_unregister_module(pjsua_var.endpt, &pjsua_msg_logger);
@@ -350,9 +344,6 @@ PJ_DEF(pj_status_t) pjsua_reconfigure_logging(const pjsua_logging_config *cfg)
if (pjsua_var.log_cfg.msg_logging)
pjsip_endpt_register_module(pjsua_var.endpt, &pjsua_msg_logger);
- /* Register OPTIONS handler */
- pjsip_endpt_register_module(pjsua_var.endpt, &pjsua_options_handler);
-
return PJ_SUCCESS;
}
@@ -443,6 +434,7 @@ PJ_DEF(pj_status_t) pjsua_init( const pjsua_config *ua_cfg,
{
pjsua_config default_cfg;
pjsua_media_config default_media_cfg;
+ const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
pj_status_t status;
@@ -541,6 +533,13 @@ PJ_DEF(pj_status_t) pjsua_init( const pjsua_config *ua_cfg,
if (status != PJ_SUCCESS)
goto on_error;
+ /* Register OPTIONS handler */
+ pjsip_endpt_register_module(pjsua_var.endpt, &pjsua_options_handler);
+
+ /* Add OPTIONS in Allow header */
+ pjsip_endpt_add_capability(pjsua_var.endpt, NULL, PJSIP_H_ALLOW,
+ NULL, 1, &STR_OPTIONS);
+
/* Start worker thread if needed. */
if (pjsua_var.ua_cfg.thread_cnt) {
unsigned i;