FreePBX / superfecta

Provides simultaneous use of, and complete control over multiple caller id data sources.
http://www.freepbx.org
GNU General Public License v2.0
56 stars 92 forks source link

add new name variable to emails to allow to generate a proper URL #333

Closed alpharesearch closed 2 years ago

alpharesearch commented 3 years ago

This change creates a new variable for the email module that changes the spaces ( ) in the CNAM to plus (+). This is done so that the CNAM can be used in a link. For URLs, the spaces need to be a +or it will cut off the URL.

http://192.168.0.1/cgi-bin/addphonenumber.pl?key=8005551234&val=First+Last

PBX is just a hobby for me and I never programmed in PHP. I use the phonebook to whitelist all calls. All calls that come in go through a challenging process to filter out unwanted spam calls. This works very well. However, my wife doesn't know how to enter the phone number in the phonebook. So I created a link she can click if she wants to add someone new.

!/usr/bin/perl -w

use CGI qw(param); my $key = param("key"); my $val = param("val"); print "Content-type: text/html\n\n"; use Asterisk::Manager; my $astman = new Asterisk::Manager; $astman->user('admin'); $astman->secret('password'); $astman->host('localhost'); $astman->connect || die $astman->error . "\n"; $astman->sendcommand(Action => 'DBPut', Family => 'cidname', Key => "$key", Val => "$val"); my @result = $astman->sendcommand(Event => 'DBGetResponse'); print @result; print "\n"; $astman->disconnect;

creslin287 commented 2 years ago

Hey,

First off, thanks so much for the contribution.

Currently, github for FreePBX is a read only mirror of the code at git.freepbx.org. All code reviews are funneled through that repo, and so you'll need to resubmit there instead for this to move forward.

Best wishes, Matthew Fredrickson