Add support for allowing one outgoing transaction. This means if a response comes back out of order chan_sip will still handle it. I dream of a chan_sip with real transaction support.

(closes issue #10946)
Reported by: flefoll
(closes issue #10915)
Reported by: ramonpeek
(closes issue #9567)
Reported by: atca_pres


git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.4@89097 65c4cc65-6c06-0410-ace0-fbb531ad65f3
1.4
Joshua Colp 18 years ago
parent f1309f2c3f
commit 53fd91490e

@ -942,6 +942,7 @@ static struct sip_pvt {
ast_group_t callgroup; /*!< Call group */ ast_group_t callgroup; /*!< Call group */
ast_group_t pickupgroup; /*!< Pickup group */ ast_group_t pickupgroup; /*!< Pickup group */
int lastinvite; /*!< Last Cseq of invite */ int lastinvite; /*!< Last Cseq of invite */
int lastnoninvite; /*!< Last Cseq of non-invite */
struct ast_flags flags[2]; /*!< SIP_ flags */ struct ast_flags flags[2]; /*!< SIP_ flags */
int timer_t1; /*!< SIP timer T1, ms rtt */ int timer_t1; /*!< SIP timer T1, ms rtt */
unsigned int sipoptions; /*!< Supported SIP options on the other end */ unsigned int sipoptions; /*!< Supported SIP options on the other end */
@ -7265,6 +7266,8 @@ static int transmit_notify_with_sipfrag(struct sip_pvt *p, int cseq, char *messa
if (!p->initreq.headers) if (!p->initreq.headers)
initialize_initreq(p, &req); initialize_initreq(p, &req);
p->lastnoninvite = p->ocseq;
return send_request(p, &req, XMIT_RELIABLE, p->ocseq); return send_request(p, &req, XMIT_RELIABLE, p->ocseq);
} }
@ -14983,11 +14986,11 @@ static int handle_request(struct sip_pvt *p, struct sip_request *req, struct soc
ast_log(LOG_DEBUG, "That's odd... Got a response on a call we dont know about. Cseq %d Cmd %s\n", seqno, cmd); ast_log(LOG_DEBUG, "That's odd... Got a response on a call we dont know about. Cseq %d Cmd %s\n", seqno, cmd);
ast_set_flag(&p->flags[0], SIP_NEEDDESTROY); ast_set_flag(&p->flags[0], SIP_NEEDDESTROY);
return 0; return 0;
} else if (p->ocseq && (p->ocseq < seqno)) { } else if (p->ocseq && (p->ocseq < seqno) && (seqno != p->lastnoninvite)) {
if (option_debug) if (option_debug)
ast_log(LOG_DEBUG, "Ignoring out of order response %d (expecting %d)\n", seqno, p->ocseq); ast_log(LOG_DEBUG, "Ignoring out of order response %d (expecting %d)\n", seqno, p->ocseq);
return -1; return -1;
} else if (p->ocseq && (p->ocseq != seqno)) { } else if (p->ocseq && (p->ocseq != seqno) && (seqno != p->lastnoninvite)) {
/* ignore means "don't do anything with it" but still have to /* ignore means "don't do anything with it" but still have to
respond appropriately */ respond appropriately */
ignore = TRUE; ignore = TRUE;

Loading…
Cancel
Save