diff options
author | Benny Prijono <bennylp@teluu.com> | 2011-05-19 04:36:01 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2011-05-19 04:36:01 +0000 |
commit | f8901ea61be686ac4f76e86aa6ec550d11388ffb (patch) | |
tree | 8a179a2d1e83763081527973e296430dad86ff81 /pjsip/src/pjsua-lib | |
parent | dc90133cf657d9bb8e043f19a44aac477b3c7bcb (diff) |
Fixed #1259: Option to use of 100rel in UAS if UAC supports it (thanks Marcus Froeschl for the suggestion)
git-svn-id: http://svn.pjsip.org/repos/pjproject/branches/1.x@3570 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 8c9f16db..b58fd758 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -499,7 +499,7 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, /* Create the INVITE session: */ options |= PJSIP_INV_SUPPORT_100REL; - if (acc->cfg.require_100rel) + if (acc->cfg.require_100rel == PJSUA_100REL_MANDATORY) options |= PJSIP_INV_REQUIRE_100REL; if (acc->cfg.use_timer != PJSUA_SIP_TIMER_INACTIVE) { options |= PJSIP_INV_SUPPORT_TIMER; @@ -848,7 +848,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) /* Verify that we can handle the request. */ options |= PJSIP_INV_SUPPORT_100REL; options |= PJSIP_INV_SUPPORT_TIMER; - if (pjsua_var.acc[acc_id].cfg.require_100rel) + if (pjsua_var.acc[acc_id].cfg.require_100rel == PJSUA_100REL_MANDATORY) options |= PJSIP_INV_REQUIRE_100REL; if (pjsua_var.media_cfg.enable_ice) options |= PJSIP_INV_SUPPORT_ICE; @@ -931,6 +931,19 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) options &= ~(PJSIP_INV_SUPPORT_TIMER); } + /* If 100rel is optional and UAC supports it, use it. */ + if ((options & PJSIP_INV_REQUIRE_100REL)==0 && + pjsua_var.acc[acc_id].cfg.require_100rel == PJSUA_100REL_OPTIONAL) + { + const pj_str_t token = { "100rel", 6}; + pjsip_dialog_cap_status cap_status; + + cap_status = pjsip_dlg_remote_has_cap(dlg, PJSIP_H_SUPPORTED, NULL, + &token); + if (cap_status == PJSIP_DIALOG_CAP_SUPPORTED) + options |= PJSIP_INV_REQUIRE_100REL; + } + /* Create invite session: */ status = pjsip_inv_create_uas( dlg, rdata, answer, options, &inv); if (status != PJ_SUCCESS) { |