CallerID Name Prefix Issue

Status
Not open for further replies.

gflow

Active Member
Aug 25, 2019
262
28
28
Has anybody run into this issue, i’ll give you an example:

If I have two ring groups MAINLINE_RG1 (5500) and MAINLINE_RG2 (5501)

MAINLINE_RG1 (5500) - Rings a few phones for 20 seconds then goes to MAINLINE_RG2 (5501) and rings a few more phones.

If I set the CallerID Name Prefix in 5500 to "RG1" and the CallerID Name Prefix in 5501 to "RG2" when the calls hits the second ring group the CallerID Name Prefix will look like this "RG2#RG1#2394782937". It seems to concat the callerID name prefix. This can get quite messy when we have many ring groups point to each other and doing loops through IVR's etc the callerID name prefix becomes huge and unreadable.

This issue is with the latest master and stable.
 

hfoster

Active Member
Jan 28, 2019
677
80
28
34
Interestingly, I had a request from a customer about something similar yesterday. Instead of a name prefix, they wanted the name to be replaced entirely. The reasoning being that the Yealink phones show Name, then Number underneath, so prefixing the name looks a mess:

'RingGroup#01234567890'
0123467890

Judging from the ring_group LUA, I suspect what would be necessary is to strip off the LHS of any caller_id_name that has a hash in it:


/usr/share/freeswitch/scripts/app/ring_groups/index.lua
Code:
--set the caller id
        if (session:ready()) then
                if (ring_group_cid_name_prefix ~= nil and string.len(ring_group_cid_name_prefix) > 0) then
                        --strip existing prefix
                        for prefix,number in string.gmatch(caller_id_name, "(%w+)#(%w+)$") do
                            caller_id_name = number
                        end
                        session:execute("export", "effective_caller_id_name="..ring_group_cid_name_prefix.."#"..caller_id_name);
                end
                if (ring_group_cid_number_prefix ~= nil and string.len(ring_group_cid_number_prefix) > 0) then
                        session:execute("export", "effective_caller_id_number="..ring_group_cid_number_prefix..caller_id_number);
                end
        end

This is cigarette packet lua, I haven't tested this to see what might happen btw. I think the cleanest solution would be an option to prefix if dropped down a default condition in a ring group, bit more front end work though.
 
Status
Not open for further replies.