Dialplan Assitance

Hi everyone. I was wondering if someone could help me with a dial plan. The purpose of it is to force the emergency caller ID of an extension if the sip user comes in as: From: Anonymous sip:anonymous@localhost or Contact: Anonymous <sip:[email protected]:5060;

Basically, we have quite a few Cisco ATAs out there and for some reason dialing *67 is still a thing and people try to mask their number. However, *67 on the Cisco changes it to anonymous permanently and is not a one time thing.

I don’t care if a regular call goes out anonymous but it is an issue when they need to dial 911 and it costs us $100 because the 911 call is not validated. This just happened at a restaurant on New Year’s Day.

The call was made, the PBX realized it was extension 300, it knew the proper emergency CID, and it looks like it called out with the proper CID according to the CDR. However our provider charged us and said the trunk id was: “Trunk ID for call: (none provided)” As I said, the initial invite is: │From: “Anonymous” sip:[email protected];

We disable *67 on new installs but I figured there had to be a better way then visit 30 different places and physically log into the device.

I asked chatgpt and it said I could do something like this and adding it to extensions_custom.conf:

[from-internal-custom]
exten => _911,1,Set(CALLERID(name)=${IF($["${SIPCALLID(name)}"="anonymous"]?${EMERGENCYCID(name)}:${CALLERID(name)})}
exten => _911,2,Set(CALLERID(number)=${IF($["${SIPCALLID(name)}"="anonymous"]?${EMERGENCYCID(number)}:${CALLERID(number)})}

exten => _933,1,Set(CALLERID(name)=${IF($["${SIPCALLID(name)}"="anonymous"]?${EMERGENCYCID(name)}:${CALLERID(name)})}
exten => _933,2,Set(CALLERID(number)=${IF($["${SIPCALLID(name)}"="anonymous"]?${EMERGENCYCID(number)}:${CALLERID(number)})}

This is an older FreePBX 12 and is still using chan_sip. Whatever I do I do not see from-internal-custom being called. The box has 2 voice trunks and 2 911 trunks. The outbound route for 911 is marked as emergency and works as expected when *67 is not enabled on the cisco ata.

Any advice would be wonderful. Thanks so much!

Another thing I should mention: When *67 is enabled and I call 933 to test 911 it is reporting I am calling from 720-842-7359 and that is not a number near us or we own. Not sure where it is getting that from.

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