summaryrefslogtreecommitdiff
path: root/channels
diff options
context:
space:
mode:
authorMark Spencer <markster@digium.com>2005-04-27 15:06:23 +0000
committerMark Spencer <markster@digium.com>2005-04-27 15:06:23 +0000
commitb99c287ef6ab1873639787acf33369cc81614440 (patch)
treed98a5307998dafe56615c58bd46ca776dc54cb42 /channels
parentac639e80c3c51f9f66a34c66cc2703d3c7f63d77 (diff)
Fix lockup in register timeout
git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@5518 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'channels')
-rwxr-xr-xchannels/chan_sip.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c
index c4f15a223..1b291dc2d 100755
--- a/channels/chan_sip.c
+++ b/channels/chan_sip.c
@@ -1017,8 +1017,19 @@ static int __sip_ack(struct sip_pvt *p, int seqno, int resp, int sipmethod)
/* Pretend to ack all packets */
static int __sip_pretend_ack(struct sip_pvt *p)
{
+ char method[128]="";
+ struct sip_pkt *cur=NULL;
+ char *c;
while(p->packets) {
-
+ if (cur == p) {
+ ast_log(LOG_WARNING, "Have a packet that doesn't want to give up!\n");
+ return -1;
+ }
+ cur = p;
+ strncpy(method, p->packets->data, sizeof(method) - 1);
+ c = method;
+ while(*c && (*c < 33)) c++;
+ *c = '\0;;
__sip_ack(p, p->packets->seqno, (ast_test_flag(p->packets, FLAG_RESPONSE)), find_sip_method(p->packets->data));
}
return 0;