[asterisk-commits] branch 1.2 r28896 - /branches/1.2/channels/chan_iax2.c

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 19 17:55:32 MST 2006


Author: kpfleming
Date: Fri May 19 19:55:31 2006
New Revision: 28896

URL: http://svn.digium.com/view/asterisk?rev=28896&view=rev
Log:
don't try to predict where the compiler will place things on the stack... put them in the right place explicitly (issues #7029 and #7100, maybe others)

Modified:
    branches/1.2/channels/chan_iax2.c

Modified: branches/1.2/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/branches/1.2/channels/chan_iax2.c?rev=28896&r1=28895&r2=28896&view=diff
==============================================================================
--- branches/1.2/channels/chan_iax2.c (original)
+++ branches/1.2/channels/chan_iax2.c Fri May 19 19:55:31 2006
@@ -6285,8 +6285,7 @@
 	struct ast_iax2_meta_trunk_hdr *mth;
 	struct ast_iax2_meta_trunk_entry *mte;
 	struct ast_iax2_meta_trunk_mini *mtm;
-	char dblbuf[4096];	/* Declaration of dblbuf must immediately *preceed* fr  on the stack */
-	struct iax_frame fr;
+	struct iax_frame *fr;
 	struct iax_frame *cur;
 	char iabuf[INET_ADDRSTRLEN];
 	struct ast_frame f;
@@ -6308,8 +6307,9 @@
 	struct ast_codec_pref pref;
 	char *using_prefs = "mine";
 
-	dblbuf[0] = 0;	/* Keep GCC from whining */
-	fr.callno = 0;
+	/* allocate an iax_frame with 4096 bytes of data buffer */
+	fr = alloca(sizeof(*fr) + 4096);
+	fr->callno = 0;
 	
 	res = recvfrom(fd, buf, sizeof(buf), 0,(struct sockaddr *) &sin, &len);
 	if (res < 0) {
@@ -6329,7 +6329,7 @@
 	}
 	if ((vh->zeros == 0) && (ntohs(vh->callno) & 0x8000)) {
 		/* This is a video frame, get call number */
-		fr.callno = find_callno(ntohs(vh->callno) & ~0x8000, dcallno, &sin, new, 1, fd);
+		fr->callno = find_callno(ntohs(vh->callno) & ~0x8000, dcallno, &sin, new, 1, fd);
 		minivid = 1;
 	} else if (meta->zeros == 0) {
 		unsigned char metatype;
@@ -6380,16 +6380,16 @@
 				/* Stop if we don't have enough data */
 				if (len > res)
 					break;
-				fr.callno = find_callno(callno & ~IAX_FLAG_FULL, 0, &sin, NEW_PREVENT, 1, fd);
-				if (fr.callno) {
-					ast_mutex_lock(&iaxsl[fr.callno]);
+				fr->callno = find_callno(callno & ~IAX_FLAG_FULL, 0, &sin, NEW_PREVENT, 1, fd);
+				if (fr->callno) {
+					ast_mutex_lock(&iaxsl[fr->callno]);
 					/* If it's a valid call, deliver the contents.  If not, we
 					   drop it, since we don't have a scallno to use for an INVAL */
 					/* Process as a mini frame */
 					f.frametype = AST_FRAME_VOICE;
-					if (iaxs[fr.callno]) {
-						if (iaxs[fr.callno]->voiceformat > 0) {
-							f.subclass = iaxs[fr.callno]->voiceformat;
+					if (iaxs[fr->callno]) {
+						if (iaxs[fr->callno]->voiceformat > 0) {
+							f.subclass = iaxs[fr->callno]->voiceformat;
 							f.datalen = len;
 							if (f.datalen >= 0) {
 								if (f.datalen)
@@ -6397,11 +6397,11 @@
 								else
 									f.data = NULL;
 								if(trunked_ts) {
-									fr.ts = (iaxs[fr.callno]->last & 0xFFFF0000L) | (trunked_ts & 0xffff);
+									fr->ts = (iaxs[fr->callno]->last & 0xFFFF0000L) | (trunked_ts & 0xffff);
 								} else
-									fr.ts = fix_peerts(&rxtrunktime, fr.callno, ts);
+									fr->ts = fix_peerts(&rxtrunktime, fr->callno, ts);
 								/* Don't pass any packets until we're started */
-								if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
+								if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
 									/* Common things */
 									f.src = "IAX2";
 									f.mallocd = 0;
@@ -6410,28 +6410,28 @@
 										f.samples = ast_codec_get_samples(&f);
 									else
 										f.samples = 0;
-									fr.outoforder = 0;
-									iax_frame_wrap(&fr, &f);
+									fr->outoforder = 0;
+									iax_frame_wrap(fr, &f);
 #ifdef BRIDGE_OPTIMIZATION
-									if (iaxs[fr.callno]->bridgecallno) {
+									if (iaxs[fr->callno]->bridgecallno) {
 										forward_delivery(&fr);
 									} else {
 										duped_fr = iaxfrdup2(&fr);
 										if (duped_fr) {
-											schedule_delivery(duped_fr, updatehistory, 1, &fr.ts);
+											schedule_delivery(duped_fr, updatehistory, 1, &fr->ts);
 										}
 									}
 #else
-									duped_fr = iaxfrdup2(&fr);
+									duped_fr = iaxfrdup2(fr);
 									if (duped_fr) {
-										schedule_delivery(duped_fr, updatehistory, 1, &fr.ts);
+										schedule_delivery(duped_fr, updatehistory, 1, &fr->ts);
 									}
 #endif
-									if (iaxs[fr.callno]->last < fr.ts) {
-										iaxs[fr.callno]->last = fr.ts;
+									if (iaxs[fr->callno]->last < fr->ts) {
+										iaxs[fr->callno]->last = fr->ts;
 #if 1
 										if (option_debug)
-											ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr.callno, fr.ts);
+											ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr->callno, fr->ts);
 #endif
 									}
 								}
@@ -6440,10 +6440,10 @@
 							}
 						} else {
 							ast_log(LOG_WARNING, "Received trunked frame before first full voice frame\n ");
-							iax2_vnak(fr.callno);
+							iax2_vnak(fr->callno);
 						}
 					}
-					ast_mutex_unlock(&iaxsl[fr.callno]);
+					ast_mutex_unlock(&iaxsl[fr->callno]);
 				}
 				ptr += len;
 				res -= len;
@@ -6476,13 +6476,13 @@
 		f.subclass = 0;
 	}
 
-	if (!fr.callno)
-		fr.callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, 1, fd);
-
-	if (fr.callno > 0) 
-		ast_mutex_lock(&iaxsl[fr.callno]);
-
-	if (!fr.callno || !iaxs[fr.callno]) {
+	if (!fr->callno)
+		fr->callno = find_callno(ntohs(mh->callno) & ~IAX_FLAG_FULL, dcallno, &sin, new, 1, fd);
+
+	if (fr->callno > 0) 
+		ast_mutex_lock(&iaxsl[fr->callno]);
+
+	if (!fr->callno || !iaxs[fr->callno]) {
 		/* A call arrived for a nonexistent destination.  Unless it's an "inval"
 		   frame, reply with an inval */
 		if (ntohs(mh->callno) & IAX_FLAG_FULL) {
@@ -6495,14 +6495,14 @@
 				raw_hangup(&sin, ntohs(fh->dcallno) & ~IAX_FLAG_RETRANS, ntohs(mh->callno) & ~IAX_FLAG_FULL,
 				fd);
 		}
-		if (fr.callno > 0) 
-			ast_mutex_unlock(&iaxsl[fr.callno]);
+		if (fr->callno > 0) 
+			ast_mutex_unlock(&iaxsl[fr->callno]);
 		return 1;
 	}
-	if (ast_test_flag(iaxs[fr.callno], IAX_ENCRYPTED)) {
-		if (decrypt_frame(fr.callno, fh, &f, &res)) {
+	if (ast_test_flag(iaxs[fr->callno], IAX_ENCRYPTED)) {
+		if (decrypt_frame(fr->callno, fh, &f, &res)) {
 			ast_log(LOG_NOTICE, "Packet Decrypt Failed!\n");
-			ast_mutex_unlock(&iaxsl[fr.callno]);
+			ast_mutex_unlock(&iaxsl[fr->callno]);
 			return 1;
 		}
 #ifdef DEBUG_SUPPORT
@@ -6512,24 +6512,24 @@
 	}
 
 	/* count this frame */
-	iaxs[fr.callno]->frames_received++;
-
-	if (!inaddrcmp(&sin, &iaxs[fr.callno]->addr) && !minivid &&
+	iaxs[fr->callno]->frames_received++;
+
+	if (!inaddrcmp(&sin, &iaxs[fr->callno]->addr) && !minivid &&
 		f.subclass != IAX_COMMAND_TXCNT &&		/* for attended transfer */
 		f.subclass != IAX_COMMAND_TXACC)		/* for attended transfer */
-		iaxs[fr.callno]->peercallno = (unsigned short)(ntohs(mh->callno) & ~IAX_FLAG_FULL);
+		iaxs[fr->callno]->peercallno = (unsigned short)(ntohs(mh->callno) & ~IAX_FLAG_FULL);
 	if (ntohs(mh->callno) & IAX_FLAG_FULL) {
 		if (option_debug  && iaxdebug)
 			ast_log(LOG_DEBUG, "Received packet %d, (%d, %d)\n", fh->oseqno, f.frametype, f.subclass);
 		/* Check if it's out of order (and not an ACK or INVAL) */
-		fr.oseqno = fh->oseqno;
-		fr.iseqno = fh->iseqno;
-		fr.ts = ntohl(fh->ts);
+		fr->oseqno = fh->oseqno;
+		fr->iseqno = fh->iseqno;
+		fr->ts = ntohl(fh->ts);
 #ifdef IAXTESTS
 		if (test_resync) {
 			if (option_debug)
-				ast_log(LOG_DEBUG, "Simulating frame ts resync, was %u now %u\n", fr.ts, fr.ts + test_resync);
-			fr.ts += test_resync;
+				ast_log(LOG_DEBUG, "Simulating frame ts resync, was %u now %u\n", fr->ts, fr->ts + test_resync);
+			fr->ts += test_resync;
 		}
 #endif /* IAXTESTS */
 #if 0
@@ -6542,8 +6542,8 @@
 #endif
 		if ((ntohs(fh->dcallno) & IAX_FLAG_RETRANS) || (f.frametype != AST_FRAME_VOICE))
 			updatehistory = 0;
-		if ((iaxs[fr.callno]->iseqno != fr.oseqno) &&
-			(iaxs[fr.callno]->iseqno ||
+		if ((iaxs[fr->callno]->iseqno != fr->oseqno) &&
+			(iaxs[fr->callno]->iseqno ||
 				((f.subclass != IAX_COMMAND_TXCNT) &&
 				(f.subclass != IAX_COMMAND_TXREADY) &&		/* for attended transfer */
 				(f.subclass != IAX_COMMAND_TXREL) &&		/* for attended transfer */
@@ -6563,8 +6563,8 @@
 			 	/* If it's not an ACK packet, it's out of order. */
 				if (option_debug)
 					ast_log(LOG_DEBUG, "Packet arrived out of order (expecting %d, got %d) (frametype = %d, subclass = %d)\n", 
-					iaxs[fr.callno]->iseqno, fr.oseqno, f.frametype, f.subclass);
-				if (iaxs[fr.callno]->iseqno > fr.oseqno) {
+					iaxs[fr->callno]->iseqno, fr->oseqno, f.frametype, f.subclass);
+				if (iaxs[fr->callno]->iseqno > fr->oseqno) {
 					/* If we've already seen it, ack it XXX There's a border condition here XXX */
 					if ((f.frametype != AST_FRAME_IAX) || 
 							((f.subclass != IAX_COMMAND_ACK) && (f.subclass != IAX_COMMAND_INVAL))) {
@@ -6572,13 +6572,13 @@
 							ast_log(LOG_DEBUG, "Acking anyway\n");
 						/* XXX Maybe we should handle its ack to us, but then again, it's probably outdated anyway, and if
 						   we have anything to send, we'll retransmit and get an ACK back anyway XXX */
-						send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
+						send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
 					}
 				} else {
 					/* Send a VNAK requesting retransmission */
-					iax2_vnak(fr.callno);
+					iax2_vnak(fr->callno);
 				}
-				ast_mutex_unlock(&iaxsl[fr.callno]);
+				ast_mutex_unlock(&iaxsl[fr->callno]);
 				return 1;
 			}
 		} else {
@@ -6589,67 +6589,67 @@
 			    (f.subclass != IAX_COMMAND_TXACC) &&
 				(f.subclass != IAX_COMMAND_VNAK)) ||
 			    (f.frametype != AST_FRAME_IAX))
-				iaxs[fr.callno]->iseqno++;
+				iaxs[fr->callno]->iseqno++;
 		}
 		/* A full frame */
 		if (res < sizeof(struct ast_iax2_full_hdr)) {
 			ast_log(LOG_WARNING, "midget packet received (%d of %d min)\n", res, (int)sizeof(struct ast_iax2_full_hdr));
-			ast_mutex_unlock(&iaxsl[fr.callno]);
+			ast_mutex_unlock(&iaxsl[fr->callno]);
 			return 1;
 		}
 		f.datalen = res - sizeof(struct ast_iax2_full_hdr);
 
 		/* Handle implicit ACKing unless this is an INVAL, and only if this is 
 		   from the real peer, not the transfer peer */
-		if (!inaddrcmp(&sin, &iaxs[fr.callno]->addr) && 
+		if (!inaddrcmp(&sin, &iaxs[fr->callno]->addr) && 
 		    ((f.subclass != IAX_COMMAND_INVAL) ||
 		     (f.frametype != AST_FRAME_IAX))) {
 			unsigned char x;
 			/* XXX This code is not very efficient.  Surely there is a better way which still
 			       properly handles boundary conditions? XXX */
 			/* First we have to qualify that the ACKed value is within our window */
-			for (x=iaxs[fr.callno]->rseqno; x != iaxs[fr.callno]->oseqno; x++)
-				if (fr.iseqno == x)
+			for (x=iaxs[fr->callno]->rseqno; x != iaxs[fr->callno]->oseqno; x++)
+				if (fr->iseqno == x)
 					break;
-			if ((x != iaxs[fr.callno]->oseqno) || (iaxs[fr.callno]->oseqno == fr.iseqno)) {
+			if ((x != iaxs[fr->callno]->oseqno) || (iaxs[fr->callno]->oseqno == fr->iseqno)) {
 				/* The acknowledgement is within our window.  Time to acknowledge everything
 				   that it says to */
-				for (x=iaxs[fr.callno]->rseqno; x != fr.iseqno; x++) {
+				for (x=iaxs[fr->callno]->rseqno; x != fr->iseqno; x++) {
 					/* Ack the packet with the given timestamp */
 					if (option_debug && iaxdebug)
 						ast_log(LOG_DEBUG, "Cancelling transmission of packet %d\n", x);
 					ast_mutex_lock(&iaxq.lock);
 					for (cur = iaxq.head; cur ; cur = cur->next) {
 						/* If it's our call, and our timestamp, mark -1 retries */
-						if ((fr.callno == cur->callno) && (x == cur->oseqno)) {
+						if ((fr->callno == cur->callno) && (x == cur->oseqno)) {
 							cur->retries = -1;
 							/* Destroy call if this is the end */
 							if (cur->final) { 
 								if (iaxdebug && option_debug)
-									ast_log(LOG_DEBUG, "Really destroying %d, having been acked on final message\n", fr.callno);
-								iax2_destroy_nolock(fr.callno);
+									ast_log(LOG_DEBUG, "Really destroying %d, having been acked on final message\n", fr->callno);
+								iax2_destroy_nolock(fr->callno);
 							}
 						}
 					}
 					ast_mutex_unlock(&iaxq.lock);
 				}
 				/* Note how much we've received acknowledgement for */
-				if (iaxs[fr.callno])
-					iaxs[fr.callno]->rseqno = fr.iseqno;
+				if (iaxs[fr->callno])
+					iaxs[fr->callno]->rseqno = fr->iseqno;
 				else {
 					/* Stop processing now */
-					ast_mutex_unlock(&iaxsl[fr.callno]);
+					ast_mutex_unlock(&iaxsl[fr->callno]);
 					return 1;
 				}
 			} else
-				ast_log(LOG_DEBUG, "Received iseqno %d not within window %d->%d\n", fr.iseqno, iaxs[fr.callno]->rseqno, iaxs[fr.callno]->oseqno);
-		}
-		if (inaddrcmp(&sin, &iaxs[fr.callno]->addr) && 
+				ast_log(LOG_DEBUG, "Received iseqno %d not within window %d->%d\n", fr->iseqno, iaxs[fr->callno]->rseqno, iaxs[fr->callno]->oseqno);
+		}
+		if (inaddrcmp(&sin, &iaxs[fr->callno]->addr) && 
 			((f.frametype != AST_FRAME_IAX) || 
 			 ((f.subclass != IAX_COMMAND_TXACC) &&
 			  (f.subclass != IAX_COMMAND_TXCNT)))) {
 			/* Only messages we accept from a transfer host are TXACC and TXCNT */
-			ast_mutex_unlock(&iaxsl[fr.callno]);
+			ast_mutex_unlock(&iaxsl[fr->callno]);
 			return 1;
 		}
 
@@ -6657,7 +6657,7 @@
 			if (f.frametype == AST_FRAME_IAX) {
 				if (iax_parse_ies(&ies, buf + sizeof(struct ast_iax2_full_hdr), f.datalen)) {
 					ast_log(LOG_WARNING, "Undecodable frame received from '%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
-					ast_mutex_unlock(&iaxsl[fr.callno]);
+					ast_mutex_unlock(&iaxsl[fr->callno]);
 					return 1;
 				}
 				f.data = NULL;
@@ -6671,59 +6671,59 @@
 			memset(&ies, 0, sizeof(ies));
 		}
 		if (f.frametype == AST_FRAME_VOICE) {
-			if (f.subclass != iaxs[fr.callno]->voiceformat) {
-					iaxs[fr.callno]->voiceformat = f.subclass;
+			if (f.subclass != iaxs[fr->callno]->voiceformat) {
+					iaxs[fr->callno]->voiceformat = f.subclass;
 					ast_log(LOG_DEBUG, "Ooh, voice format changed to %d\n", f.subclass);
-					if (iaxs[fr.callno]->owner) {
+					if (iaxs[fr->callno]->owner) {
 						int orignative;
 retryowner:
-						if (ast_mutex_trylock(&iaxs[fr.callno]->owner->lock)) {
-							ast_mutex_unlock(&iaxsl[fr.callno]);
+						if (ast_mutex_trylock(&iaxs[fr->callno]->owner->lock)) {
+							ast_mutex_unlock(&iaxsl[fr->callno]);
 							usleep(1);
-							ast_mutex_lock(&iaxsl[fr.callno]);
-							if (iaxs[fr.callno] && iaxs[fr.callno]->owner) goto retryowner;
+							ast_mutex_lock(&iaxsl[fr->callno]);
+							if (iaxs[fr->callno] && iaxs[fr->callno]->owner) goto retryowner;
 						}
-						if (iaxs[fr.callno]) {
-							if (iaxs[fr.callno]->owner) {
-								orignative = iaxs[fr.callno]->owner->nativeformats;
-								iaxs[fr.callno]->owner->nativeformats = f.subclass;
-								if (iaxs[fr.callno]->owner->readformat)
-									ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);
-								iaxs[fr.callno]->owner->nativeformats = orignative;
-								ast_mutex_unlock(&iaxs[fr.callno]->owner->lock);
+						if (iaxs[fr->callno]) {
+							if (iaxs[fr->callno]->owner) {
+								orignative = iaxs[fr->callno]->owner->nativeformats;
+								iaxs[fr->callno]->owner->nativeformats = f.subclass;
+								if (iaxs[fr->callno]->owner->readformat)
+									ast_set_read_format(iaxs[fr->callno]->owner, iaxs[fr->callno]->owner->readformat);
+								iaxs[fr->callno]->owner->nativeformats = orignative;
+								ast_mutex_unlock(&iaxs[fr->callno]->owner->lock);
 							}
 						} else {
 							ast_log(LOG_DEBUG, "Neat, somebody took away the channel at a magical time but i found it!\n");
-							ast_mutex_unlock(&iaxsl[fr.callno]);
+							ast_mutex_unlock(&iaxsl[fr->callno]);
 							return 1;
 						}
 					}
 			}
 		}
 		if (f.frametype == AST_FRAME_VIDEO) {
-			if (f.subclass != iaxs[fr.callno]->videoformat) {
+			if (f.subclass != iaxs[fr->callno]->videoformat) {
 				ast_log(LOG_DEBUG, "Ooh, video format changed to %d\n", f.subclass & ~0x1);
-				iaxs[fr.callno]->videoformat = f.subclass & ~0x1;
+				iaxs[fr->callno]->videoformat = f.subclass & ~0x1;
 			}
 		}
 		if (f.frametype == AST_FRAME_IAX) {
-			if (iaxs[fr.callno]->initid > -1) {
+			if (iaxs[fr->callno]->initid > -1) {
 				/* Don't auto congest anymore since we've gotten something usefulb ack */
-				ast_sched_del(sched, iaxs[fr.callno]->initid);
-				iaxs[fr.callno]->initid = -1;
+				ast_sched_del(sched, iaxs[fr->callno]->initid);
+				iaxs[fr->callno]->initid = -1;
 			}
 			/* Handle the IAX pseudo frame itself */
 			if (option_debug && iaxdebug)
 				ast_log(LOG_DEBUG, "IAX subclass %d received\n", f.subclass);
 
                         /* Update last ts unless the frame's timestamp originated with us. */
-			if (iaxs[fr.callno]->last < fr.ts &&
+			if (iaxs[fr->callno]->last < fr->ts &&
                             f.subclass != IAX_COMMAND_ACK &&
                             f.subclass != IAX_COMMAND_PONG &&
                             f.subclass != IAX_COMMAND_LAGRP) {
-				iaxs[fr.callno]->last = fr.ts;
+				iaxs[fr->callno]->last = fr->ts;
 				if (option_debug && iaxdebug)
-					ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr.callno, fr.ts);
+					ast_log(LOG_DEBUG, "For call=%d, set last=%d\n", fr->callno, fr->ts);
 			}
 
 			switch(f.subclass) {
@@ -6731,102 +6731,102 @@
 				/* Do nothing */
 				break;
 			case IAX_COMMAND_QUELCH:
-				if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
+				if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
 				        /* Generate Manager Hold event, if necessary*/
-					if (iaxs[fr.callno]->owner) {
+					if (iaxs[fr->callno]->owner) {
 						manager_event(EVENT_FLAG_CALL, "Hold",
 							"Channel: %s\r\n"
 							"Uniqueid: %s\r\n",
-							iaxs[fr.callno]->owner->name, 
-							iaxs[fr.callno]->owner->uniqueid);
+							iaxs[fr->callno]->owner->name, 
+							iaxs[fr->callno]->owner->uniqueid);
 					}
 
-					ast_set_flag(iaxs[fr.callno], IAX_QUELCH);
+					ast_set_flag(iaxs[fr->callno], IAX_QUELCH);
 					if (ies.musiconhold) {
-						if (iaxs[fr.callno]->owner &&
-							ast_bridged_channel(iaxs[fr.callno]->owner))
-								ast_moh_start(ast_bridged_channel(iaxs[fr.callno]->owner), NULL);
+						if (iaxs[fr->callno]->owner &&
+							ast_bridged_channel(iaxs[fr->callno]->owner))
+								ast_moh_start(ast_bridged_channel(iaxs[fr->callno]->owner), NULL);
 					}
 				}
 				break;
 			case IAX_COMMAND_UNQUELCH:
-				if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED)) {
+				if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED)) {
 				        /* Generate Manager Unhold event, if necessary*/
-					if (iaxs[fr.callno]->owner && ast_test_flag(iaxs[fr.callno], IAX_QUELCH)) {
+					if (iaxs[fr->callno]->owner && ast_test_flag(iaxs[fr->callno], IAX_QUELCH)) {
 						manager_event(EVENT_FLAG_CALL, "Unhold",
 							"Channel: %s\r\n"
 							"Uniqueid: %s\r\n",
-							iaxs[fr.callno]->owner->name, 
-							iaxs[fr.callno]->owner->uniqueid);
+							iaxs[fr->callno]->owner->name, 
+							iaxs[fr->callno]->owner->uniqueid);
 					}
 
-					ast_clear_flag(iaxs[fr.callno], IAX_QUELCH);
-					if (iaxs[fr.callno]->owner &&
-						ast_bridged_channel(iaxs[fr.callno]->owner))
-							ast_moh_stop(ast_bridged_channel(iaxs[fr.callno]->owner));
+					ast_clear_flag(iaxs[fr->callno], IAX_QUELCH);
+					if (iaxs[fr->callno]->owner &&
+						ast_bridged_channel(iaxs[fr->callno]->owner))
+							ast_moh_stop(ast_bridged_channel(iaxs[fr->callno]->owner));
 				}
 				break;
 			case IAX_COMMAND_TXACC:
-				if (iaxs[fr.callno]->transferring == TRANSFER_BEGIN) {
+				if (iaxs[fr->callno]->transferring == TRANSFER_BEGIN) {
 					/* Ack the packet with the given timestamp */
 					ast_mutex_lock(&iaxq.lock);
 					for (cur = iaxq.head; cur ; cur = cur->next) {
 						/* Cancel any outstanding txcnt's */
-						if ((fr.callno == cur->callno) && (cur->transfer))
+						if ((fr->callno == cur->callno) && (cur->transfer))
 							cur->retries = -1;
 					}
 					ast_mutex_unlock(&iaxq.lock);
 					memset(&ied1, 0, sizeof(ied1));
-					iax_ie_append_short(&ied1, IAX_IE_CALLNO, iaxs[fr.callno]->callno);
-					send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_TXREADY, 0, ied1.buf, ied1.pos, -1);
-					iaxs[fr.callno]->transferring = TRANSFER_READY;
+					iax_ie_append_short(&ied1, IAX_IE_CALLNO, iaxs[fr->callno]->callno);
+					send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_TXREADY, 0, ied1.buf, ied1.pos, -1);
+					iaxs[fr->callno]->transferring = TRANSFER_READY;
 				}
 				break;
 			case IAX_COMMAND_NEW:
 				/* Ignore if it's already up */
-				if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
+				if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED | IAX_STATE_TBD))
 					break;
 				if (ies.provverpres && ies.serviceident && sin.sin_addr.s_addr)
 					check_provisioning(&sin, fd, ies.serviceident, ies.provver);
 				/* If we're in trunk mode, do it now, and update the trunk number in our frame before continuing */
-				if (ast_test_flag(iaxs[fr.callno], IAX_TRUNK)) {
-					fr.callno = make_trunk(fr.callno, 1);
+				if (ast_test_flag(iaxs[fr->callno], IAX_TRUNK)) {
+					fr->callno = make_trunk(fr->callno, 1);
 				}
 				/* For security, always ack immediately */
 				if (delayreject)
-					send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
-				if (check_access(fr.callno, &sin, &ies)) {
+					send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+				if (check_access(fr->callno, &sin, &ies)) {
 					/* They're not allowed on */
-					auth_fail(fr.callno, IAX_COMMAND_REJECT);
+					auth_fail(fr->callno, IAX_COMMAND_REJECT);
 					if (authdebug)
-						ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
+						ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
 					break;
 				}
 				/* This might re-enter the IAX code and need the lock */
-				if (strcasecmp(iaxs[fr.callno]->exten, "TBD")) {
-					ast_mutex_unlock(&iaxsl[fr.callno]);
-					exists = ast_exists_extension(NULL, iaxs[fr.callno]->context, iaxs[fr.callno]->exten, 1, iaxs[fr.callno]->cid_num);
-					ast_mutex_lock(&iaxsl[fr.callno]);
+				if (strcasecmp(iaxs[fr->callno]->exten, "TBD")) {
+					ast_mutex_unlock(&iaxsl[fr->callno]);
+					exists = ast_exists_extension(NULL, iaxs[fr->callno]->context, iaxs[fr->callno]->exten, 1, iaxs[fr->callno]->cid_num);
+					ast_mutex_lock(&iaxsl[fr->callno]);
 				} else
 					exists = 0;
-				if (ast_strlen_zero(iaxs[fr.callno]->secret) && ast_strlen_zero(iaxs[fr.callno]->inkeys)) {
-					if (strcmp(iaxs[fr.callno]->exten, "TBD") && !exists) {
+				if (ast_strlen_zero(iaxs[fr->callno]->secret) && ast_strlen_zero(iaxs[fr->callno]->inkeys)) {
+					if (strcmp(iaxs[fr->callno]->exten, "TBD") && !exists) {
 						memset(&ied0, 0, sizeof(ied0));
 						iax_ie_append_str(&ied0, IAX_IE_CAUSE, "No such context/extension");
 						iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_NO_ROUTE_DESTINATION);
-						send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+						send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
 						if (authdebug)
-							ast_log(LOG_NOTICE, "Rejected connect attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->exten, iaxs[fr.callno]->context);
+							ast_log(LOG_NOTICE, "Rejected connect attempt from %s, request '%s@%s' does not exist\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
 					} else {
 						/* Select an appropriate format */
 
-						if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOPREFS)) {
-							if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
+						if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOPREFS)) {
+							if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
 								using_prefs = "reqonly";
 							} else {
 								using_prefs = "disabled";
 							}
-							format = iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability;
+							format = iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability;
 							memset(&pref, 0, sizeof(pref));
 							strcpy(caller_pref_buf, "disabled");
 							strcpy(host_pref_buf, "disabled");
@@ -6834,62 +6834,62 @@
 							using_prefs = "mine";
 							/* If the information elements are in here... use them */
 							if (ies.codec_prefs)
-								ast_codec_pref_convert(&iaxs[fr.callno]->rprefs, ies.codec_prefs, 32, 0);
-							if (ast_codec_pref_index(&iaxs[fr.callno]->rprefs, 0)) {
+								ast_codec_pref_convert(&iaxs[fr->callno]->rprefs, ies.codec_prefs, 32, 0);
+							if (ast_codec_pref_index(&iaxs[fr->callno]->rprefs, 0)) {
 								/* If we are codec_first_choice we let the caller have the 1st shot at picking the codec.*/
-								if (ast_test_flag(iaxs[fr.callno], IAX_CODEC_USER_FIRST)) {
-									pref = iaxs[fr.callno]->rprefs;
+								if (ast_test_flag(iaxs[fr->callno], IAX_CODEC_USER_FIRST)) {
+									pref = iaxs[fr->callno]->rprefs;
 									using_prefs = "caller";
 								} else {
-									pref = iaxs[fr.callno]->prefs;
+									pref = iaxs[fr->callno]->prefs;
 								}
 							} else
-								pref = iaxs[fr.callno]->prefs;
+								pref = iaxs[fr->callno]->prefs;
 							
-							format = ast_codec_choose(&pref, iaxs[fr.callno]->capability & iaxs[fr.callno]->peercapability, 0);
-							ast_codec_pref_string(&iaxs[fr.callno]->rprefs, caller_pref_buf, sizeof(caller_pref_buf) - 1);
-							ast_codec_pref_string(&iaxs[fr.callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1);
+							format = ast_codec_choose(&pref, iaxs[fr->callno]->capability & iaxs[fr->callno]->peercapability, 0);
+							ast_codec_pref_string(&iaxs[fr->callno]->rprefs, caller_pref_buf, sizeof(caller_pref_buf) - 1);
+							ast_codec_pref_string(&iaxs[fr->callno]->prefs, host_pref_buf, sizeof(host_pref_buf) - 1);
 						}
 						if (!format) {
-							if(!ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP))
-								format = iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability;
+							if(!ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP))
+								format = iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability;
 							if (!format) {
 								memset(&ied0, 0, sizeof(ied0));
 								iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
 								iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
-								send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+								send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
 								if (authdebug) {
-									if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP))
-										ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->capability);
+									if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP))
+										ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested 0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->capability);
 									else 
-										ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iaxs[fr.callno]->capability);
+										ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->peercapability, iaxs[fr->callno]->capability);
 								}
 							} else {
 								/* Pick one... */
-								if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP)) {
-									if(!(iaxs[fr.callno]->peerformat & iaxs[fr.callno]->capability))
+								if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP)) {
+									if(!(iaxs[fr->callno]->peerformat & iaxs[fr->callno]->capability))
 										format = 0;
 								} else {
-									if(ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOPREFS)) {
-										using_prefs = ast_test_flag(iaxs[fr.callno], IAX_CODEC_NOCAP) ? "reqonly" : "disabled";
+									if(ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOPREFS)) {
+										using_prefs = ast_test_flag(iaxs[fr->callno], IAX_CODEC_NOCAP) ? "reqonly" : "disabled";
 										memset(&pref, 0, sizeof(pref));
-										format = ast_best_codec(iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
+										format = ast_best_codec(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
 										strcpy(caller_pref_buf,"disabled");
 										strcpy(host_pref_buf,"disabled");
 									} else {
 										using_prefs = "mine";
-										if (ast_codec_pref_index(&iaxs[fr.callno]->rprefs, 0)) {
+										if (ast_codec_pref_index(&iaxs[fr->callno]->rprefs, 0)) {
 											/* Do the opposite of what we tried above. */
-											if (ast_test_flag(iaxs[fr.callno], IAX_CODEC_USER_FIRST)) {
-												pref = iaxs[fr.callno]->prefs;								
+											if (ast_test_flag(iaxs[fr->callno], IAX_CODEC_USER_FIRST)) {
+												pref = iaxs[fr->callno]->prefs;								
 											} else {
-												pref = iaxs[fr.callno]->rprefs;
+												pref = iaxs[fr->callno]->rprefs;
 												using_prefs = "caller";
 											}
-											format = ast_codec_choose(&pref, iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability, 1);
+											format = ast_codec_choose(&pref, iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability, 1);
 									
 										} else /* if no codec_prefs IE do it the old way */
-											format = ast_best_codec(iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);	
+											format = ast_best_codec(iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);	
 									}
 								}
 
@@ -6897,11 +6897,11 @@
 									memset(&ied0, 0, sizeof(ied0));
 									iax_ie_append_str(&ied0, IAX_IE_CAUSE, "Unable to negotiate codec");
 									iax_ie_append_byte(&ied0, IAX_IE_CAUSECODE, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);
-									ast_log(LOG_ERROR, "No best format in 0x%x???\n", iaxs[fr.callno]->peercapability & iaxs[fr.callno]->capability);
-									send_command_final(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
+									ast_log(LOG_ERROR, "No best format in 0x%x???\n", iaxs[fr->callno]->peercapability & iaxs[fr->callno]->capability);
+									send_command_final(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_REJECT, 0, ied0.buf, ied0.pos, -1);
 									if (authdebug)
-										ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr.callno]->peerformat, iaxs[fr.callno]->peercapability, iaxs[fr.callno]->capability);
-									ast_set_flag(iaxs[fr.callno], IAX_ALREADYGONE);	
+										ast_log(LOG_NOTICE, "Rejected connect attempt from %s, requested/capability 0x%x/0x%x incompatible with our capability 0x%x.\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), iaxs[fr->callno]->peerformat, iaxs[fr->callno]->peercapability, iaxs[fr->callno]->capability);
+									ast_set_flag(iaxs[fr->callno], IAX_ALREADYGONE);	
 									break;
 								}
 							}
@@ -6910,9 +6910,9 @@
 							/* No authentication required, let them in */
 							memset(&ied1, 0, sizeof(ied1));
 							iax_ie_append_int(&ied1, IAX_IE_FORMAT, format);
-							send_command(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
-							if (strcmp(iaxs[fr.callno]->exten, "TBD")) {
-								ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED);
+							send_command(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACCEPT, 0, ied1.buf, ied1.pos, -1);
+							if (strcmp(iaxs[fr->callno]->exten, "TBD")) {
+								ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED);
 								if (option_verbose > 2) 
 									ast_verbose(VERBOSE_PREFIX_3 "Accepting UNAUTHENTICATED call from %s:\n"
 												"%srequested format = %s,\n"
@@ -6922,7 +6922,7 @@
 												"%spriority = %s\n",
 												ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr), 
 												VERBOSE_PREFIX_4,
-												ast_getformatname(iaxs[fr.callno]->peerformat), 
+												ast_getformatname(iaxs[fr->callno]->peerformat), 
 												VERBOSE_PREFIX_4,
 												caller_pref_buf,
 												VERBOSE_PREFIX_4,
@@ -6932,10 +6932,10 @@
 												VERBOSE_PREFIX_4,
 												using_prefs);
 								
-								if(!(c = ast_iax2_new(fr.callno, AST_STATE_RING, format)))
-									iax2_destroy_nolock(fr.callno);
+								if(!(c = ast_iax2_new(fr->callno, AST_STATE_RING, format)))
+									iax2_destroy_nolock(fr->callno);
 							} else {
-								ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD);
+								ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD);
 								/* If this is a TBD call, we're ready but now what...  */
 								if (option_verbose > 2)
 									ast_verbose(VERBOSE_PREFIX_3 "Accepted unauthenticated TBD call from %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), sin.sin_addr));
@@ -6944,35 +6944,35 @@
 					}
 					break;
 				}
-				if (iaxs[fr.callno]->authmethods & IAX_AUTH_MD5)
-					merge_encryption(iaxs[fr.callno],ies.encmethods);
+				if (iaxs[fr->callno]->authmethods & IAX_AUTH_MD5)
+					merge_encryption(iaxs[fr->callno],ies.encmethods);
 				else
-					iaxs[fr.callno]->encmethods = 0;
-				authenticate_request(iaxs[fr.callno]);
-				ast_set_flag(&iaxs[fr.callno]->state, IAX_STATE_AUTHENTICATED);
+					iaxs[fr->callno]->encmethods = 0;
+				authenticate_request(iaxs[fr->callno]);
+				ast_set_flag(&iaxs[fr->callno]->state, IAX_STATE_AUTHENTICATED);
 				break;
 			case IAX_COMMAND_DPREQ:
 				/* Request status in the dialplan */
-				if (ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_TBD) &&
-					!ast_test_flag(&iaxs[fr.callno]->state, IAX_STATE_STARTED) && ies.called_number) {
+				if (ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_TBD) &&
+					!ast_test_flag(&iaxs[fr->callno]->state, IAX_STATE_STARTED) && ies.called_number) {
 					if (iaxcompat) {
 						/* Spawn a thread for the lookup */
-						spawn_dp_lookup(fr.callno, iaxs[fr.callno]->context, ies.called_number, iaxs[fr.callno]->cid_num);
+						spawn_dp_lookup(fr->callno, iaxs[fr->callno]->context, ies.called_number, iaxs[fr->callno]->cid_num);
 					} else {
 						/* Just look it up */
-						dp_lookup(fr.callno, iaxs[fr.callno]->context, ies.called_number, iaxs[fr.callno]->cid_num, 1);
+						dp_lookup(fr->callno, iaxs[fr->callno]->context, ies.called_number, iaxs[fr->callno]->cid_num, 1);
 					}
 				}
 				break;
 			case IAX_COMMAND_HANGUP:
-				ast_set_flag(iaxs[fr.callno], IAX_ALREADYGONE);
-				ast_log(LOG_DEBUG, "Immediately destroying %d, having received hangup\n", fr.callno);
+				ast_set_flag(iaxs[fr->callno], IAX_ALREADYGONE);
+				ast_log(LOG_DEBUG, "Immediately destroying %d, having received hangup\n", fr->callno);
 				/* Set hangup cause according to remote */
-				if (ies.causecode && iaxs[fr.callno]->owner)
-					iaxs[fr.callno]->owner->hangupcause = ies.causecode;
+				if (ies.causecode && iaxs[fr->callno]->owner)
+					iaxs[fr->callno]->owner->hangupcause = ies.causecode;
 				/* Send ack immediately, before we destroy */
-				send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
-				iax2_destroy_nolock(fr.callno);
+				send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+				iax2_destroy_nolock(fr->callno);
 				break;
 			case IAX_COMMAND_REJECT:
 				memset(&f, 0, sizeof(f));
@@ -6980,101 +6980,101 @@
 				f.subclass = AST_CONTROL_CONGESTION;
 
 				/* Set hangup cause according to remote */
-				if (ies.causecode && iaxs[fr.callno]->owner)
-					iaxs[fr.callno]->owner->hangupcause = ies.causecode;
-
-				iax2_queue_frame(fr.callno, &f);
-				if (ast_test_flag(iaxs[fr.callno], IAX_PROVISION)) {
+				if (ies.causecode && iaxs[fr->callno]->owner)
+					iaxs[fr->callno]->owner->hangupcause = ies.causecode;
+
+				iax2_queue_frame(fr->callno, &f);
+				if (ast_test_flag(iaxs[fr->callno], IAX_PROVISION)) {
 					/* Send ack immediately, before we destroy */
-					send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
-					iax2_destroy_nolock(fr.callno);
+					send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+					iax2_destroy_nolock(fr->callno);
 					break;
 				}
-				if (iaxs[fr.callno]->owner) {
+				if (iaxs[fr->callno]->owner) {
 					if (authdebug)
-						ast_log(LOG_WARNING, "Call rejected by %s: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr.callno]->addr.sin_addr), ies.cause ? ies.cause : "<Unknown>");
+						ast_log(LOG_WARNING, "Call rejected by %s: %s\n", ast_inet_ntoa(iabuf, sizeof(iabuf), iaxs[fr->callno]->addr.sin_addr), ies.cause ? ies.cause : "<Unknown>");
 				}
-				ast_log(LOG_DEBUG, "Immediately destroying %d, having received reject\n", fr.callno);
+				ast_log(LOG_DEBUG, "Immediately destroying %d, having received reject\n", fr->callno);
 				/* Send ack immediately, before we destroy */
-				send_command_immediate(iaxs[fr.callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr.ts, NULL, 0,fr.iseqno);
-				iaxs[fr.callno]->error = EPERM;
-				iax2_destroy_nolock(fr.callno);
+				send_command_immediate(iaxs[fr->callno], AST_FRAME_IAX, IAX_COMMAND_ACK, fr->ts, NULL, 0,fr->iseqno);
+				iaxs[fr->callno]->error = EPERM;
+				iax2_destroy_nolock(fr->callno);
 				break;
 			case IAX_COMMAND_TRANSFER:
-				if (iaxs[fr.callno]->owner && ast_bridged_channel(iaxs[fr.callno]->owner) && ies.called_number) {
+				if (iaxs[fr->callno]->owner && ast_bridged_channel(iaxs[fr->callno]->owner) && ies.called_number) {
 					if (!strcmp(ies.called_number, ast_parking_ext())) {
-						if (iax_park(ast_bridged_channel(iaxs[fr.callno]->owner), iaxs[fr.callno]->owner)) {
-							ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name);
+						if (iax_park(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->owner)) {
+							ast_log(LOG_WARNING, "Failed to park call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 						} else
-							ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name);
+							ast_log(LOG_DEBUG, "Parked call on '%s'\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name);
 					} else {
-						if (ast_async_goto(ast_bridged_channel(iaxs[fr.callno]->owner), iaxs[fr.callno]->context, ies.called_number, 1))
-							ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", ast_bridged_channel(iaxs[fr.callno]->owner)->name, 
-								ies.called_number, iaxs[fr.callno]->context);
+						if (ast_async_goto(ast_bridged_channel(iaxs[fr->callno]->owner), iaxs[fr->callno]->context, ies.called_number, 1))
+							ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", ast_bridged_channel(iaxs[fr->callno]->owner)->name, 
+								ies.called_number, iaxs[fr->callno]->context);
 						else

[... 832 lines stripped ...]


More information about the asterisk-commits mailing list