summaryrefslogtreecommitdiff
path: root/pjsip/src/pjsip-ua
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2009-06-04 22:16:47 +0000
committerBenny Prijono <bennylp@teluu.com>2009-06-04 22:16:47 +0000
commit2d27c6a42c01019e542aef023000901384388574 (patch)
treea322c6c13b467d3d5e0ac6a9b21e6593c17b35a1 /pjsip/src/pjsip-ua
parent7aa5e9c1f82139cb7065c95c7c2595bc511589c6 (diff)
Ticket #860:
- will send SUBSCRIBE to refresh REFER subscription (not REFER!), only when required (such as when call transfer is running for longer than REFER subscription expiration, hence need to be refreshed) - replaced hardcoded REFER subscription duration (600s) with a macro, {{{PJSIP_XFER_EXPIRES}}}. - when NOTIFY with "200 OK" sipfrag body is received and subscription state is not terminated, send SUBSCRIBE with Expires=0 to terminate the REFER subscription - for transferee, terminate the subscription in CONNECTING state and not in CONFIRMED state. Terminating the subscription in CONFIRMED state causes redundant NOTIFYs with "200 OK" sipfrag body to be sent, one with active subscription and another with terminated state. git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@2750 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsip-ua')
-rw-r--r--pjsip/src/pjsip-ua/sip_xfer.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/pjsip/src/pjsip-ua/sip_xfer.c b/pjsip/src/pjsip-ua/sip_xfer.c
index 30351425..eb932655 100644
--- a/pjsip/src/pjsip-ua/sip_xfer.c
+++ b/pjsip/src/pjsip-ua/sip_xfer.c
@@ -28,6 +28,11 @@
#include <pj/pool.h>
#include <pj/string.h>
+/* Subscription expiration */
+#ifndef PJSIP_XFER_EXPIRES
+# define PJSIP_XFER_EXPIRES 600
+#endif
+
/*
* Refer module (mod-refer)
@@ -154,7 +159,8 @@ PJ_DEF(pj_status_t) pjsip_xfer_init_module(pjsip_endpoint *endpt)
if (status != PJ_SUCCESS)
return status;
- status = pjsip_evsub_register_pkg( &mod_xfer, &STR_REFER, 300, 1, &accept);
+ status = pjsip_evsub_register_pkg(&mod_xfer, &STR_REFER,
+ PJSIP_XFER_EXPIRES, 1, &accept);
if (status != PJ_SUCCESS)
return status;
@@ -586,7 +592,7 @@ static void xfer_on_evsub_client_refresh(pjsip_evsub *sub)
pj_status_t status;
pjsip_tx_data *tdata;
- status = pjsip_xfer_initiate(sub, NULL, &tdata);
+ status = pjsip_evsub_initiate(sub, NULL, PJSIP_XFER_EXPIRES, &tdata);
if (status == PJ_SUCCESS)
pjsip_xfer_send_request(sub, tdata);
}