diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-09-24 00:07:11 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-09-24 00:07:11 +0000 |
commit | e3f862fca94af0cb4812796055b18d2ba107b613 (patch) | |
tree | 1a49b7381865830cebba5a2b62a905d60c7f0483 /pjsip/src/pjsua-lib/pjsua_call.c | |
parent | 6ff54be10fd9c0ceff14e10f83a1d1af82ede83f (diff) |
Fixed several bugs in PJSUA-API:
- in some condition, when outgoing call fails, call count
incorrectly decremented to -1
- introduce account priority in pjsua_acc_config, and
improve the account searching for incoming calls
- pjsua will hangup call after sending transfer/REFER request.
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@737 74dad513-b988-da41-8d7b-12977e46ad98
Diffstat (limited to 'pjsip/src/pjsua-lib/pjsua_call.c')
-rw-r--r-- | pjsip/src/pjsua-lib/pjsua_call.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/pjsip/src/pjsua-lib/pjsua_call.c b/pjsip/src/pjsua-lib/pjsua_call.c index 35eee940..bb2ccd18 100644 --- a/pjsip/src/pjsua-lib/pjsua_call.c +++ b/pjsip/src/pjsua-lib/pjsua_call.c @@ -237,6 +237,9 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, call = &pjsua_var.calls[call_id]; + PJ_LOG(4,(THIS_FILE, "Making call with acc #%d to %.*s", acc_id, + (int)dest_uri->slen, dest_uri->ptr)); + /* Mark call start time. */ pj_gettimeofday(&call->start_time); @@ -316,6 +319,9 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, pjsua_process_msg_data( tdata, msg_data); + /* Must increment call counter now */ + ++pjsua_var.call_cnt; + /* Send initial INVITE: */ status = pjsip_inv_send_msg(inv, tdata); @@ -333,8 +339,6 @@ PJ_DEF(pj_status_t) pjsua_call_make_call( pjsua_acc_id acc_id, /* Done. */ - ++pjsua_var.call_cnt; - if (p_call_id) *p_call_id = call_id; @@ -462,7 +466,7 @@ pj_bool_t pjsua_call_on_incoming(pjsip_rx_data *rdata) * call. We need the account to find which contact URI to put for * the call. */ - acc_id = pjsua_acc_find_for_incoming(rdata); + acc_id = call->acc_id = pjsua_acc_find_for_incoming(rdata); /* Get suitable Contact header */ status = pjsua_acc_create_uas_contact(rdata->tp_info.pool, &contact, |