diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-11-11 16:16:04 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-11-11 16:16:04 +0000 |
commit | e6a5b770072500cf89a9cc10e4b99a972a6787b8 (patch) | |
tree | ec336215fc83344cec58d01dd30a74d7f6054e67 /pjsip/src/pjsip-ua/sip_inv.c | |
parent | e4fa39f3acb0b969dd1f952e81b33b2dff671002 (diff) |
Attended call transfer implementation. The changes involves:
- Added support for SIP Replaces extension (RFC 3891)
- Added pjsua_call_xfer_replaces() to perform attended call
transfer.
- PJSUA checks and process Replaces header in incoming calls
- Added pjsip_ua_find_dialog() API.
- Added pjsip_endpt_has_capability() API.
- Added pjsip_endpt_send_response2() API.
- etc.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@797 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-ua/sip_inv.c')
-rw-r--r-- | pjsip/src/pjsip-ua/sip_inv.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/pjsip/src/pjsip-ua/sip_inv.c b/pjsip/src/pjsip-ua/sip_inv.c index 97507458..8c6b4ccd 100644 --- a/pjsip/src/pjsip-ua/sip_inv.c +++ b/pjsip/src/pjsip-ua/sip_inv.c @@ -386,8 +386,10 @@ PJ_DEF(pj_status_t) pjsip_inv_usage_init( pjsip_endpoint *endpt, /* Register the module. */ status = pjsip_endpt_register_module(endpt, &mod_inv.mod); + if (status != PJ_SUCCESS) + return status; - return status; + return PJ_SUCCESS; } /* @@ -680,8 +682,9 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata, req_hdr = pjsip_msg_find_hdr(msg, PJSIP_H_REQUIRE, NULL); if (req_hdr) { unsigned i; - pj_str_t STR_100REL = { "100rel", 6}; - pj_str_t STR_TIMER = { "timer", 5 }; + const pj_str_t STR_100REL = { "100rel", 6}; + const pj_str_t STR_TIMER = { "timer", 5 }; + const pj_str_t STR_REPLACES = { "replaces", 8 }; unsigned unsupp_cnt = 0; pj_str_t unsupp_tags[PJSIP_GENERIC_ARRAY_MAX_COUNT]; @@ -696,6 +699,14 @@ PJ_DEF(pj_status_t) pjsip_inv_verify_request(pjsip_rx_data *rdata, { rem_option |= PJSIP_INV_REQUIRE_TIMER; + } else if (pj_stricmp(&req_hdr->values[i], &STR_REPLACES)==0) { + pj_bool_t supp; + + supp = pjsip_endpt_has_capability(endpt, PJSIP_H_SUPPORTED, + NULL, &STR_REPLACES); + if (!supp) + unsupp_tags[unsupp_cnt++] = req_hdr->values[i]; + } else { /* Unknown/unsupported extension tag! */ unsupp_tags[unsupp_cnt++] = req_hdr->values[i]; |