From a806196f79a3e2da48a06d5239aaa77852755b3e Mon Sep 17 00:00:00 2001 From: Jason Parker <jparker@digium.com> Date: Mon, 14 Jun 2010 19:41:43 +0000 Subject: [PATCH] Add option to get untruncated channel name from AGENT function. The "channel" option would chop the channel name at the last '-', which made it useless for something like a channel transfer from the dialplan. The "fullchannel" option will return the channel name as-is. ABE-2218 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@270260 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- channels/chan_agent.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/channels/chan_agent.c b/channels/chan_agent.c index d054bbe9e6..02c1753884 100644 --- a/channels/chan_agent.c +++ b/channels/chan_agent.c @@ -159,6 +159,9 @@ ASTERISK_FILE_VERSION(__FILE__, "$Revision$") <enum name="channel"> <para>The name of the active channel for the Agent (AgentLogin)</para> </enum> + <enum name="fullchannel"> + <para>The untruncated name of the active channel for the Agent (AgentLogin)</para> + </enum> </enumlist> </parameter> </syntax> @@ -2291,6 +2294,10 @@ static int function_agent(struct ast_channel *chan, const char *cmd, char *data, if (tmp) *tmp = '\0'; } + } else if (!strcasecmp(args.item, "fullchannel")) { + if (agent->chan) { + ast_copy_string(buf, agent->chan->name, len); + } } else if (!strcasecmp(args.item, "exten")) { buf[0] = '\0'; } -- GitLab