summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorBenny Prijono <bennylp@teluu.com>2008-04-08 23:33:15 +0000
committerBenny Prijono <bennylp@teluu.com>2008-04-08 23:33:15 +0000
commit02ca90e766f49bf2c03e784669220f838eb19805 (patch)
treeba4c0c0e2c72a2399d825b87c4ee2b3ea58d028a /pjsip
parent17c11e321f7efd4de84ba84be6e7d12394162abd (diff)
As per list report, changed the default response to incoming REFER from 200 to 202 as some gateways do not like this. Thanks Pedro Sanchez for the report
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@1912 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/include/pjsua-lib/pjsua.h2
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c15
2 files changed, 9 insertions, 8 deletions
diff --git a/pjsip/include/pjsua-lib/pjsua.h b/pjsip/include/pjsua-lib/pjsua.h
index 4890a87b..45515a9b 100644
--- a/pjsip/include/pjsua-lib/pjsua.h
+++ b/pjsip/include/pjsua-lib/pjsua.h
@@ -660,7 +660,7 @@ typedef struct pjsua_callback
/**
* Notify application on call being transfered (i.e. REFER is received).
* Application can decide to accept/reject transfer request
- * by setting the code (default is 200). When this callback
+ * by setting the code (default is 202). When this callback
* is not defined, the default behavior is to accept the
* transfer.
*
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index 58330988..9e88a360 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -3005,14 +3005,14 @@ static void on_call_transfered( pjsip_inv_session *inv,
NULL);
/* Notify callback */
- code = PJSIP_SC_OK;
+ code = PJSIP_SC_ACCEPTED;
if (pjsua_var.ua_cfg.cb.on_call_transfer_request)
(*pjsua_var.ua_cfg.cb.on_call_transfer_request)(existing_call->index,
&refer_to->hvalue,
&code);
if (code < 200)
- code = PJSIP_SC_OK;
+ code = PJSIP_SC_ACCEPTED;
if (code >= 300) {
/* Application rejects call transfer request */
pjsip_dlg_respond( inv->dlg, rdata, code, NULL, NULL, NULL);
@@ -3027,15 +3027,16 @@ static void on_call_transfered( pjsip_inv_session *inv,
if (no_refer_sub) {
/*
- * Always answer with 200.
+ * Always answer with 2xx.
*/
pjsip_tx_data *tdata;
const pj_str_t str_false = { "false", 5};
pjsip_hdr *hdr;
- status = pjsip_dlg_create_response(inv->dlg, rdata, 200, NULL, &tdata);
+ status = pjsip_dlg_create_response(inv->dlg, rdata, code, NULL,
+ &tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create 200 response to REFER",
+ pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER",
status);
return;
}
@@ -3051,7 +3052,7 @@ static void on_call_transfered( pjsip_inv_session *inv,
status = pjsip_dlg_send_response(inv->dlg, pjsip_rdata_get_tsx(rdata),
tdata);
if (status != PJ_SUCCESS) {
- pjsua_perror(THIS_FILE, "Unable to create 200 response to REFER",
+ pjsua_perror(THIS_FILE, "Unable to create 2xx response to REFER",
status);
return;
}
@@ -3093,7 +3094,7 @@ static void on_call_transfered( pjsip_inv_session *inv,
}
- /* Accept the REFER request, send 200 (OK). */
+ /* Accept the REFER request, send 2xx. */
pjsip_xfer_accept(sub, rdata, code, &hdr_list);
/* Create initial NOTIFY request */