p->initid = -1;
}
+ /* RFC3261 says we must treat every 1xx response (but not 100)
+ that we don't recognize as if it was 183.
+ */
+ if ((resp > 100) &&
+ (resp < 200) &&
+ (resp != 180) &&
+ (resp != 183))
+ resp = 183;
+
switch (resp) {
case 100: /* Trying */
if (!ast_test_flag(req, SIP_PKT_IGNORE))
sip_cancel_destroy(p);
- /* must call check_pendings before setting CAN_BYE, so that
- if PENDINGBYE is set it will know to send CANCEL instead */
check_pendings(p);
- ast_set_flag(&p->flags[0], SIP_CAN_BYE);
break;
case 180: /* 180 Ringing */
if (!ast_test_flag(req, SIP_PKT_IGNORE))
ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
}
}
- /* must call check_pendings before setting CAN_BYE, so that
- if PENDINGBYE is set it will know to send CANCEL instead */
- check_pendings(p);
ast_set_flag(&p->flags[0], SIP_CAN_BYE);
+ check_pendings(p);
break;
case 183: /* Session progress */
if (!ast_test_flag(req, SIP_PKT_IGNORE))
ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
}
}
- /* must call check_pendings before setting CAN_BYE, so that
- if PENDINGBYE is set it will know to send CANCEL instead */
- check_pendings(p);
ast_set_flag(&p->flags[0], SIP_CAN_BYE);
+ check_pendings(p);
break;
case 200: /* 200 OK on invite - someone's answering our call */
if (!ast_test_flag(req, SIP_PKT_IGNORE))
}
/* If I understand this right, the branch is different for a non-200 ACK only */
transmit_request(p, SIP_ACK, seqno, XMIT_UNRELIABLE, TRUE);
+ ast_set_flag(&p->flags[0], SIP_CAN_BYE);
check_pendings(p);
break;
case 407: /* Proxy authentication */