[Asterisk-Dev] chan_sip.c patch

Sergey S. Stasyuk stas at onlineua.net
Tue Jul 8 11:39:27 MST 2003


Hi all!

I have discovered some troubles with chan_sip.c - it identifies my ip
correctly, but stores illegal - debug lead me to this small patch.
I use gentoo linux, updates it rather often. Maybe it is problem with my
glibc, but in any way this patch looks more correct. :-)

Best regards,
Sergey Stasyuk
-------------- next part --------------
--- chan_sip.c.old	2003-07-08 20:47:57.000000000 +0300
+++ chan_sip.c	2003-07-08 21:18:49.000000000 +0300
@@ -456,7 +456,7 @@
 	pkt->seqno = seqno;
 	pkt->resp = resp;
 	/* Schedule retransmission */
-	pkt->retransid = ast_sched_add(sched, 1000, retrans_pkt, pkt);
+	pkt->retransid = ast_sched_add(sched, DEFAULT_RETRANS, retrans_pkt, pkt);
 	pkt->next = p->packets;
 	p->packets = pkt;
 	__sip_xmit(pkt->owner, pkt->data, pkt->packetlen);
@@ -5509,7 +5509,7 @@
 	}
 	
 	if (ntohl(bindaddr.sin_addr.s_addr)) {
-		memcpy(&__ourip, &bindaddr, sizeof(__ourip));
+		memcpy(&__ourip, &bindaddr.sin_addr, sizeof(__ourip));
 	} else {
 		hp = gethostbyname(ourhost);
 		if (!hp) {


More information about the asterisk-dev mailing list