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

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 29 16:27:39 CST 2010


Author: mmichelson
Date: Fri Jan 29 16:27:35 2010
New Revision: 244052

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=244052
Log:
Create new configuration option, cc_agent_dialstring.

With this option, one may specify a dialstring to be used
when re-calling the original caller when generic call completion
is used.

See the notes in ccss.conf.sample for more information on the
option. Like all CC configuration options, this may be set
using the CALLCOMPLETION dialplan function as well.


Modified:
    team/group/CCSS/configs/ccss.conf.sample
    team/group/CCSS/include/asterisk/ccss.h
    team/group/CCSS/main/ccss.c

Modified: team/group/CCSS/configs/ccss.conf.sample
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/configs/ccss.conf.sample?view=diff&rev=244052&r1=244051&r2=244052
==============================================================================
--- team/group/CCSS/configs/ccss.conf.sample (original)
+++ team/group/CCSS/configs/ccss.conf.sample Fri Jan 29 16:27:35 2010
@@ -127,3 +127,14 @@
 ; is no callback macro configured.
 ;
 ;callbackmacro=
+;
+; When using an ISDN phone and a generic CC agent, Asterisk is unable
+; to determine the dialstring that should be used when calling back
+; the original caller. Furthermore, if you desire to use any dialstring-
+; specific options, such as distinctive ring, you must set this
+; configuration option. For non-ISDN phones, it is not necessary to
+; set this, since Asterisk can determine the dialstring to use since
+; it is identical to the name of the calling device. By default, there
+; is no cc_agent_dialstring set.
+;
+;cc_agent_dialstring=

Modified: team/group/CCSS/include/asterisk/ccss.h
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/include/asterisk/ccss.h?view=diff&rev=244052&r1=244051&r2=244052
==============================================================================
--- team/group/CCSS/include/asterisk/ccss.h (original)
+++ team/group/CCSS/include/asterisk/ccss.h Fri Jan 29 16:27:35 2010
@@ -286,6 +286,23 @@
  * \retval void
  */
 void ast_set_ccbs_available_timer(struct ast_cc_config_params *config, unsigned int value);
+
+/*!
+ * \since 1.8
+ * \brief Get the cc_agent_dialstirng
+ * \param config The configuration to retrieve the cc_agent_dialstring from
+ * \return The cc_agent_dialstring from this configuration
+ */
+const char *ast_get_cc_agent_dialstring(struct ast_cc_config_params *config);
+
+/*!
+ * \since 1.8
+ * \brief Set the cc_agent_dialstring
+ * \param config The configuration to set the cc_agent_dialstring on
+ * \param value The new cc_agent_dialstring we want to change to
+ * \retval void
+ */
+void ast_set_cc_agent_dialstring(struct ast_cc_config_params *config, const char *const value);
 
 /*!
  * \since 1.8

Modified: team/group/CCSS/main/ccss.c
URL: http://svnview.digium.com/svn/asterisk/team/group/CCSS/main/ccss.c?view=diff&rev=244052&r1=244051&r2=244052
==============================================================================
--- team/group/CCSS/main/ccss.c (original)
+++ team/group/CCSS/main/ccss.c Fri Jan 29 16:27:35 2010
@@ -381,6 +381,7 @@
 	unsigned int cc_max_agents;
 	unsigned int cc_max_monitors;
 	char cc_callback_macro[AST_MAX_EXTENSION];
+	char cc_agent_dialstring[AST_MAX_EXTENSION];
 };
 
 static const unsigned int CC_OFFER_TIMER_DEFAULT = 20u;
@@ -492,6 +493,8 @@
 		value = agent_policy_to_str(ast_get_cc_agent_policy(params));
 	} else if (!strcasecmp(name, "cc_monitor_policy")) {
 		value = monitor_policy_to_str(ast_get_cc_monitor_policy(params));
+	} else if (!strcasecmp(name, "cc_agent_dialstring")) {
+		value = ast_get_cc_agent_dialstring(params);
 	}
 
 	if (!ast_strlen_zero(value)) {
@@ -529,6 +532,8 @@
 		return ast_set_cc_agent_policy(params, str_to_agent_policy(value));
 	} else if (!strcasecmp(name, "cc_monitor_policy")) {
 		return ast_set_cc_monitor_policy(params, str_to_monitor_policy(value));
+	} else if (!strcasecmp(name, "cc_agent_dialstring")) {
+		ast_set_cc_agent_dialstring(params, value);
 	} else if (!strcasecmp(name, "cc_callback_macro")) {
 		ast_set_cc_callback_macro(params, value);
 		return 0;
@@ -565,7 +570,8 @@
 				!strcasecmp(name, "ccbs_available_timer") ||
 				!strcasecmp(name, "cc_max_agents") ||
 				!strcasecmp(name, "cc_max_monitors") ||
-				!strcasecmp(name, "cc_callback_macro"));
+				!strcasecmp(name, "cc_callback_macro") ||
+				!strcasecmp(name, "cc_agent_dialstring"));
 }
 
 void ast_cc_copy_config_params(struct ast_cc_config_params *dest, const struct ast_cc_config_params *src)
@@ -650,6 +656,20 @@
 		return;
 	}
 	config->ccbs_available_timer = value;
+}
+
+const char *ast_get_cc_agent_dialstring(struct ast_cc_config_params *config)
+{
+	return config->cc_agent_dialstring;
+}
+
+void ast_set_cc_agent_dialstring(struct ast_cc_config_params *config, const char *const value)
+{
+	if (ast_strlen_zero(value)) {
+		config->cc_agent_dialstring[0] = '\0';
+	} else {
+		ast_copy_string(config->cc_agent_dialstring, value, sizeof(config->cc_agent_dialstring));
+	}
 }
 
 unsigned int ast_get_cc_max_agents(struct ast_cc_config_params *config)
@@ -2097,8 +2117,8 @@
 {
 	struct ast_cc_agent *agent = data;
 	struct cc_generic_agent_pvt *generic_pvt = agent->private_data;
-	char *interface = ast_strdupa(agent->interface);
-	char *tech;
+	const char *interface = S_OR(ast_get_cc_agent_dialstring(agent->cc_params), ast_strdupa(agent->interface));
+	const char *tech;
 	char *target;
 	int reason;
 	struct ast_channel *chan;




More information about the asterisk-commits mailing list