diff options
author | Benny Prijono <bennylp@teluu.com> | 2006-10-08 16:59:38 +0000 |
---|---|---|
committer | Benny Prijono <bennylp@teluu.com> | 2006-10-08 16:59:38 +0000 |
commit | 32777b9022208261137d361bb56bf19fef8e5c71 (patch) | |
tree | 786951afc12caff670a45074cfd175e272ffcd1b | |
parent | b4ab2081fc6025c995bac1067debb2bfbd439cba (diff) |
Modify sip_transaction.c to send ACK first before notifying upper layer about the failure (so that ACK is transmitted first before next INVITE is sent).
git-svn-id: http://svn.pjsip.org/repos/pjproject/trunk@756 74dad513-b988-da41-8d7b-12977e46ad98
-rw-r--r-- | pjsip/src/pjsip/sip_transaction.c | 16 |
1 files changed, 5 insertions, 11 deletions
diff --git a/pjsip/src/pjsip/sip_transaction.c b/pjsip/src/pjsip/sip_transaction.c index 82722332..faa9b2fe 100644 --- a/pjsip/src/pjsip/sip_transaction.c +++ b/pjsip/src/pjsip/sip_transaction.c @@ -2392,9 +2392,7 @@ static pj_status_t tsx_on_state_proceeding_uac(pjsip_transaction *tsx, /* Stop timer B. */ pjsip_endpt_cancel_timer( tsx->endpt, &tsx->timeout_timer ); - /* Generate ACK now (for INVITE) but send it later because - * dialog need to use last_tx. - */ + /* Generate and send ACK (for INVITE) */ if (tsx->method.id == PJSIP_INVITE_METHOD) { pj_status_t status; @@ -2403,6 +2401,10 @@ static pj_status_t tsx_on_state_proceeding_uac(pjsip_transaction *tsx, &ack_tdata); if (status != PJ_SUCCESS) return status; + + status = tsx_send_msg( tsx, ack_tdata); + if (status != PJ_SUCCESS) + return status; } /* Inform TU. */ @@ -2411,10 +2413,6 @@ static pj_status_t tsx_on_state_proceeding_uac(pjsip_transaction *tsx, /* Generate and send ACK for INVITE. */ if (tsx->method.id == PJSIP_INVITE_METHOD) { - pj_status_t status; - - status = tsx_send_msg( tsx, ack_tdata); - if (ack_tdata != tsx->last_tx) { pjsip_tx_data_dec_ref(tsx->last_tx); tsx->last_tx = ack_tdata; @@ -2426,10 +2424,6 @@ static pj_status_t tsx_on_state_proceeding_uac(pjsip_transaction *tsx, pjsip_tx_data_add_ref(ack_tdata); */ } - - if (status != PJ_SUCCESS) { - return status; - } } /* Start Timer D with TD/T4 timer if unreliable transport is used. */ |