add new syntax to uuid_setvar to allow you to unset a var.

New syntax is:
<uuid> <var> [value]

Previously value was required, now if it is omitted it will unset the var.
(MODAPP-167)

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@10381 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Michael Jerris 2008-11-13 20:26:15 +00:00
parent 9d600b5cea
commit 38e54bd39d
1 changed files with 7 additions and 3 deletions

View File

@ -2593,7 +2593,7 @@ SWITCH_STANDARD_API(uuid_flush_dtmf_function)
return SWITCH_STATUS_SUCCESS;
}
#define SETVAR_SYNTAX "<uuid> <var> <value>"
#define SETVAR_SYNTAX "<uuid> <var> [value]"
SWITCH_STANDARD_API(uuid_setvar_function)
{
switch_core_session_t *psession = NULL;
@ -2606,10 +2606,14 @@ SWITCH_STANDARD_API(uuid_setvar_function)
if (!switch_strlen_zero(cmd) && (mycmd = strdup(cmd))) {
argc = switch_separate_string(mycmd, ' ', argv, (sizeof(argv) / sizeof(argv[0])));
if (argc == 3 && !switch_strlen_zero(argv[0])) {
if ((argc == 2 || argc == 3) && !switch_strlen_zero(argv[0])) {
char *uuid = argv[0];
char *var_name = argv[1];
char *var_value = argv[2];
char *var_value = NULL;
if (argc == 3) {
var_value = argv[2];
}
if ((psession = switch_core_session_locate(uuid))) {
switch_channel_t *channel;