]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
allow you to get the privacy bits in the caller_profile
authorBrian West <brian@freeswitch.org>
Wed, 3 Sep 2008 15:20:21 +0000 (15:20 +0000)
committerBrian West <brian@freeswitch.org>
Wed, 3 Sep 2008 15:20:21 +0000 (15:20 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@9414 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/switch_caller.c

index ee730380a0dfb44e2394eccf86a78f79d979033e..bb9b1c2243c5d187dd7249ad03678df4f480837b 100644 (file)
@@ -198,6 +198,15 @@ SWITCH_DECLARE(const char *) switch_caller_get_field_by_name(switch_caller_profi
        if (!strcasecmp(name, "rdnis_numplan")) {
                return switch_core_sprintf(caller_profile->pool, "%u", caller_profile->rdnis_numplan);
        }
+       if (!strcasecmp(name, "screen_bit")) {
+               return switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "true" : "false";
+       }
+       if (!strcasecmp(name, "privacy_hide_name")) {
+               return switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "true" : "false";
+       }
+       if (!strcasecmp(name, "privacy_hide_number")) {
+               return switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "true" : "false";
+       }
        return NULL;
 }
 
@@ -273,13 +282,13 @@ SWITCH_DECLARE(void) switch_caller_profile_event_set_data(switch_caller_profile_
        }
 
        switch_snprintf(header_name, sizeof(header_name), "%s-Screen-Bit", prefix);
-       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "yes" : "no");
+       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_SCREEN) ? "true" : "false");
 
        switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Name", prefix);
-       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "yes" : "no");
+       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NAME) ? "true" : "false");
 
        switch_snprintf(header_name, sizeof(header_name), "%s-Privacy-Hide-Number", prefix);
-       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "yes" : "no");
+       switch_event_add_header_string(event, SWITCH_STACK_BOTTOM, header_name, switch_test_flag(caller_profile, SWITCH_CPF_HIDE_NUMBER) ? "true" : "false");
 }
 
 SWITCH_DECLARE(switch_status_t) switch_caller_extension_clone(switch_caller_extension_t **new_ext, switch_caller_extension_t *orig,