[Asterisk-cvs] asterisk/channels chan_local.c, 1.40, 1.41 iax2-parser.c, 1.36, 1.37

markster at lists.digium.com markster at lists.digium.com
Mon Feb 28 00:09:02 CST 2005


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

Modified Files:
	chan_local.c iax2-parser.c 
Log Message:
Fix queue URL passing (bug #3543)


Index: chan_local.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_local.c,v
retrieving revision 1.40
retrieving revision 1.41
diff -u -d -r1.40 -r1.41
--- chan_local.c	14 Feb 2005 23:20:01 -0000	1.40
+++ chan_local.c	28 Feb 2005 06:06:42 -0000	1.41
@@ -139,7 +139,7 @@
 {
 	if (p->alreadymasqed || p->nooptimization)
 		return;
-	if (isoutbound && p->chan && p->chan->_bridge /* Not ast_bridged_channel!  Only go one step! */ && p->owner) {
+	if (isoutbound && p->chan && p->chan->_bridge /* Not ast_bridged_channel!  Only go one step! */ && p->owner && !p->owner->pvt->readq) {
 		/* Masquerade bridged channel into owner */
 		/* Lock everything we need, one by one, and give up if
 		   we can't get everything.  Remember, we'll get another
@@ -152,7 +152,7 @@
 			}
 			ast_mutex_unlock(&(p->chan->_bridge)->lock);
 		}
-	} else if (!isoutbound && p->owner && p->owner->_bridge && p->chan) {
+	} else if (!isoutbound && p->owner && p->owner->_bridge && p->chan && !p->chan->pvt->readq) {
 		/* Masquerade bridged channel into chan */
 		if (!ast_mutex_trylock(&(p->owner->_bridge)->lock)) {
 			if (!ast_mutex_trylock(&p->chan->lock)) {
@@ -233,6 +233,22 @@
 	return res;
 }
 
+static int local_sendhtml(struct ast_channel *ast, int subclass, char *data, int datalen)
+{
+	struct local_pvt *p = ast->pvt->pvt;
+	int res = -1;
+	struct ast_frame f = { AST_FRAME_HTML, };
+	int isoutbound;
+	ast_mutex_lock(&p->lock);
+	isoutbound = IS_OUTBOUND(ast, p);
+	f.subclass = subclass;
+	f.data = data;
+	f.datalen = datalen;
+	res = local_queue_frame(p, isoutbound, &f, ast);
+	ast_mutex_unlock(&p->lock);
+	return res;
+}
+
 static int local_call(struct ast_channel *ast, char *dest, int timeout)
 {
 	struct local_pvt *p = ast->pvt->pvt;
@@ -436,6 +452,8 @@
 		tmp2->pvt->pvt = p;
 		tmp->pvt->send_digit = local_digit;
 		tmp2->pvt->send_digit = local_digit;
+		tmp->pvt->send_html = local_sendhtml;
+		tmp2->pvt->send_html = local_sendhtml;
 		tmp->pvt->call = local_call;
 		tmp2->pvt->call = local_call;
 		tmp->pvt->hangup = local_hangup;

Index: iax2-parser.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/iax2-parser.c,v
retrieving revision 1.36
retrieving revision 1.37
diff -u -d -r1.36 -r1.37
--- iax2-parser.c	12 Feb 2005 18:52:14 -0000	1.36
+++ iax2-parser.c	28 Feb 2005 06:06:42 -0000	1.37
@@ -375,7 +375,9 @@
 		"NULL   ",
 		"IAX    ",
 		"TEXT   ",
-		"IMAGE  " };
+		"IMAGE  ",
+		"HTML   ",
+		"CNG    " };
 	char *iaxs[] = {
 		"(0?)",
 		"NEW    ",
@@ -447,7 +449,7 @@
 		/* Don't mess with mini-frames */
 		return;
 	}
-	if (fh->type > (int)sizeof(frames)/(int)sizeof(frames[0])) {
+	if (fh->type >= (int)sizeof(frames)/(int)sizeof(frames[0])) {
 		snprintf(class2, (int)sizeof(class2), "(%d?)", fh->type);
 		class = class2;
 	} else {




More information about the svn-commits mailing list