aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-08 01:11:25 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-11-08 01:11:25 +0000
commit1dd833fd025c0776df6435b3b005cbdf17060b1d (patch)
tree1d048648fbf3ededb9439c3ef62fffb3abac2d9c /channels
parent52f8eb0ac8db4eccf93d30f825802da41aeb2056 (diff)
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: http://svn.digium.com/svn/asterisk/branches/1.4@89097 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_sip.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index 72137a975..640a5ecdf 100644
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -942,6 +942,7 @@ static struct sip_pvt {
ast_group_t callgroup; /*!< Call group */
ast_group_t pickupgroup; /*!< Pickup group */
int lastinvite; /*!< Last Cseq of invite */
+ int lastnoninvite; /*!< Last Cseq of non-invite */
struct ast_flags flags[2]; /*!< SIP_ flags */
int timer_t1; /*!< SIP timer T1, ms rtt */
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)
initialize_initreq(p, &req);
+ p->lastnoninvite = 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_set_flag(&p->flags[0], SIP_NEEDDESTROY);
return 0;
- } else if (p->ocseq && (p->ocseq < seqno)) {
+ } else if (p->ocseq && (p->ocseq < seqno) && (seqno != p->lastnoninvite)) {
if (option_debug)
ast_log(LOG_DEBUG, "Ignoring out of order response %d (expecting %d)\n", seqno, p->ocseq);
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
respond appropriately */
ignore = TRUE;