]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
make yes no on and off all work in privacy app
authorAnthony Minessale <anthony.minessale@gmail.com>
Wed, 4 Mar 2009 21:22:41 +0000 (21:22 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Wed, 4 Mar 2009 21:22:41 +0000 (21:22 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12424 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/applications/mod_dptools/mod_dptools.c

index b81b9616892df8de1ac29115597b5a82d4e30833..12e2f01a5ed9bf38cb8337c4ada6e20866744c09 100644 (file)
@@ -968,17 +968,18 @@ SWITCH_STANDARD_APP(privacy_function)
        } else {
                switch_set_flag(caller_profile, SWITCH_CPF_SCREEN);
 
-               if (!strcasecmp(data, "no")) {
-                       switch_clear_flag(caller_profile, SWITCH_CPF_HIDE_NAME);
-                       switch_clear_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER);
-               } else if (!strcasecmp(data, "yes")) {
-                       switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
-               } else if (!strcasecmp(data, "full")) {
+
+               if (!strcasecmp(data, "full")) {
                        switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
                } else if (!strcasecmp(data, "name")) {
                        switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME);
                } else if (!strcasecmp(data, "number")) {
                        switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER);
+               } else if (switch_true(data)) {
+                       switch_set_flag(caller_profile, SWITCH_CPF_HIDE_NAME | SWITCH_CPF_HIDE_NUMBER);
+               } else if (switch_false(data)) {
+                       switch_clear_flag(caller_profile, SWITCH_CPF_HIDE_NAME);
+                       switch_clear_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER);
                } else {
                        switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "INVALID privacy mode specified. Use a valid mode [no|yes|name|full|number].\n");
                }