wardmundy
Nerd Uno
- Joined
- Oct 12, 2007
- Messages
- 19,201
- Reaction score
- 5,220
lgaetz: Don't give up on the FreePBX module. It's a good idea. Just use the hook instead of the cleaver.
wardmundy , most of the damage can be contained if you split off posts: 23, 25, 26, 27, 30, 31, 32, 33, 34 to a different thread, that might simplify things considerably. Further module discussion can take place there. You have not convinced me to give up on this module yet, but you have forced me to think of ways to address your concerns.
cd /root
wget http://incrediblepbx.com/install-dialout-cnam.sh
chmod +x install-dialout-cnam.sh
./install-dialout-cnam.sh
./install-dialout-cnam.sh opencnam
Sendrpid of Ext 701 still says NoOtherwise, press Enter to proceed at your own risk...
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Available CallerID Superfecta Lookup Schemes:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter number of desired CallerID Superfecta Lookup Scheme for Outbound Calls: 2
./install-dialout-cnam.sh: line 68: [: 2: unary operator expected
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Installing...
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Successfully reloaded
--2013-09-15 17:29:29-- http://incrediblepbx.com/dialout-cnam.txt
Resolving incrediblepbx.com (incrediblepbx.com)... 74.86.213.25
Connecting to incrediblepbx.com (incrediblepbx.com)|74.86.213.25|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 1076 (1.1K) [text/plain]
Saving to: `dialout-cnam.txt'
100%[================================================================================================================================================>] 1,076 --.-K/s in 0s
2013-09-15 17:29:30 (13.7 MB/s) - `dialout-cnam.txt' saved [1076/1076]
Dialplan reloaded.
All done.
root@incrediblepbx:~#
Otherwise, press Enter to proceed at your own risk...
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Available CallerID Superfecta Lookup Schemes:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter number of desired CallerID Superfecta Lookup Scheme for Outbound Calls: ^C
root@incrediblepbx:~#
#!/bin/bash
PASSWD="raspberry"
VERSION="1.2.1"
..
echo "If you do not agree with these terms and conditions of use, press Ctrl-C now."
echo " "
read -p "Otherwise, press Enter to proceed at your own risk..."
clear
scheme=0
NUMCHOICES=`mysql -uroot -ppassw0rd asterisk -B --skip-column-names -e "SELECT count(source) FROM superfectaconfig where field='order'"`
while [ $scheme -eq 0 ]
do
clear
echo "Available CallerID Superfecta Lookup Schemes:"
mysql -uroot -ppassw0rd asterisk --skip-column-names -e "SELECT value,source FROM superfectaconfig where field='order'"
echo -n "Enter number of desired CallerID Superfecta Lookup Scheme for Outbound Calls: "
read scheme
if [[ $scheme =~ ^[0-9]+$ ]]; then
if [ $scheme -gt $NUMCHOICES ]
then
scheme=0
continue
fi
else
scheme=0
continue
fi
done
clear
#echo $scheme
MYSCHEME=`mysql -uroot -ppassw0rd asterisk -B --skip-column-names -e "SELECT source FROM superfectaconfig where field='order' and value=$scheme"`
#echo $MYSCHEME
CIDSFSCHEME=`php -r "echo base64_encode('$MYSCHEME');"`
#echo $CIDSFSCHEME
echo "Installing..."
mysql -uroot -p$PASSWD asterisk -e "update sip set data='yes' where id='701' and keyword='sendrpid'"
mysql -uroot -p$PASSWD asterisk -e "update freepbx_settings set value='0' where keyword='OUTBOUND_CID_UPDATE'"
mysql -uroot -p$PASSWD asterisk -e "update freepbx_settings set value='0' where keyword='OUTBOUND_DIAL_UPDATE'"
/var/lib/asterisk/bin/module_admin reload
cd /tmp
wget http://incrediblepbx.com/dialout-cnam.txt
sed -i '\:// BEGIN Outbound CNAM Support:,\:// END Outbound CNAM Support:d' /etc/asterisk/extensions_custom.conf
sed -i 's|YmFzZV9EZWZhdWx0|'$CIDSFSCHEME'|' /tmp/dialout-cnam.txt
cat /tmp/dialout-cnam.txt >> /etc/asterisk/extensions_custom.conf
rm dialout-cnam.txt
asterisk -rx "dialplan reload"
echo "All done."
Available CallerID Superfecta Lookup Schemes:
ERROR 1045 (28000): Access denied for user 'root'@'localhost' (using password: YES)
Enter number of desired CallerID Superfecta Lookup Scheme for Outbound Calls: ^C
root@incrediblepbx:~#
PASSWD="raspberry"
VERSION="1.2.2"
..
read -p "Otherwise, press Enter to proceed at your own risk..."
clear
scheme=0
NUMCHOICES=`mysql -uroot -ppassw0rd asterisk -B --skip-column-names -e "SELECT count(source) FROM superfectaconfig where field='order'"`
while [ $scheme -eq 0 ]
do
clear
echo "Available CallerID Superfecta Lookup Schemes:"
mysql -uroot -ppassw0rd asterisk --skip-column-names -e "SELECT value,source FROM superfectaconfig where field='order'"
echo -n "Enter number of desired CallerID Superfecta Lookup Scheme for Outbound Calls: "
read scheme
if [[ $scheme =~ ^[0-9]+$ ]]; then
if [ $scheme -gt $NUMCHOICES ]
then
scheme=0
continue
fi
else
scheme=0
continue
fi
done
clear
#echo $scheme
MYSCHEME=`mysql -uroot -p$PASSWD asterisk -B --skip-column-names -e "SELECT source FROM superfectaconfig where field='order' and value=$scheme"`
#echo $MYSCHEME
CIDSFSCHEME=`php -r "echo base64_encode('$MYSCHEME');"`
#echo $CIDSFSCHEME
echo "Installing..."
mysql -uroot -p$PASSWD asterisk -e "update sip set data='yes' where id='701' and keyword='sendrpid'"
mysql -uroot -p$PASSWD asterisk -e "update freepbx_settings set value='0' where keyword='OUTBOUND_CID_UPDATE'"
mysql -uroot -p$PASSWD asterisk -e "update freepbx_settings set value='0' where keyword='OUTBOUND_DIAL_UPDATE'"
/var/lib/asterisk/bin/module_admin reload
cd /tmp
wget http://incrediblepbx.com/dialout-cnam.txt
sed -i '\:// BEGIN Outbound CNAM Support:,\:// END Outbound CNAM Support:d' /etc/asterisk/extensions_custom.conf
sed -i 's|YmFzZV9EZWZhdWx0|'$CIDSFSCHEME'|' /tmp/dialout-cnam.txt
cat /tmp/dialout-cnam.txt >> /etc/asterisk/extensions_custom.conf
rm dialout-cnam.txt
asterisk -rx "dialplan reload"
echo "All done."
other than that its working, very nice!
Has anyone else tried this? When I use it, it changes my outbound caller-id to what the Superfecta lookup is. So if you call 678-234-5678, it changes your outbound caller-id to 678-234-5678. It does do a lookup of the destination and displays it on my Aastra 9143i phone as it should. What am I doing wrong?
exten => s,n,Set(num2find=${DIAL_NUMBER:-10})
change to
exten => s,n,Set(num2find=${DIAL_NUMBER})
I love that all of the code is now in a single context and override is not req'd, but your script may yet benefit from some tweaks:
CALLERID(num) should be CALLERID(number)*edit* scratch this one, they both workreview my notes from this post, I think you should be backing up both CALLERID(name) and CALLERID(number) and restoring them before your macro finishes.Reconsider the line that truncates the looked up number to 10 digits, it is very north america centric and doesn't do anything that the Superfecta CID rules can't do anyway (and Rrrr confirmed seconds prior to me posting this, IIRC he is in The Netherlands)- You might want to give users the option to choose 'ALL' Superfecta schemes corresponding to an encoded value of "QUxMfEFMTA==" (without quotes)
; Use the 4 lines below for AsteriDex only lookups
;exten => s,n,Set(num2find=${DIAL_NUMBER:-10})
Ver. 1.2.6 working great.
Just one more adjustment while you are adding ALL schemes for Superfecta: to remove ":-10" in case of Asteridex lookup:
Code:; Use the 4 lines below for AsteriDex only lookups ;exten => s,n,Set(num2find=${DIAL_NUMBER:-10})
Just don't uncomment that line if you don't want NANPA-only AsteriDex lookups.
I should have mentioned, but I think it is necessary unset the var CALLERID(name) before calling the superfecta AGI. If the user has the trunk provided lookup source configured, it will use that string and retrun the wrong info.
Did you set sendrpid for the extension from which you make the call in Freepbx?
If you are using the built in Asteridex module for Superfecta, it may be slow because it is doing a search by regular expression (regex). If the numbers in your Asteridex are very clean (i.e. no non-digits, or extension numbers etc) then you could do a simple SELECT ... LIKE search using the generic Database module, I suspect that would speed things up a lot.
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.
Check your inbox!
We’ve sent you an email. Click on the button in the email body to verify your email address – (if you can not find it, check your spam folder).
Upon verification you will be directed to the 3CX setup wizard.