sorvani / freepbx-helper-scripts Goto Github PK
View Code? Open in Web Editor NEWAssorted scripts and files that work with FreePBX
License: GNU General Public License v3.0
Assorted scripts and files that work with FreePBX
License: GNU General Public License v3.0
Hello,
I was having a look through ContactManager_to_Yealink_AddressBook/cm_to_yl_ab.php
to look for some inspiration on feeding freepbx data to Yealink, and noticed that unsanitised $_GET
data is fed directly into an SQL string.
On line 33:
$contact_manager_group = isset($_GET['cgroup']) ? $_GET['cgroup'] : "SomeName"; // <-- Edit "SomeName" to make your own default
Is then used on line 55:
$sql = "SELECT ... WHERE cg.name = '$contact_manager_group') ...;";
Then prepared/executed on lines 58/59.
I'd suggest minimally using the ?
placeholder and bind_param()
to prevent SQL string manipulation.
Hi,
I got an error executing your code on http://192.XXX.XX.XXX/cm_to_yl_ab.php when CM is empty
I'm using FreeBPX 15 with and php7.3
error on line 3 at column 22: Opening and ending tag mismatch: CompanyIPPhoneDirectory line 0 and DirectoryEntry
And when contacts are created in CM, I got a PDOException
The png are attached. Can you help me to debug, please?
Thanks.
The location of the AMP variables has moved to /etc/asterisk/extensions_additional.conf and a space has been added before and after the equal sign in those variables.
Hope this helps anyone that's upgraded.
Tried to create account on mangolassi.it but it seems the robot detection is broken.
I have the directory key mapped to three contact directories (Staff, Rooms, External)... They seem to be working when when I pass the parameters in the URL as expected (Staff%20Directory).
What doesn't seem to be working is that when I look at a record, it will not display the labels for the phones. I did not change this, however, it seems to be displaying a default of sorts (Number1, Number2, Number3). I would like them to have their proper labels on them, and to sort them with extension first in the list. Image attached.
To clarify, the file produced does look correct, but it is not labelling them on the Yealink side? Using EPM...
Cxxxi +14xxxx +14xxxxx 3222ContactManager_to_Yealink_AddressBook/cm_to_yl_ab.php is no longer able to pull contacts from ContactManager as of FreePBX 17 with the way it's currently configured.
It's now triggering the below:
Whoops\Exception\ErrorException thrown with message "Undefined variable $username"
Stacktrace:
#4 Whoops\Exception\ErrorException in /var/www/html/admin/libraries/gui_auth.php:21
#3 Whoops\Run:handleError in /var/www/html/admin/libraries/gui_auth.php:21
#2 require in /var/www/html/admin/bootstrap.php:275
#1 require_once in /etc/freepbx.conf:12
#0 require_once in /var/www/html/contacts/contacts_friends.php:49
To me it looks like something I'll need to chase up with Sangoma/the FreePBX community to poke at, and if I knew how the hell to fix this, I would, but figured I'd raise this for someone to poke at anyway.
The XML phone book generated by cm_to_yl_ab.php
doesn't seem to work on any of our T58 phones. We also use two dozen T33 and T54 models which are configured the exact same way and those work, so the PHP should be configured right. The error message reads "Cannot download remote phonebook!" which implies a connection issue, but the T58s use the exact same network and can successfully register to our PBX. Opening the remote phone book's URL in the T58's built in web browser does work and yields the nicely formatted XML, so it can't be a connection issue.
Do the T58s use different XML tag names or another format entirely? I couldn't find anything about it in the PHP script's documentation, nor in the phone's manuals.
Hi,
unfortunately the variable $agi_arg_1
does not seem to be set on freepbx 15.
Therefore the trunk failure message looks like this:
The call was attempted from channel [PJSIP/101-00000162] using the trunk [].
It would be really nice to know the trunk which failed at a glance. Any ideas how to fix this?
Not an issue
Sorvani, can I contact you in some way to discuss cm_to_somethingelse_ab script modifications ?
I no longer see you active in Freepbx community forum
Could you contact me relicstrat at gmail dot com please ?
Or any other method is ok for you.
Thank you
Hi,
I am using your yealink script. Thank you for that.
You offered to modify your script in a post on the FreePBX forums to output Gigaset xml.
Here is link to the description of the xml file:
https://teamwork.gigaset.com/gigawiki/pages/viewpage.action?pageId=902955346
and this would be a download link:
https://teamwork.gigaset.com/gigawiki/download/attachments/902955346/N870LocalPhonebook%201999%20Contacts.xml?version=1&modificationDate=1556199175000&api=v2
Could you please offer a script for that, too?
Thanks, Sebastian
Hi,
The output of the script (cm_to_yl_ab.php) only output a single number, not the other numbers that are entered in the contact in FreePBX.
I'm not looking in the phone, but in the XML in my browser.
I'm probably missing something, but not sure what.
The "AddressBook" tag is mis-spelled in the Grandstream php code. The Grandstream phones (at least the 21xx series) see the generated xml as invalid.
File: freepbx-helper-scripts/Extensions_to_Grandstream_Phonebook/generate_gs_phonebook.php
After correcting the spelling, the phones see it as valid xml and are able to properly ingest it.
Hello,
Just had a chance to play around with https://github.com/sorvani/freepbx-helper-scripts/blob/master/ContactManager_to_Yealink_AddressBook/cm_to_yl_ab.php and noticed that it does not play well with ampersands.
My fix was to remove it from my contact.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.