[Asterisk-cvs] asterisk/channels chan_agent.c,1.68,1.69 chan_h323.c,1.39,1.40 chan_iax.c,1.54,1.55 chan_iax2.c,1.118,1.119 chan_local.c,1.25,1.26 chan_mgcp.c,1.41,1.42 chan_nbs.c,1.5,1.6 chan_phone.c,1.23,1.24 chan_sip.c,1.332,1.333 chan_skinny.c,1.34,1.35 chan_vpb.c,1.17,1.18 chan_zap.c,1.201,1.202

markster at lists.digium.com markster at lists.digium.com
Tue Apr 6 18:17:06 CDT 2004


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv29122/channels

Modified Files:
	chan_agent.c chan_h323.c chan_iax.c chan_iax2.c chan_local.c 
	chan_mgcp.c chan_nbs.c chan_phone.c chan_sip.c chan_skinny.c 
	chan_vpb.c chan_zap.c 
Log Message:
Get rid of all that old needlock garbage now that we're using recursive mutexes


Index: chan_agent.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_agent.c,v
retrieving revision 1.68
retrieving revision 1.69
diff -u -d -r1.68 -r1.69
--- chan_agent.c	3 Apr 2004 00:41:47 -0000	1.68
+++ chan_agent.c	6 Apr 2004 22:17:31 -0000	1.69
@@ -137,13 +137,13 @@
 			/* Native formats changed, reset things */ \
 			ast->nativeformats = p->chan->nativeformats; \
 			ast_log(LOG_DEBUG, "Resetting read to %d and write to %d\n", ast->readformat, ast->writeformat);\
-			ast_set_read_format(ast, ast->readformat, 0); \
-			ast_set_write_format(ast, ast->writeformat, 0); \
+			ast_set_read_format(ast, ast->readformat); \
+			ast_set_write_format(ast, ast->writeformat); \
 		} \
 		if (p->chan->readformat != ast->pvt->rawreadformat)  \
-			ast_set_read_format(p->chan, ast->pvt->rawreadformat, 0); \
+			ast_set_read_format(p->chan, ast->pvt->rawreadformat); \
 		if (p->chan->writeformat != ast->pvt->rawwriteformat) \
-			ast_set_write_format(p->chan, ast->pvt->rawwriteformat, 0); \
+			ast_set_write_format(p->chan, ast->pvt->rawwriteformat); \
 	} \
 } while(0)
 
@@ -464,7 +464,7 @@
 		ast_log( LOG_DEBUG, "Waited for stream, result '%d'\n", res);
 	}
 	if (!res) {
-		res = ast_set_read_format(p->chan, ast_best_codec(p->chan->nativeformats), 0);
+		res = ast_set_read_format(p->chan, ast_best_codec(p->chan->nativeformats));
 		ast_log( LOG_DEBUG, "Set read format, result '%d'\n", res);
 		if (res)
 			ast_log(LOG_WARNING, "Unable to set read format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
@@ -474,7 +474,7 @@
 	}
 
 	if (!res) {
-		ast_set_write_format(p->chan, ast_best_codec(p->chan->nativeformats), 0);
+		ast_set_write_format(p->chan, ast_best_codec(p->chan->nativeformats));
 		ast_log( LOG_DEBUG, "Set write format, result '%d'\n", res);
 		if (res)
 			ast_log(LOG_WARNING, "Unable to set write format to %s\n", ast_getformatname(ast_best_codec(p->chan->nativeformats)));
@@ -708,7 +708,7 @@
 		if( ast_mutex_trylock(&p->app_lock) )
 		{
 			if (p->chan) {
-				ast_queue_frame(p->chan, &null_frame, 1);
+				ast_queue_frame(p->chan, &null_frame);
 				ast_mutex_unlock(&p->lock);	/* For other thread to read the condition. */
 				ast_mutex_lock(&p->app_lock);
 				ast_mutex_lock(&p->lock);
@@ -1266,12 +1266,12 @@
 						ast_mutex_lock(&agentlock);
 						ast_mutex_lock(&p->lock);
 						if (!res) {
-							res = ast_set_read_format(chan, ast_best_codec(chan->nativeformats), 0);
+							res = ast_set_read_format(chan, ast_best_codec(chan->nativeformats));
 							if (res)
 								ast_log(LOG_WARNING, "Unable to set read format to %d\n", ast_best_codec(chan->nativeformats));
 						}
 						if (!res) {
-							ast_set_write_format(chan, ast_best_codec(chan->nativeformats), 0);
+							ast_set_write_format(chan, ast_best_codec(chan->nativeformats));
 							if (res)
 								ast_log(LOG_WARNING, "Unable to set write format to %d\n", ast_best_codec(chan->nativeformats));
 						}

Index: chan_h323.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_h323.c,v
retrieving revision 1.39
retrieving revision 1.40
diff -u -d -r1.39 -r1.40
--- chan_h323.c	5 Apr 2004 20:45:14 -0000	1.39
+++ chan_h323.c	6 Apr 2004 22:17:31 -0000	1.40
@@ -923,7 +923,7 @@
     f.mallocd = 0;
     f.src = "SEND_DIGIT";
    	
-	return ast_queue_frame(p->owner, &f, 1);	
+	return ast_queue_frame(p->owner, &f);	
 }
 
 /**
@@ -1215,7 +1215,7 @@
 
 	/* Send hangup */	
 	if (p->owner)
-		ast_queue_hangup(p->owner, 1);
+		ast_queue_hangup(p->owner);
 
 	p = NULL;
 	return;	

Index: chan_iax.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax.c,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- chan_iax.c	27 Mar 2004 07:41:33 -0000	1.54
+++ chan_iax.c	6 Apr 2004 22:17:31 -0000	1.55
@@ -839,10 +839,6 @@
 	/* Assumes lock for callno is already held... */
 	for (;;) {
 		pass++;
-		if (!ast_mutex_trylock(&iaxsl[callno])) {
-			ast_log(LOG_WARNING, "Lock is not held on pass %d of iax_queue_frame\n", pass);
-			CRASH;
-		}
 		if (iaxs[callno] && iaxs[callno]->owner) {
 			if (ast_mutex_trylock(&iaxs[callno]->owner->lock)) {
 				/* Avoid deadlock by pausing and trying again */
@@ -850,7 +846,7 @@
 				usleep(1);
 				ast_mutex_lock(&iaxsl[callno]);
 			} else {
-				ast_queue_frame(iaxs[callno]->owner, f, 0);
+				ast_queue_frame(iaxs[callno]->owner, f);
 				ast_mutex_unlock(&iaxs[callno]->owner->lock);
 				break;
 			}
@@ -1077,7 +1073,7 @@
 			/* If there's an owner, prod it to give up */
 			owner->pvt->pvt = NULL;
 			owner->_softhangup |= AST_SOFTHANGUP_DEV;
-			ast_queue_hangup(owner, 0);
+			ast_queue_hangup(owner);
 		}
 
 		for (cur = iaxq.head; cur ; cur = cur->next) {
@@ -1516,7 +1512,7 @@
 	return send_command(c->pvt->pvt, AST_FRAME_HTML, subclass, 0, data, datalen, -1);
 }
 
-static int iax_fixup(struct ast_channel *oldchannel, struct ast_channel *newchan, int needlock)
+static int iax_fixup(struct ast_channel *oldchannel, struct ast_channel *newchan)
 {
 	struct chan_iax_pvt *pvt = newchan->pvt->pvt;
 	pvt->owner = newchan;
@@ -3798,7 +3794,7 @@
 						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, 0);
+							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);
 					}
@@ -3981,9 +3977,9 @@
 							ast_verbose(VERBOSE_PREFIX_3 "Format for call is %s\n", ast_getformatname(iaxs[fr.callno]->owner->nativeformats));
 						/* Setup read/write formats properly. */
 						if (iaxs[fr.callno]->owner->writeformat)
-							ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat, 0);	
+							ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat);	
 						if (iaxs[fr.callno]->owner->readformat)
-							ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat, 0);	
+							ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);	
 					}
 				}
 				ast_mutex_lock(&dpcache_lock);

Index: chan_iax2.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_iax2.c,v
retrieving revision 1.118
retrieving revision 1.119
diff -u -d -r1.118 -r1.119
--- chan_iax2.c	6 Apr 2004 15:55:40 -0000	1.118
+++ chan_iax2.c	6 Apr 2004 22:17:31 -0000	1.119
@@ -851,10 +851,6 @@
 	/* Assumes lock for callno is already held... */
 	for (;;) {
 		pass++;
-		if (!ast_mutex_trylock(&iaxsl[callno])) {
-			ast_log(LOG_WARNING, "Lock is not held on pass %d of iax2_queue_frame\n", pass);
-			CRASH;
-		}
 		if (iaxs[callno] && iaxs[callno]->owner) {
 			if (ast_mutex_trylock(&iaxs[callno]->owner->lock)) {
 				/* Avoid deadlock by pausing and trying again */
@@ -862,7 +858,7 @@
 				usleep(1);
 				ast_mutex_lock(&iaxsl[callno]);
 			} else {
-				ast_queue_frame(iaxs[callno]->owner, f, 0);
+				ast_queue_frame(iaxs[callno]->owner, f);
 				ast_mutex_unlock(&iaxs[callno]->owner->lock);
 				break;
 			}
@@ -1229,7 +1225,7 @@
 	if (c) {
 		c->_softhangup |= AST_SOFTHANGUP_DEV;
 		c->pvt->pvt = NULL;
-		ast_queue_hangup(c, 0);
+		ast_queue_hangup(c);
 		pvt->owner = NULL;
 		ast_mutex_lock(&usecnt_lock);
 		usecnt--;
@@ -1302,7 +1298,7 @@
 		if (owner) {
 			/* If there's an owner, prod it to give up */
 			owner->_softhangup |= AST_SOFTHANGUP_DEV;
-			ast_queue_hangup(owner, 0);
+			ast_queue_hangup(owner);
 		}
 
 		for (cur = iaxq.head; cur ; cur = cur->next) {
@@ -1767,17 +1763,15 @@
 	return send_command_locked(PTR_TO_CALLNO(c->pvt->pvt), AST_FRAME_HTML, subclass, 0, data, datalen, -1);
 }
 
-static int iax2_fixup(struct ast_channel *oldchannel, struct ast_channel *newchan, int lock)
+static int iax2_fixup(struct ast_channel *oldchannel, struct ast_channel *newchan)
 {
 	unsigned short callno = PTR_TO_CALLNO(newchan->pvt->pvt);
-	if (lock)
-		ast_mutex_lock(&iaxsl[callno]);
+	ast_mutex_lock(&iaxsl[callno]);
 	if (iaxs[callno])
 		iaxs[callno]->owner = newchan;
 	else
 		ast_log(LOG_WARNING, "Uh, this isn't a good sign...\n");
-	if (lock)
-		ast_mutex_unlock(&iaxsl[callno]);
+	ast_mutex_unlock(&iaxsl[callno]);
 	return 0;
 }
 
@@ -4366,7 +4360,7 @@
 		strncpy(chan2m->context, chan2->context, sizeof(chan2m->context) - 1);
 		strncpy(chan2m->exten, chan2->exten, sizeof(chan2m->exten) - 1);
 		chan2m->priority = chan2->priority;
-		if (ast_do_masquerade(chan2m, 0)) {
+		if (ast_do_masquerade(chan2m)) {
 			ast_log(LOG_WARNING, "Masquerade failed :(\n");
 			ast_hangup(chan2m);
 			return -1;
@@ -4725,7 +4719,7 @@
 								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, 0);
+									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);
 							}
@@ -4914,7 +4908,7 @@
 						} else
 							ast_log(LOG_DEBUG, "Parked call on '%s'\n", iaxs[fr.callno]->owner->bridge->name);
 					} else {
-						if (ast_async_goto(iaxs[fr.callno]->owner->bridge, iaxs[fr.callno]->context, ies.called_number, 1, 1))
+						if (ast_async_goto(iaxs[fr.callno]->owner->bridge, iaxs[fr.callno]->context, ies.called_number, 1))
 							ast_log(LOG_WARNING, "Async goto of '%s' to '%s@%s' failed\n", iaxs[fr.callno]->owner->bridge->name, 
 								ies.called_number, iaxs[fr.callno]->context);
 						else
@@ -4962,9 +4956,9 @@
 						if (iaxs[fr.callno] && iaxs[fr.callno]->owner) {
 							/* Setup read/write formats properly. */
 							if (iaxs[fr.callno]->owner->writeformat)
-								ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat, 0);	
+								ast_set_write_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->writeformat);	
 							if (iaxs[fr.callno]->owner->readformat)
-								ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat, 0);	
+								ast_set_read_format(iaxs[fr.callno]->owner, iaxs[fr.callno]->owner->readformat);	
 							ast_mutex_unlock(&iaxs[fr.callno]->owner->lock);
 						}
 					}

Index: chan_local.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_local.c,v
retrieving revision 1.25
retrieving revision 1.26
diff -u -d -r1.25 -r1.26
--- chan_local.c	20 Mar 2004 13:26:52 -0000	1.25
+++ chan_local.c	6 Apr 2004 22:17:31 -0000	1.26
@@ -112,7 +112,7 @@
 		ast_mutex_lock(&p->lock);
 		goto retrylock;
 	}
-	ast_queue_frame(other, f, 0);
+	ast_queue_frame(other, f);
 	ast_mutex_unlock(&other->lock);
 	p->glaredetect = 0;
 	return 0;
@@ -185,23 +185,20 @@
 	return res;
 }
 
-static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock)
+static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct local_pvt *p = newchan->pvt->pvt;
-	if (needlock)
-		ast_mutex_lock(&p->lock);
+	ast_mutex_lock(&p->lock);
 	if ((p->owner != oldchan) && (p->chan != oldchan)) {
 		ast_log(LOG_WARNING, "old channel wasn't %p but was %p/%p\n", oldchan, p->owner, p->chan);
-		if (needlock)
-			ast_mutex_unlock(&p->lock);
+		ast_mutex_unlock(&p->lock);
 		return -1;
 	}
 	if (p->owner == oldchan)
 		p->owner = newchan;
 	else
 		p->chan = newchan;	
-	if (needlock)
-		ast_mutex_unlock(&p->lock);
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 

Index: chan_mgcp.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_mgcp.c,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- chan_mgcp.c	27 Mar 2004 17:51:22 -0000	1.41
+++ chan_mgcp.c	6 Apr 2004 22:17:31 -0000	1.42
@@ -776,7 +776,7 @@
 
 		transmit_notify_request_with_callerid(sub, tone, ast->callerid);
 		ast_setstate(ast, AST_STATE_RINGING);
-		ast_queue_control(ast, AST_CONTROL_RINGING, 0);
+		ast_queue_control(ast, AST_CONTROL_RINGING);
 
         if (sub->next->owner && strlen(sub->next->cxident) && strlen(sub->next->callid)) {
             /* Put the connection back in sendrecv */
@@ -1016,15 +1016,15 @@
 			if (f->subclass != sub->owner->nativeformats) {
 				ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
 				sub->owner->nativeformats = f->subclass;
-				ast_set_read_format(sub->owner, sub->owner->readformat, 0);
-				ast_set_write_format(sub->owner, sub->owner->writeformat, 0);
+				ast_set_read_format(sub->owner, sub->owner->readformat);
+				ast_set_write_format(sub->owner, sub->owner->writeformat);
 			}
             /* Courtesy fearnor aka alex at pilosoft.com */
             if (sub->parent->dtmfinband) {
 #if 0
                 ast_log(LOG_NOTICE, "MGCP ast_dsp_process\n");
 #endif
-                f = ast_dsp_process(sub->owner, sub->parent->dsp, f, 0);
+                f = ast_dsp_process(sub->owner, sub->parent->dsp, f);
             }
 		}
 	}
@@ -1070,7 +1070,7 @@
 	return res;
 }
 
-static int mgcp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock)
+static int mgcp_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct mgcp_subchannel *sub = newchan->pvt->pvt;
     ast_log(LOG_NOTICE, "mgcp_fixup(%s, %s)\n", oldchan->name, newchan->name);
@@ -1337,7 +1337,7 @@
 				    f = ast_dsp_process(p->owner,p->dsp,f,0);
 				}
 			}
-			ast_queue_frame(p->owner, f, 0);
+			ast_queue_frame(p->owner, f);
 			ast_mutex_unlock(&p->owner->lock);
 		}
 	}
@@ -2664,7 +2664,7 @@
 		p->sub->next->owner->_softhangup |= AST_SOFTHANGUP_DEV;
         if (p->sub->next->owner) {
             p->sub->next->alreadygone = 1;
-            ast_queue_hangup(p->sub->next->owner, 1);
+            ast_queue_hangup(p->sub->next->owner);
         }
 	}
 	return 0;
@@ -2694,7 +2694,7 @@
             }
             /*transmit_notify_request(sub, "aw");*/
             transmit_notify_request(sub, "");
-            ast_queue_control(sub->owner, AST_CONTROL_ANSWER, 1);
+            ast_queue_control(sub->owner, AST_CONTROL_ANSWER);
         }
     } else {
         /* Start switch */
@@ -2748,7 +2748,7 @@
             }
             /*transmit_notify_request(sub, "aw");*/
             transmit_notify_request(sub, "");
-            /*ast_queue_control(sub->owner, AST_CONTROL_ANSWER, 1);*/
+            /*ast_queue_control(sub->owner, AST_CONTROL_ANSWER);*/
         }
     }
 }
@@ -2914,7 +2914,7 @@
                 if ((res = attempt_transfer(p)) < 0) {
                     if (p->sub->next->owner) {
                         sub->next->alreadygone = 1;
-                        ast_queue_hangup(sub->next->owner,1);
+                        ast_queue_hangup(sub->next->owner);
                     }
                 } else if (res) {
                     ast_log(LOG_WARNING, "Transfer attempt failed\n");
@@ -2925,7 +2925,7 @@
                 /* If there is another active call, mgcp_hangup will ring the phone with the other call */
                 if (sub->owner) {
                     sub->alreadygone = 1;
-                    ast_queue_hangup(sub->owner, 1);
+                    ast_queue_hangup(sub->owner);
                 } else {
                     /* SC: verbose level check */
                     if (option_verbose > 2) {
@@ -2956,9 +2956,9 @@
 			f.src = "mgcp";
 			if (sub->owner) {
                 /* XXX MUST queue this frame to all subs in threeway call if threeway call is active */
-				ast_queue_frame(sub->owner, &f, 1);
+				ast_queue_frame(sub->owner, &f);
                 if (sub->next->owner) {
-                    ast_queue_frame(sub->next->owner, &f, 1);
+                    ast_queue_frame(sub->next->owner, &f);
                 }
             }
             if (strstr(p->curtone, "wt") && (ev[0] == 'A')) {

Index: chan_nbs.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_nbs.c,v
retrieving revision 1.5
retrieving revision 1.6
diff -u -d -r1.5 -r1.6
--- chan_nbs.c	20 Mar 2004 07:16:27 -0000	1.5
+++ chan_nbs.c	6 Apr 2004 22:17:31 -0000	1.6
@@ -73,10 +73,10 @@
 	/* If we can't connect, return congestion */
 	if (nbs_connect(p->nbs)) {
 		ast_log(LOG_WARNING, "NBS Connection failed on %s\n", ast->name);
-		ast_queue_control(ast, AST_CONTROL_CONGESTION, 0);
+		ast_queue_control(ast, AST_CONTROL_CONGESTION);
 	} else {
 		ast_setstate(ast, AST_STATE_RINGING);
-		ast_queue_control(ast, AST_CONTROL_ANSWER, 0);
+		ast_queue_control(ast, AST_CONTROL_ANSWER);
 	}
 
 	return 0;

Index: chan_phone.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_phone.c,v
retrieving revision 1.23
retrieving revision 1.24
diff -u -d -r1.23 -r1.24
--- chan_phone.c	15 Mar 2004 07:51:22 -0000	1.23
+++ chan_phone.c	6 Apr 2004 22:17:31 -0000	1.24
@@ -185,7 +185,7 @@
 
 	ioctl(p->fd, PHONE_RING_START,&cid);
 	ast_setstate(ast, AST_STATE_RINGING);
-	ast_queue_control(ast, AST_CONTROL_RINGING, 0);
+	ast_queue_control(ast, AST_CONTROL_RINGING);
 	return 0;
 }
 

Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.332
retrieving revision 1.333
diff -u -d -r1.332 -r1.333
--- chan_sip.c	6 Apr 2004 14:02:47 -0000	1.332
+++ chan_sip.c	6 Apr 2004 22:17:31 -0000	1.333
@@ -510,7 +510,7 @@
 			}
 			if (pkt->owner->owner) {
 				/* XXX Potential deadlocK?? XXX */
-				ast_queue_hangup(pkt->owner->owner, 0);
+				ast_queue_hangup(pkt->owner->owner);
 				ast_mutex_unlock(&pkt->owner->owner->lock);
 			} else {
 				/* If no owner, destroy now */
@@ -560,7 +560,7 @@
 	ast_log(LOG_DEBUG, "Auto destroying call '%s'\n", p->callid);
 	if (p->owner) {
 		ast_log(LOG_WARNING, "Autodestruct on call '%s' with owner in place\n", p->callid);
-		ast_queue_hangup(p->owner, 0);
+		ast_queue_hangup(p->owner);
 	} else {
 		sip_destroy(p);
 	}
@@ -933,7 +933,7 @@
 	if (p->owner) {
 		if (!ast_mutex_trylock(&p->owner->lock)) {
 			ast_log(LOG_NOTICE, "Auto-congesting %s\n", p->owner->name);
-			ast_queue_control(p->owner, AST_CONTROL_CONGESTION, 0);
+			ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 			ast_mutex_unlock(&p->owner->lock);
 		}
 	}
@@ -1381,20 +1381,17 @@
 	return res;
 }
 
-static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock)
+static int sip_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct sip_pvt *p = newchan->pvt->pvt;
-	if (needlock)
-		ast_mutex_lock(&p->lock);
+	ast_mutex_lock(&p->lock);
 	if (p->owner != oldchan) {
 		ast_log(LOG_WARNING, "old channel wasn't %p but was %p\n", oldchan, p->owner);
-		if (needlock)
-			ast_mutex_unlock(&p->lock);
+		ast_mutex_unlock(&p->lock);
 		return -1;
 	}
 	p->owner = newchan;
-	if (needlock)
-		ast_mutex_unlock(&p->lock);
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 
@@ -1680,11 +1677,11 @@
 			if (f->subclass != p->owner->nativeformats) {
 				ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
 				p->owner->nativeformats = f->subclass;
-				ast_set_read_format(p->owner, p->owner->readformat, 0);
-				ast_set_write_format(p->owner, p->owner->writeformat, 0);
+				ast_set_read_format(p->owner, p->owner->readformat);
+				ast_set_write_format(p->owner, p->owner->writeformat);
 			}
             if ((p->dtmfmode & SIP_DTMF_INBAND) && p->vad) {
-                   f = ast_dsp_process(p->owner,p->vad,f,0);
+                   f = ast_dsp_process(p->owner,p->vad,f);
             }
 		}
 	}
@@ -2139,8 +2136,8 @@
 		if (!(p->owner->nativeformats & p->jointcapability)) {
 			ast_log(LOG_DEBUG, "Oooh, we need to change our formats since our peer supports only %d and not %d\n", p->jointcapability, p->owner->nativeformats);
 			p->owner->nativeformats = sip_codec_choose(p->jointcapability);
-			ast_set_read_format(p->owner, p->owner->readformat, 0);
-			ast_set_write_format(p->owner, p->owner->writeformat, 0);
+			ast_set_read_format(p->owner, p->owner->readformat);
+			ast_set_write_format(p->owner, p->owner->writeformat);
 		}
 		if (p->owner->bridge) {
 			/* Turn on/off music on hold if we are holding/unholding */
@@ -4407,7 +4404,7 @@
 		  f.offset = 0;
 		  f.data = buf;
 		  f.datalen = strlen(buf);
-		  ast_queue_frame(p->owner, &f, 0);
+		  ast_queue_frame(p->owner, &f);
 	}
 }
 
@@ -4677,7 +4674,7 @@
                         f.offset = 0;
                         f.data = NULL;
                         f.datalen = 0;
-                        ast_queue_frame(p->owner, &f, 0);
+                        ast_queue_frame(p->owner, &f);
 		}
 	}
 }
@@ -5030,13 +5027,13 @@
 					process_sdp(p, req);
 				if (p->owner) {
 					/* Queue a progress frame */
-					ast_queue_control(p->owner, AST_CONTROL_PROGRESS, 0);
+					ast_queue_control(p->owner, AST_CONTROL_PROGRESS);
 				}
 			}
 			break;
 		case 180:
 			if (p->owner) {
-				ast_queue_control(p->owner, AST_CONTROL_RINGING, 0);
+				ast_queue_control(p->owner, AST_CONTROL_RINGING);
 				if (p->owner->_state != AST_STATE_UP)
 					ast_setstate(p->owner, AST_STATE_RINGING);
 			}
@@ -5046,7 +5043,7 @@
 				/* They got the notify, this is the end */
 				if (p->owner) {
 					ast_log(LOG_WARNING, "Notify answer on an owned channel?\n");
-					ast_queue_hangup(p->owner, 0);
+					ast_queue_hangup(p->owner);
 				} else {
 					if (!p->subscribed) {
 					    p->needdestroy = 1;
@@ -5060,10 +5057,10 @@
 				if (p->owner) {
 					if (p->owner->_state != AST_STATE_UP) {
 						ast_setstate(p->owner, AST_STATE_UP);
-						ast_queue_control(p->owner, AST_CONTROL_ANSWER, 0);
+						ast_queue_control(p->owner, AST_CONTROL_ANSWER);
 					} else {
 						struct ast_frame af = { AST_FRAME_NULL, };
-						ast_queue_frame(p->owner, &af, 0);
+						ast_queue_frame(p->owner, &af);
 					}
 				}
 				p->authtries = 0;
@@ -5152,7 +5149,7 @@
 			break;
 		case 501: /* Not Implemented */
 			if (!strcasecmp(msg, "INVITE"))
-				ast_queue_control(p->owner, AST_CONTROL_CONGESTION, 0);
+				ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 			else
 				ast_log(LOG_WARNING, "Host '%s' does not implement '%s'\n", inet_ntoa(p->sa.sin_addr), msg);
 			break;
@@ -5177,7 +5174,7 @@
 				case 305: /* Use Proxy */
 					parse_moved_contact(p, req);
 					if (p->owner)
-						ast_queue_control(p->owner, AST_CONTROL_BUSY, 0);
+						ast_queue_control(p->owner, AST_CONTROL_BUSY);
 					break;
 				case 487:
 					/* channel now destroyed - dec the inUse counter */
@@ -5192,19 +5189,19 @@
 				case 600: /* Busy everywhere */
 				case 603: /* Decline */
 					if (p->owner)
-						ast_queue_control(p->owner, AST_CONTROL_BUSY, 0);
+						ast_queue_control(p->owner, AST_CONTROL_BUSY);
 					break;
 				case 480: /* Temporarily Unavailable */
 				case 404: /* Not Found */
 				case 410: /* Gone */
 				case 500: /* Server error */
 					if (owner)
-						ast_queue_control(p->owner, AST_CONTROL_CONGESTION, 0);
+						ast_queue_control(p->owner, AST_CONTROL_CONGESTION);
 					break;
 				default:
 					/* Send hangup */	
 					if (owner)
-						ast_queue_hangup(p->owner, 0);
+						ast_queue_hangup(p->owner);
 					break;
 				}
 				/* ACK on invite */
@@ -5401,7 +5398,7 @@
 			}
 			/* Queue NULL frame to prod ast_rtp_bridge if appropriate */
 			if (p->owner)
-				ast_queue_frame(p->owner, &af, 0);
+				ast_queue_frame(p->owner, &af);
 		} else if (sipdebug)
 			ast_verbose("Ignoring this request\n");
 		if (!p->lastinvite) {
@@ -5543,9 +5540,9 @@
 					transfer_to = c->bridge;
 					if (transfer_to) {
 						ast_moh_stop(transfer_to);
-						ast_async_goto(transfer_to,p->context, p->refer_to,1, 1);
+						ast_async_goto(transfer_to,p->context, p->refer_to,1);
 					} else {
-						ast_queue_hangup(p->owner, 0);
+						ast_queue_hangup(p->owner);
 					}
 				}
 				p->gotrefer = 1;
@@ -5566,7 +5563,7 @@
 			ast_rtp_stop(p->vrtp);
 		}
 		if (p->owner)
-			ast_queue_hangup(p->owner, 0);
+			ast_queue_hangup(p->owner);
 		else
 			p->needdestroy = 1;
 		if (p->initreq.len > 0) {
@@ -5600,16 +5597,16 @@
 					if (transfer_to) {
 						/* Don't actually hangup here... */
 						ast_moh_stop(transfer_to);
-						ast_async_goto(transfer_to,p->context, p->refer_to,1, 1);
+						ast_async_goto(transfer_to,p->context, p->refer_to,1);
 					} else
-						ast_queue_hangup(p->owner, 0);
+						ast_queue_hangup(p->owner);
 				}
 			} else {
 				ast_log(LOG_WARNING, "Invalid transfer information from '%s'\n", inet_ntoa(p->recv.sin_addr));
-				ast_queue_hangup(p->owner, 0);
+				ast_queue_hangup(p->owner);
 			}
 		} else if (p->owner)
-			ast_queue_hangup(p->owner, 0);
+			ast_queue_hangup(p->owner);
 		else
 			p->needdestroy = 1;
 		transmit_response(p, "200 OK", req);

Index: chan_skinny.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_skinny.c,v
retrieving revision 1.34
retrieving revision 1.35
diff -u -d -r1.34 -r1.35
--- chan_skinny.c	6 Apr 2004 03:43:43 -0000	1.34
+++ chan_skinny.c	6 Apr 2004 22:17:32 -0000	1.35
@@ -1470,7 +1470,7 @@
     }
 
 	if (l->dnd) {
-		ast_queue_control(ast, AST_CONTROL_BUSY, 0);
+		ast_queue_control(ast, AST_CONTROL_BUSY);
 		return -1;
 	}
    
@@ -1495,7 +1495,7 @@
 // Select the active softkeys
 
 	ast_setstate(ast, AST_STATE_RINGING);
-	ast_queue_control(ast, AST_CONTROL_RINGING, 0);
+	ast_queue_control(ast, AST_CONTROL_RINGING);
 
 	sub->outgoing = 1;
 //    sub->cxmode = SKINNY_CX_RECVONLY;
@@ -1602,8 +1602,8 @@
 			if (f->subclass != sub->owner->nativeformats) {
 				ast_log(LOG_DEBUG, "Oooh, format changed to %d\n", f->subclass);
 				sub->owner->nativeformats = f->subclass;
-				ast_set_read_format(sub->owner, sub->owner->readformat, 0);
-				ast_set_write_format(sub->owner, sub->owner->writeformat, 0);
+				ast_set_read_format(sub->owner, sub->owner->readformat);
+				ast_set_write_format(sub->owner, sub->owner->writeformat);
 			}
 		}
 	}
@@ -1649,7 +1649,7 @@
 	return res;
 }
 
-static int skinny_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock)
+static int skinny_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct skinny_subchannel *sub = newchan->pvt->pvt;
     ast_log(LOG_NOTICE, "skinny_fixup(%s, %s)\n", oldchan->name, newchan->name);
@@ -2141,7 +2141,7 @@
            /* If there is another active call, skinny_hangup will ring the phone with the other call */
            if (sub->owner) {
                sub->alreadygone = 1;
-               ast_queue_hangup(sub->owner, 1);
+               ast_queue_hangup(sub->owner);
            } else {
                ast_log(LOG_WARNING, "Skinny(%s@%s-%d) channel already destroyed\n", 
                            sub->parent->name, sub->parent->parent->name, sub->callid);
@@ -2175,9 +2175,9 @@
 
 		if (sub->owner) {
 			/* XXX MUST queue this frame to all subs in threeway call if threeway call is active */
-			ast_queue_frame(sub->owner, &f, 1);
+			ast_queue_frame(sub->owner, &f);
             if (sub->next->owner) {
-				ast_queue_frame(sub->next->owner, &f, 1);
+				ast_queue_frame(sub->next->owner, &f);
             }
         } else {
 			ast_verbose("No owner: %s\n", s->device->lines->name);

Index: chan_vpb.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_vpb.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -u -d -r1.17 -r1.18
--- chan_vpb.c	5 Apr 2004 05:37:01 -0000	1.17
+++ chan_vpb.c	6 Apr 2004 22:17:32 -0000	1.18
@@ -635,7 +635,7 @@
 	// Problem is that hangup holds p->owner->lock
 	if (f.frametype >= 0 && f.frametype != AST_FRAME_NULL) {
 		if (ast_mutex_trylock(&p->owner->lock)==0)  {
-			ast_queue_frame(p->owner, &f, 0);
+			ast_queue_frame(p->owner, &f);
 			ast_mutex_unlock(&p->owner->lock);
 		} else {
 			ast_verbose("Missed event %d/%d on %s\n",
@@ -1151,7 +1151,7 @@
 		ast_verbose(VERBOSE_PREFIX_3 " VPB Calling %s [t=%d] on %s returned %d\n", s, timeout, ast->name, res); 
 	if (res == 0) {
 		ast_setstate(ast, AST_STATE_RINGING);
-		ast_queue_control(ast,AST_CONTROL_RINGING, 0);		
+		ast_queue_control(ast,AST_CONTROL_RINGING);		
 	}
 
 	pthread_create(&p->readthread, NULL, do_chanreads, (void *)p);
@@ -1456,7 +1456,7 @@
 			// Using trylock here to prevent deadlock when channel is hungup
 			// (ast_hangup() immediately gets lock)
 			if (p->owner && (ast_mutex_trylock(&p->owner->lock)==0) ) {
-				ast_queue_frame(p->owner, fr, 0);
+				ast_queue_frame(p->owner, fr);
 				ast_mutex_unlock(&p->owner->lock);
 				if (option_verbose > 4) {
 					short * data = (short*)readbuf;

Index: chan_zap.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_zap.c,v
retrieving revision 1.201
retrieving revision 1.202
diff -u -d -r1.201 -r1.202
--- chan_zap.c	6 Apr 2004 15:50:18 -0000	1.201
+++ chan_zap.c	6 Apr 2004 22:17:32 -0000	1.202
@@ -640,11 +640,11 @@
 
 	if (p->subs[a].owner) {
 		p->subs[a].owner->fds[0] = p->subs[a].zfd;
-		ast_queue_frame(p->subs[a].owner, &null, 0);
+		ast_queue_frame(p->subs[a].owner, &null);
 	}
 	if (p->subs[b].owner) {
 		p->subs[b].owner->fds[0] = p->subs[b].zfd;
-		ast_queue_frame(p->subs[b].owner, &null, 0);
+		ast_queue_frame(p->subs[b].owner, &null);
 	}
 	
 }
@@ -2554,12 +2554,11 @@
 
 static int zt_indicate(struct ast_channel *chan, int condition);
 
-static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan, int needlock)
+static int zt_fixup(struct ast_channel *oldchan, struct ast_channel *newchan)
 {
 	struct zt_pvt *p = newchan->pvt->pvt;
 	int x;
-	if (needlock)
-		ast_mutex_lock(&p->lock);
+	ast_mutex_lock(&p->lock);
 	ast_log(LOG_DEBUG, "New owner for channel %d is %s\n", p->channel, newchan->name);
 	if (p->owner == oldchan)
 		p->owner = newchan;
@@ -2572,8 +2571,7 @@
 	if (newchan->_state == AST_STATE_RINGING) 
 		zt_indicate(newchan, AST_CONTROL_RINGING);
 	update_conf(p);
-	if (needlock)
-		ast_mutex_unlock(&p->lock);
+	ast_mutex_unlock(&p->lock);
 	return 0;
 }
 
@@ -2930,7 +2928,7 @@
 							/* It hasn't been long enough since the last flashook.  This is probably a bounce on 
 							   hanging up.  Hangup both channels now */
 							if (p->subs[SUB_THREEWAY].owner)
-								ast_queue_hangup(p->subs[SUB_THREEWAY].owner, 0);
+								ast_queue_hangup(p->subs[SUB_THREEWAY].owner);
 							p->subs[SUB_THREEWAY].owner->_softhangup |= AST_SOFTHANGUP_DEV;
 							ast_log(LOG_DEBUG, "Looks like a bounced flash, hanging up both calls on %d\n", p->channel);
 						} else if ((ast->pbx) ||
@@ -3666,7 +3664,7 @@
 	}
 	if (p->dsp && (!p->ignoredtmf || p->callwaitcas || p->busydetect  || p->callprogress) && !index) {
 		/* Perform busy detection. etc on the zap line */
-		f = ast_dsp_process(ast, p->dsp, &p->subs[index].f, 0);
+		f = ast_dsp_process(ast, p->dsp, &p->subs[index].f);
 		if (f) {
 			if ((f->frametype == AST_FRAME_CONTROL) && (f->subclass == AST_CONTROL_BUSY)) {
 				if ((ast->_state == AST_STATE_UP) && !p->outgoing) {
@@ -3713,7 +3711,7 @@
 							ast_verbose(VERBOSE_PREFIX_3 "Redirecting %s to fax extension\n", ast->name);
 						/* Save the DID/DNIS when we transfer the fax call to a "fax" extension */
 						pbx_builtin_setvar_helper(ast,"FAXEXTEN",ast->exten);
-						if (ast_async_goto(ast, ast->context, "fax", 1, 0))
+						if (ast_async_goto(ast, ast->context, "fax", 1))
 							ast_log(LOG_WARNING, "Failed to async goto '%s' into fax of '%s'\n", ast->name, ast->context);
 					} else
 						ast_log(LOG_NOTICE, "Fax detected, but no fax extension\n");
@@ -6365,7 +6363,7 @@
 							digit = e->ring.callednum[i];
 							{
 								struct ast_frame f = { AST_FRAME_DTMF, digit, };
-								ast_queue_frame(pri->pvt[chan]->owner, &f, 0);
+								ast_queue_frame(pri->pvt[chan]->owner, &f);
 							}
 						}
 					}
@@ -6473,7 +6471,7 @@
 	                                        if (pri->pvt[chan] && pri->overlapdial && !pri->pvt[chan]->proceeding) {
 							struct ast_frame f = { AST_FRAME_CONTROL, AST_CONTROL_PROGRESS, };
 							ast_log(LOG_DEBUG, "Queuing frame from PRI_EVENT_PROCEEDING on channel %d span %d\n",chan,pri->pvt[chan]->span);
-							ast_queue_frame(pri->pvt[chan]->owner, &f, 0);
+							ast_queue_frame(pri->pvt[chan]->owner, &f);
 
 							pri->pvt[chan]->proceeding=1;
 						}
@@ -7304,7 +7302,7 @@
 	}
 	for (i=0; i<strlen(number); i++) {
 		struct ast_frame f = { AST_FRAME_DTMF, number[i] };
-		ast_queue_frame(p->owner, &f, 0); 
+		ast_queue_frame(p->owner, &f); 
 	}
 	astman_send_ack(s, m, "ZapDialOffhook");
 	return 0;




More information about the svn-commits mailing list