FYI Incredible PBX 12.0.74 may use deprecated OpenCNAM API

centrex

Member
Joined
Aug 7, 2016
Messages
34
Reaction score
5
Incredible PBX 12.0.74 on CentOS Linux release 7.3.1611 with Asterisk 13.13.1.

OpenCNAM wasn't working for me. When using the GUI module to set up OpenCNAM I noticed it uses a deprecated API call.

Example: Let's say my OpenCNAM SID is AAAAAAAAAA and my AuthToken is X0X0X0X0X0.

If I enter this into the GUI and apply, the pertinent /etc/asterisk/extensions_additional.conf entry where we construct the URL for curl is going to be:

exten => cidlookup_2,n,Set(CALLERID(name)=${CURL(AAAAAAAAAA:X0X0X0X0X0@https://api.opencnam.com/v2/phone/${CALLERID(num)}?format=pbx&ref=freepbx)})

What it needs to be in order to make it work today is more something like:

exten => cidlookup_2,n,Set(CALLERID(name)=${CURL(https://api.opencnam.com/v3/phone/${CALLERID(num)}?account_sid=AAAAAAAAAA&auth_token=X0X0X0X0X0&service-level=plus)})

I edited it manually and no longer had curl timeouts.

But my question now is... How do I prevent the GUI to overwrite it back with bad stuff if I make any kind of changes in the GUI ? Do I need to deactivate the OpenCNAM provider in the GUI, reload, and then manually edit my /etc/asterisk/extensions_additional.conf ?

Or is there a newer version of this module ? Whenever I go "check modules online" it says I am all up to date.
 
Last edited:

Jake

Active Member
Joined
Aug 27, 2010
Messages
419
Reaction score
81
You should be able to add the line:

Code:
exten => cidlookup_2,n,Set(CALLERID(name)=${CURL(https://api.opencnam.com/v3/phone/${CALLERID(num)}?account_sid=AAAAAAAAAA&auth_token=X0X0X0X0X0&service-level=plus)})

To the extensions_override_freepbx.conf file and it will "replace" the incorrect line in extensions_additional.conf. As noted in the discussion you may need to delete extensions.conf and reload to make it permanent.
 

centrex

Member
Joined
Aug 7, 2016
Messages
34
Reaction score
5
I think one has to define the whole context to be replaced. I am not sure a single line replacement in extensions_override_freepbx.conf will work. I will test it later and report back.

I tried to get a newer version of the module and it appears the version we have was the last GPL version of it. They now classify this is a proprietary/paid module, hence no easy access to updates ?!
 

centrex

Member
Joined
Aug 7, 2016
Messages
34
Reaction score
5
Talked to a very helpful guy at OpenCNAM who put me on a different track altogether. Rather than complicate things by haveing a disconnect between the GUI and the config files we simply whitelisted my server's IPv4 address in OpenCNAM and made a super simple custom HTTPS query with the existing module.

Screenshot: http://imgur.com/a/Ig0JU
Ig0JU


The path field populated with

Code:
v3/phone/${CALLERID(num)}
 

Jake

Active Member
Joined
Aug 27, 2010
Messages
419
Reaction score
81
Ohh...I actually have been using Superfecta. I should have pointed that out instead of the FreePBX CID Lookup. I like Superfecta as you can pull from many sources. I have updated my Superfecta OpenCNAM source file from Github. It is up-to-date also, check it out here. If you have trouble let me know.
 
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.
Top