]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
mod_rayo: preserve old caller ID behavior if display name is not given
authorChris Rienzo <chris.rienzo@grasshopper.com>
Tue, 22 Apr 2014 17:29:43 +0000 (13:29 -0400)
committerChris Rienzo <chris.rienzo@grasshopper.com>
Tue, 22 Apr 2014 17:30:15 +0000 (13:30 -0400)
src/mod/event_handlers/mod_rayo/mod_rayo.c

index 2414f943cc69f46b4ff82834cd117b03c5f12751..c623208d7e64d1ff772b201aa3dc95ebabd49cd4 100644 (file)
@@ -2632,6 +2632,10 @@ static void *SWITCH_THREAD_FUNC rayo_dial_thread(switch_thread_t *thread, void *
                if (!zstr(from_display)) {
                        switch_event_add_header_string(originate_vars, SWITCH_STACK_BOTTOM, "origination_caller_id_name", from_display);
                        switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rayo_call_get_uuid(call)), SWITCH_LOG_DEBUG, "dial: origination_caller_id_name=%s\n", from_display);
+               } else if (scheme == RAYO_URI_SCHEME_TEL && !zstr(from_uri)) {
+                       /* set caller ID name to same as number if telephone number and a name wasn't specified */
+                       switch_event_add_header_string(originate_vars, SWITCH_STACK_BOTTOM, "origination_caller_id_name", from_uri);
+                       switch_log_printf(SWITCH_CHANNEL_UUID_LOG(rayo_call_get_uuid(call)), SWITCH_LOG_DEBUG, "dial: origination_caller_id_name=%s\n", from_uri);
                }
        }
        if (!zstr(dial_timeout_ms) && switch_is_number(dial_timeout_ms)) {