Skip to content

Commit

Permalink
Terminate client transaction upon transport error
Browse files Browse the repository at this point in the history
  • Loading branch information
trengginas committed Dec 19, 2023
1 parent ca2e450 commit 035bad7
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions pjsip/src/pjsip/sip_transaction.c
Original file line number Diff line number Diff line change
Expand Up @@ -2187,11 +2187,12 @@ static void send_msg_callback( pjsip_send_state *send_state,
else
sc = PJSIP_SC_TSX_TRANSPORT_ERROR;

/* We terminate the transaction for 502 error. For 503,
* we will retry it.
/* For client transaction, we terminate the transaction.
* Otherwise, we terminate the transaction for 502 error.
* For 503, we will retry it.
* See https://github.com/pjsip/pjproject/pull/3805
*/
if (sc == PJSIP_SC_BAD_GATEWAY &&
if ((tsx->role == PJSIP_ROLE_UAC || sc == PJSIP_SC_BAD_GATEWAY) &&
tsx->state != PJSIP_TSX_STATE_TERMINATED &&
tsx->state != PJSIP_TSX_STATE_DESTROYED)
{
Expand Down

0 comments on commit 035bad7

Please sign in to comment.