[Asterisk-cvs] asterisk/channels chan_sip.c,1.453,1.454
markster at lists.digium.com
markster at lists.digium.com
Fri Jul 16 11:59:35 CDT 2004
- Previous message: [Asterisk-cvs] asterisk/channels chan_agent.c,1.77,1.78 chan_alsa.c,1.23,1.24 chan_h323.c,1.66,1.67 chan_iax.c,1.63,1.64 chan_iax2.c,1.170,1.171 chan_mgcp.c,1.58,1.59 chan_modem.c,1.24,1.25 chan_modem_bestdata.c,1.11,1.12 chan_nbs.c,1.9,1.10 chan_oss.c,1.28,1.29 chan_phone.c,1.31,1.32 chan_sip.c,1.452,1.453 chan_skinny.c,1.50,1.51 chan_vofr.c,1.17,1.18 chan_vpb.c,1.31,1.32 chan_zap.c,1.294,1.295 iax2-provision.c,1.4,1.5
- Next message: [Asterisk-cvs] asterisk asterisk.c,1.103,1.104
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
Update of /usr/cvsroot/asterisk/channels
In directory localhost.localdomain:/tmp/cvs-serv11660/channels
Modified Files:
chan_sip.c
Log Message:
Only apply acking when method matches, too, when not acking a response
Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.453
retrieving revision 1.454
diff -u -d -r1.453 -r1.454
--- chan_sip.c 16 Jul 2004 04:40:54 -0000 1.453
+++ chan_sip.c 16 Jul 2004 15:45:37 -0000 1.454
@@ -783,14 +783,18 @@
}
/*--- __sip_ack: Acknowledges receipt of a packet and stops retransmission ---*/
-static int __sip_ack(struct sip_pvt *p, int seqno, int resp)
+static int __sip_ack(struct sip_pvt *p, int seqno, int resp, const char *msg)
{
struct sip_pkt *cur, *prev = NULL;
int res = -1;
int resetinvite = 0;
+ /* Just in case... */
+ if (!msg) msg = "___NEVER___";
cur = p->packets;
while(cur) {
- if ((cur->seqno == seqno) && ((cur->flags & FLAG_RESPONSE) == resp)) {
+ if ((cur->seqno == seqno) && ((cur->flags & FLAG_RESPONSE) == resp) &&
+ ((cur->flags & FLAG_RESPONSE) ||
+ (!strncasecmp(msg, cur->data, strlen(msg)) && (cur->data[strlen(msg)] < 33)))) {
if (!resp && (seqno == p->pendinginvite)) {
ast_log(LOG_DEBUG, "Acked pending invite %d\n", p->pendinginvite);
p->pendinginvite = 0;
@@ -815,13 +819,15 @@
}
/*--- __sip_semi_ack: Acks receipt of packet, keep it around (used for provisional responses) ---*/
-static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp)
+static int __sip_semi_ack(struct sip_pvt *p, int seqno, int resp, const char *msg)
{
struct sip_pkt *cur;
int res = -1;
cur = p->packets;
while(cur) {
- if ((cur->seqno == seqno) && ((cur->flags & FLAG_RESPONSE) == resp)) {
+ if ((cur->seqno == seqno) && ((cur->flags & FLAG_RESPONSE) == resp) &&
+ ((cur->flags & FLAG_RESPONSE) ||
+ (!strncasecmp(msg, cur->data, strlen(msg)) && (cur->data[strlen(msg)] < 33)))) {
/* this is our baby */
if (cur->retransid > -1)
ast_sched_del(sched, cur->retransid);
@@ -6356,9 +6362,9 @@
owner->hangupcause = hangup_sip2cause(resp);
/* Acknowledge whatever it is destined for */
if ((resp >= 100) && (resp <= 199))
- __sip_semi_ack(p, seqno, 0);
+ __sip_semi_ack(p, seqno, 0, msg);
else
- __sip_ack(p, seqno, 0);
+ __sip_ack(p, seqno, 0, msg);
/* Get their tag if we haven't already */
to = get_header(req, "To");
to = strstr(to, "tag=");
@@ -7318,7 +7324,7 @@
/* Make sure we don't ignore this */
if (seqno == p->pendinginvite) {
p->pendinginvite = 0;
- __sip_ack(p, seqno, FLAG_RESPONSE);
+ __sip_ack(p, seqno, FLAG_RESPONSE, NULL);
if (!ast_strlen_zero(get_header(req, "Content-Type"))) {
if (process_sdp(p, req))
return -1;
- Previous message: [Asterisk-cvs] asterisk/channels chan_agent.c,1.77,1.78 chan_alsa.c,1.23,1.24 chan_h323.c,1.66,1.67 chan_iax.c,1.63,1.64 chan_iax2.c,1.170,1.171 chan_mgcp.c,1.58,1.59 chan_modem.c,1.24,1.25 chan_modem_bestdata.c,1.11,1.12 chan_nbs.c,1.9,1.10 chan_oss.c,1.28,1.29 chan_phone.c,1.31,1.32 chan_sip.c,1.452,1.453 chan_skinny.c,1.50,1.51 chan_vofr.c,1.17,1.18 chan_vpb.c,1.31,1.32 chan_zap.c,1.294,1.295 iax2-provision.c,1.4,1.5
- Next message: [Asterisk-cvs] asterisk asterisk.c,1.103,1.104
- Messages sorted by:
[ date ]
[ thread ]
[ subject ]
[ author ]
More information about the svn-commits
mailing list