[asterisk-commits] branch oej/test-this-branch r28521 - in /team/oej/test-this-branch: ./ channels/

asterisk-commits at lists.digium.com asterisk-commits at lists.digium.com
Fri May 19 01:50:03 MST 2006


Author: oej
Date: Fri May 19 03:50:02 2006
New Revision: 28521

URL: http://svn.digium.com/view/asterisk?rev=28521&view=rev
Log:
Reset, go

Modified:
    team/oej/test-this-branch/   (props changed)
    team/oej/test-this-branch/channels/chan_local.c
    team/oej/test-this-branch/channels/chan_sip.c

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
    automerge = http://edvina.net/training/

Propchange: team/oej/test-this-branch/
------------------------------------------------------------------------------
--- svnmerge-integrated (original)
+++ svnmerge-integrated Fri May 19 03:50:02 2006
@@ -1,1 +1,1 @@
-/trunk:1-28472
+/trunk:1-28519

Modified: team/oej/test-this-branch/channels/chan_local.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_local.c?rev=28521&r1=28520&r2=28521&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_local.c (original)
+++ team/oej/test-this-branch/channels/chan_local.c Fri May 19 03:50:02 2006
@@ -80,6 +80,7 @@
 static int local_fixup(struct ast_channel *oldchan, struct ast_channel *newchan);
 static int local_sendhtml(struct ast_channel *ast, int subclass, const char *data, int datalen);
 static int local_devicestate(void *data);
+void local_watcher(char *exten, char *context);
 
 /* PBX interface structure for channel registration */
 static const struct ast_channel_tech local_tech = {
@@ -93,6 +94,7 @@
 	.answer = local_answer,
 	.read = local_read,
 	.write = local_write,
+	.write_video = local_write,
 	.exception = local_read,
 	.indicate = local_indicate,
 	.fixup = local_fixup,
@@ -118,21 +120,22 @@
 static AST_LIST_HEAD_STATIC(locals, local_pvt);
 
 /*! \brief Watcher callback for extension state changes in res_features */
-void local_watcher(char *exten, char *context) {
+void local_watcher(char *exten, char *context)
+{
 	if (option_debug > 1)
 		ast_log(LOG_DEBUG, "Got notification of state change for %s@%s\n", exten, context);
 	ast_device_state_changed("local/%s@%s", exten, context);
 	return;
 }
 
-/*! ! \brief Adds devicestate to extensions (for parking mostly) 
-*/
+
+/*! \brief Devicestate for local channels */
 static int local_devicestate(void *data)
 {
 	char *exten;
 	char *context;
 
-	int res = AST_DEVICE_INVALID;
+	int res;
 		
 	exten = ast_strdupa(data);
 	if ((context  = strchr(exten, '@'))) {
@@ -143,9 +146,9 @@
 		ast_log(LOG_DEBUG, "Checking if extension %s@%s exists (devicestate)\n", exten, context);
 	res = ast_exists_extension(NULL, context, exten, 1, NULL);
 	if (!res)
-		return AST_DEVICE_UNAVAILABLE;
+		return AST_DEVICE_NOT_INUSE;
 	else
-		return AST_DEVICE_NOT_INUSE;
+		return AST_DEVICE_INUSE;
 }
 
 static int local_queue_frame(struct local_pvt *p, int isoutbound, struct ast_frame *f, struct ast_channel *us)
@@ -268,12 +271,13 @@
 	/* Just queue for delivery to the other side */
 	ast_mutex_lock(&p->lock);
 	isoutbound = IS_OUTBOUND(ast, p);
-	if (f && (f->frametype == AST_FRAME_VOICE)) 
+	if (f && (f->frametype == AST_FRAME_VOICE || f->frametype == AST_FRAME_VIDEO))
 		check_bridge(p, isoutbound);
 	if (!p->alreadymasqed)
 		res = local_queue_frame(p, isoutbound, f, ast);
 	else {
-		ast_log(LOG_DEBUG, "Not posting to queue since already masked on '%s'\n", ast->name);
+		if (option_debug)
+			ast_log(LOG_DEBUG, "Not posting to queue since already masked on '%s'\n", ast->name);
 		res = 0;
 	}
 	ast_mutex_unlock(&p->lock);

Modified: team/oej/test-this-branch/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/test-this-branch/channels/chan_sip.c?rev=28521&r1=28520&r2=28521&view=diff
==============================================================================
--- team/oej/test-this-branch/channels/chan_sip.c (original)
+++ team/oej/test-this-branch/channels/chan_sip.c Fri May 19 03:50:02 2006
@@ -2041,12 +2041,13 @@
  			if((context = strchr(ext, '@'))) {
 				context++;
 				if (!ast_context_find(context)) {
-					ast_log(LOG_WARNING, "Context %s must exist in regcontext!\n", context);
+					ast_log(LOG_WARNING, "Context %s must exist in regcontext= in sip.conf!\n", context);
 					continue;
 				}
 				ext = strsep(&ext, "@");
 				if (onoff)
-					ast_add_extension(context, 1, ext, 1, NULL, NULL, "Noop",					  ast_strdup(peer->name), free, "SIP");
+					ast_add_extension(context, 1, ext, 1, NULL, NULL, "Noop",
+						 ast_strdup(peer->name), free, "SIP");
 				else
 					ast_context_remove_extension(context, ext, 1, NULL);
 			} else {



More information about the asterisk-commits mailing list