[How To] Get Caller ID Override working with DISA

UPDATE: Refer to this post below for proper solution: [How To] Get Caller ID Override working with DISA

Thanks to earlier help from several forum members, we were able to get DISA with Callback setup and working for select staff members.

Post from @lgaetz
DISA combined with a Callback basically eliminates the issue of hacking by spoofing CID.

Our next step was to make sure that the DISA call presented the correct default Caller ID for that staff member. Several staff members have dedicated external numbers.

After months of fighting, we finally figured out that there is a bug in the DISA Caller ID override functionality.

When the “Caller ID Override” is set to “Yes” the system sets the “KEEPCID” variable to “FALSE”. This tells the dialplan not to use the “Caller ID” value that was set.

When “Caller ID Override” is set to “No”, the “KEEPCID” variable gets set to “TRUE”. This seems helpful until we realized that the “Caller ID” value is not passed to the dial plan. Therefore even when adding a “Caller ID” value and setting the “Caller ID Override” to “No” it still did not pass the desired Caller ID .

Thanks to several forum posts, an open FreePBX bug report and other googling, we were able to track down what was going on and work around the bug.

This post is just to share in case someone else runs into this issue as well.

Helpful references that lead us to a workaround:
Post from: @sgelardi
DISA, Caller-ID override on outbound route is not working

Bug Report from: Nicolas Riendeau
DISA’s Caller ID Override setting does not behave as the help text suggests

This is how we resolved the bug and allowed the interface settings to work “as expected”

[extension_custom.conf]

[from-internal-custom]
; If outbound number is dialed from DISA, Fix Caller ID
exten => _NXXZXXXXXX,1,GosubIf($["${DISA}" != ""]?FixDISACallerID,s,1())
exten => _1NXXZXXXXXX,1,GosubIf($["${DISA}" != ""]?FixDISACallerID,s,1())

[FixDISACallerID]
; DISA Caller ID settings are flipped in interface. Fixing with below override
exten => s,1,NoOp(CUSTOM: Use Custom CID for DISA Call. This is a fix for broken GUI setting)
exten => s,n,ExecIf($["${CALLERID(number)}" != ""]?Set(KEEPCID=TRUE):Set(KEEPCID=FALSE))
exten => s,n,NoOp(KEEPCID VALUE: ${KEEPCID})
exten => s,n,Return
3 Likes

Very elegant work around. There is, however, a problem with this that you probably have not exposed in your testing. The lines in from-internal-custom are not executed ahead of the generated dialplan, they are run INSTEAD of the generated dialplan, which means that your outbound calls are now missing the first line of dialplan generated by the PBX.

I see two potential remedies, neither of which I have tested. You could use your code in a dialplan hook or you can create your own context and set the DISA to a custom context that looks like this:

[from-internal-jgiebler]
exten => _.,1,GosubIf($["${DISA}" != ""]?FixDISACallerID,s,1())
exten => _.,n,GoTo(from-internal,${EXTEN},1)
2 Likes

Thanks for the quick replay @lgaetz

So to confirm I understand correctly…
Instead of putting things in [from-internal-custom] I should put them in a custom context and then at the end of the custom context, go to the [from-internal] context.

This is because [from-internal-custom] does not get appended to the dial plan for [from-internal] but instead replaces it.

Is the above restatement correct?

Based on that understanding…
To properly do the DISA Caller ID override, we should instead create a custom context and in the DISA menu, specify that context as the context to use.

Example below. Can you confirm I am understanding correctly?

[extension_custom.conf]

[from-internal-FixDISACallerID]
; DISA Caller ID settings are flipped in interface. Fixing with below override
exten => _.,1,NoOp(CUSTOM: Use Custom CID for DISA Call. This is a fix for broken GUI setting)
exten => _.,n,ExecIf($["${CALLERID(number)}" != ""]?Set(KEEPCID=TRUE):Set(KEEPCID=FALSE))
exten => _.,n,NoOp(KEEPCID VALUE: ${KEEPCID})
exten => _.,n,GoTo(from-internal,${EXTEN},1)

and in the DISA menu set the context to use: from-internal-FixDISACallerID

2 Likes

Looks correct to me, your own testing should confirm.

A post was split to a new topic: Use from-internal-custom or dialplan hook

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.