Any way to query the contact manager or phonebook over CLI?

I’d like to automatically add phone numbers from our support tickets to the Freepbx phonebook or contact manager - so that’s one thing I’d like to be able to do from the CLI but another thing would be to first query the phonebook or contact manager to see if a number is already present.
Anyone know if this is possible?

Maybe you can try to use or connect your Ticket system to some CRM.

Ticket System --> CRM (Zoho or Sugar ) --> PBX

There are AGI scripts in php here: Of Robocalls and Whitelists

1 Like

This is almost perfect - thanks - and a huge leg up - only thing is our support ticket numbers are currently stored in phonebook. Should I export them to contact manager?? Is there any benefit to having them in phonebook rather than contact manager?

Phonebook is simpler and significantly easier to integrate with dialplan. Contact Manager is newer, and is the current focus of any dev work. One of the reasons I’ve shared the above scripts was to provide sample methods to integrate contact management with dialplan and to show workable methods for the community to make the move where they can. Apart from dialplan simplicity, I see no advantage to remaining with phonebook.

1 Like

Thanks Lorne. I’ve moved my contacts from Phonebook to contact manager and sadly they’re not being found by callerid superfecta! I’ll move back - it’s a production system so I can’t really spend a lot of time playing at the moment. Might try again later.
(obviously Superfecta IS set to search contact manager now instead of phonebook)

Thanks @lgaetz - Just done a check with the ‘test’ option

Debug is on and set at level: 1
The Original Number: 0739---0843
The Scheme: mobiles
Debugging Enabled, will not stop after first result

Scheme Asked is: mobiles
The DID is: 5555555555
The CNUM is: 0739---0843
The CNAME is: CID Superfecta!

Starting scheme mobiles
 Executing Superfecta Cache
Searching Superfecta Cache ...
result  took 0.0017 seconds.

 Executing Asterisk Phonebook
Searching Asterisk Phonebook ...
result  took 0.0751 seconds.

 Executing FreePBX Contactmanager
'Unknown '
result  took 0.0478 seconds.

 Executing Abandon lookup
Setting CNAM to:Unknown UK Mobile ...
'Unknown UK Mobile'
result  took 0.0004 seconds.

Converting result to UTF-8
Post CID retrieval processing
 Executing Superfecta Cache
CNAM already cached, skipping write.
This scheme would set the caller id to: Unknown

Returned Result would be:Unknown
result took 0.12761116027832 seconds

I’m aware it’s the cache that’s setting the status to unknown, here, but I’m just pointing out that the contact manager search isn’t working.

Hi Noob

Note that if you access the Superfecta tools (tiny wrench) for Contact Manager in Superfecta, you have the option of different return formats:


If you’re storing names in contact manager as display name only without first name and last name, you will see the behavior you describe. You want to change the return format to Display Name.

1 Like

ahhhhh thanks will try.

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