summaryrefslogtreecommitdiff
path: root/pjsip
diff options
context:
space:
mode:
authorLiong Sauw Ming <ming@teluu.com>2013-05-10 07:41:26 +0000
committerLiong Sauw Ming <ming@teluu.com>2013-05-10 07:41:26 +0000
commitefd2608508fe0b02565643172ab8f465d3e9b96e (patch)
tree5af2d166810d4fa8510662a4aa772f1f89c8b87f /pjsip
parent680178ea9a2dc41d4c43177e611ea8db9954f154 (diff)
Fixed #1666: Handle case when call unhold failed
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@4517 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip')
-rw-r--r--pjsip/src/pjsua-lib/pjsua_call.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c
index bb6cb561..7222bedc 100644
--- a/pjsip/src/pjsua-lib/pjsua_call.c
+++ b/pjsip/src/pjsua-lib/pjsua_call.c
@@ -4555,6 +4555,20 @@ static void pjsua_call_on_tsx_state_changed(pjsip_inv_session *inv,
PJ_LOG(3,(THIS_FILE, "Error putting call %d on hold (reason=%d)",
call->index, tsx->status_code));
}
+ } else if (tsx->role == PJSIP_ROLE_UAC &&
+ (call->opt.flag & PJSUA_CALL_UNHOLD) &&
+ tsx->state >= PJSIP_TSX_STATE_COMPLETED)
+ {
+ /* Monitor the status of call unhold request */
+ if (tsx->status_code/100 != 2 &&
+ (tsx->status_code!=401 && tsx->status_code!=407))
+ {
+ /* Call unhold failed */
+ call->opt.flag &= ~PJSUA_CALL_UNHOLD;
+ call->local_hold = PJ_TRUE;
+ PJ_LOG(3,(THIS_FILE, "Error releasing hold on call %d (reason=%d)",
+ call->index, tsx->status_code));
+ }
} else if (tsx->role==PJSIP_ROLE_UAS &&
tsx->state==PJSIP_TSX_STATE_TRYING &&
pjsip_method_cmp(&tsx->method, &pjsip_info_method)==0)