[asterisk-commits] mmichelson: branch group/CCSS r225173 - in /team/group/CCSS: include/asterisk...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Wed Oct 21 12:05:13 CDT 2009


Author: mmichelson
Date: Wed Oct 21 12:05:09 2009
New Revision: 225173

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=225173
Log:
Fill in function to retrieve device name.


Modified:
    team/group/CCSS/include/asterisk/frame.h
    team/group/CCSS/main/channel.c

Modified: team/group/CCSS/include/asterisk/frame.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/frame.h?view=diff&rev=225173&r1=225172&r2=225173
==============================================================================
--- team/group/CCSS/include/asterisk/frame.h (original)
+++ team/group/CCSS/include/asterisk/frame.h Wed Oct 21 12:05:09 2009
@@ -421,6 +421,9 @@
 /*! Get or set the fax tone detection state of the channel */
 #define AST_OPTION_FAX_DETECT		15
 
+/*! Get the device name from the channel */
+#define AST_OPTION_DEVICE_NAME		16
+
 struct oprmode {
 	struct ast_channel *peer;
 	int mode;

Modified: team/group/CCSS/main/channel.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/channel.c?view=diff&rev=225173&r1=225172&r2=225173
==============================================================================
--- team/group/CCSS/main/channel.c (original)
+++ team/group/CCSS/main/channel.c Wed Oct 21 12:05:09 2009
@@ -7263,7 +7263,18 @@
 
 int ast_channel_get_device_name(struct ast_channel *chan, char *device_name, size_t name_buffer_length)
 {
-	/*XXX STUB */
+	int len = name_buffer_length;
+	char *dash;
+	if (!ast_channel_queryoption(chan, AST_OPTION_DEVICE_NAME, device_name, &len, 0)) {
+		return 0;
+	}
+
+	/* Dang. Do it the old-fashioned way */
+	ast_copy_string(device_name, chan->name, name_buffer_length);
+	if ((dash = strrchr(device_name, '-'))) {
+		*dash = '\0';
+	}
+
 	return 0;
 }
 




More information about the asterisk-commits mailing list