[from-internal-custom]
exten => *37,1,set(tower_1=10.0.0.200)
exten => *37,n,set(ping=${SHELL(ping -c 1 ${tower_1} | grep ttl= | wc -l)})
exten => *37,n,verbose(${ping:0:1})
exten => *37,n,gotoif($["${ping:0:1}" = "1"]?online:offline)
same=>n(online),Playback(demo-thanks)
same=>n,hangup()
same=>n(offline),Playback(im-sorry)
same=>n,hangup()
Soporte & Consultoria
Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita
sábado, 27 de agosto de 2016
jueves, 25 de agosto de 2016
Asterisk sip_header
[sipheader]
exten=>_x.,1,Noop(${SIP_HEADER(TO):5:3})
exten=>_x.,n,Noop(${SIP_HEADER(TO)})
same=>n,Noop(${SIP_HEADER(User-Agent)})
same=>n,Set(CALLERID(num)=${SIP_HEADER(Remote-Party-ID)})
same=>n,Set(pseudodid=${SIP_HEADER(TO)})
same=>n,Set(pseudodid=${CUT(pseudodid,@,1)})
same=>n,Noop(${pseudodid:5})
using diversion header
[sipheader]
exten=>s,1,Noop(${SIP_HEADER(TO):5:3})
exten=>s,n,Noop(${SIP_HEADER(TO)})
same=>n,Noop(${SIP_HEADER(User-Agent)})
same=>n,Set(pseudodid=${SIP_HEADER(Diversion)})
same=>n,Set(pseudodid=${CUT(pseudodid,@,1)})
same=>n,Noop(${pseudodid:5})
same=>n,Goto(from-trunk,${pseudodid:5},1)
exten=>_x.,1,Noop(${SIP_HEADER(TO):5:3})
exten=>_x.,n,Noop(${SIP_HEADER(TO)})
same=>n,Noop(${SIP_HEADER(User-Agent)})
same=>n,Set(CALLERID(num)=${SIP_HEADER(Remote-Party-ID)})
same=>n,Set(pseudodid=${SIP_HEADER(TO)})
same=>n,Set(pseudodid=${CUT(pseudodid,@,1)})
same=>n,Noop(${pseudodid:5})
using diversion header
[sipheader]
exten=>s,1,Noop(${SIP_HEADER(TO):5:3})
exten=>s,n,Noop(${SIP_HEADER(TO)})
same=>n,Noop(${SIP_HEADER(User-Agent)})
same=>n,Set(pseudodid=${SIP_HEADER(Diversion)})
same=>n,Set(pseudodid=${CUT(pseudodid,@,1)})
same=>n,Noop(${pseudodid:5})
same=>n,Goto(from-trunk,${pseudodid:5},1)
lunes, 15 de agosto de 2016
asterik spy avatar
[spy]
exten => s,1,Answer
same=>n,ChanSpy(${chan},Bq) ; channel passed from the url
same=>n,hangup()
exten => s,1,Answer
same=>n,ChanSpy(${chan},Bq) ; channel passed from the url
same=>n,hangup()
<?php
/*parameters */
$param= array("host"=>"localhost","port"=>5038,"trunk"=>"tw0","timeout"=>45);
/*form variables */
$dest=$_GET['dest'];
$cid=$_GET['cid'];
$name=$_GET['name'];
$msg=$_GET['message'];
$chan=$_GET['chan'];
$socket = fsockopen($param['host'],$param['port'], $errno, $errstr,$param['timeout']);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret:1456\r\n\r\n");
$wrets=fgets($socket,128);
echo $wrets;
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: Local/s@spy\r\n" );
fputs($socket, "Application: playback\r\n" );
fputs($socket, "Data: $msg\r\n" );
fputs($socket, "CallerID: $cid\r\n" );
fputs($socket, "Variable: __var1=$src\r\n" );
fputs($socket, "Variable: __chan=$chan\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
/* test url
http://65.18.118.22/dialer/background.php?chan=SIP/1005-00000718&message=/var/www/dialer_upgraded/audio/561fc5964275f
*/
?>
/*parameters */
$param= array("host"=>"localhost","port"=>5038,"trunk"=>"tw0","timeout"=>45);
/*form variables */
$dest=$_GET['dest'];
$cid=$_GET['cid'];
$name=$_GET['name'];
$msg=$_GET['message'];
$chan=$_GET['chan'];
$socket = fsockopen($param['host'],$param['port'], $errno, $errstr,$param['timeout']);
fputs($socket, "Action: Login\r\n");
fputs($socket, "UserName: admin\r\n");
fputs($socket, "Secret:1456\r\n\r\n");
$wrets=fgets($socket,128);
echo $wrets;
fputs($socket, "Action: Originate\r\n" );
fputs($socket, "Channel: Local/s@spy\r\n" );
fputs($socket, "Application: playback\r\n" );
fputs($socket, "Data: $msg\r\n" );
fputs($socket, "CallerID: $cid\r\n" );
fputs($socket, "Variable: __var1=$src\r\n" );
fputs($socket, "Variable: __chan=$chan\r\n" );
fputs($socket, "Async: yes\r\n\r\n" );
fputs($socket, "Action: Logoff\r\n\r\n");
sleep (1);
$wrets=fgets($socket,128);
/* test url
http://65.18.118.22/dialer/background.php?chan=SIP/1005-00000718&message=/var/www/dialer_upgraded/audio/561fc5964275f
*/
?>
$_GET['chan'];=channel where audio will be played, as using B, audio will be played to both channels
If you want to play the audio file to an specific channel only use the
If you want to play the audio file to an specific channel only use the
W optiondomingo, 14 de agosto de 2016
Installing FreePBX 13 on CentOS 6
Initial System Setup
You MUST run all of these commands as the root user!
You MUST disable selinux. selinux can cause strange behavior during the install
Disable selinux
In /etc/sysconfig/selinux , change the following lines:
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/sysconfig/selinux |
reboot, and verify the selinux status by running 'sestatus'. It should say:
SELinux status: disabled |
SELinux did not disable!
Generally /etc/sysconfig/selinux is linked to /etc/selinux/config but in some cases they are separate files. If the above steps do not disable selinux you will need to perform one extra step:
sed -i 's/\(^SELINUX=\).*/\SELINUX=disabled/' /etc/selinux/config
Update Your System
yum -y updateyum -y groupinstall core base "Development Tools" |
Install Additional Required Dependencies
yum install gcc gcc-c++ lynx bison mysql-devel mysql-server php php-mysql php-pear php-mbstring php-xml tftp-server httpd make ncurses-devel libtermcap-devel sendmail sendmail-cf caching-nameserver sox newt-devel libxml2-devel libtiff-devel audiofile-devel gtk2-devel subversion kernel-devel git subversion kernel-devel php-process crontabs cronie cronie-anacron wget vim php-xml uuid-devel libtool sqlite-devel unixODBC mysql-connector-odbc libuuid-devel binutils-devel php-ldap |
IPTables
Keeping IPTables turned off indefinitely is strongly discouraged. You will incur the wrath of high fees and hackers
You must disable the default iptables. You can re-enable it later, once you have made the appropriate changes. Information on iptables can be found with a quick Google search. If iptables is left running, it will (at very least) block you from accessing the web interface.
See the current status:
chkconfig iptables --list |
Disable iptables:
chkconfig --level 0123456 iptables off |
Stop the service (this skips rebooting again):
service iptables stop |
Auto Start MySQL
You must have mysql running for freepbx to operate normally. You need to set it to start at boot time. with the following command:
chkconfig --level 345 mysqld on |
Then start mysqld if you don't plan on rebooting during the installation phase:
service mysqld start |
Auto Start Apache
You will want Apache running, so you can access the FreePBX admin interface, You need to set it to start at boot time. with the following command:
chkconfig --level 345 httpd on |
Then start apache if you don't plan on rebooting during the installation phase:
service httpd start |
Install PearDB
pear channel-update pear.php.netpear install db-1.7.14 |
You may receive a warning:
WARNING: "pear/DB" is deprecated in favor of "pear/MDB2" |
At this time it is safe to ignore that message
Reboot server
reboot |
Install Dependencies for Google Voice (If needed/wanted)
Install iksemel
cd /usr/srcwget https://iksemel.googlecode.com/files/iksemel-1.4.tar.gztar xf iksemel-*.tar.gzcd iksemel-*./configuremakemake install |
Add the Asterisk User
adduser asterisk -M -c "Asterisk User" |
Install and Configure Asterisk
Download Asterisk source files.
cd /usr/srcwget http://downloads.asterisk.org/pub/telephony/dahdi-linux-complete/dahdi-linux-complete-current.tar.gzwget http://downloads.asterisk.org/pub/telephony/libpri/libpri-current.tar.gzwget http://downloads.asterisk.org/pub/telephony/asterisk/asterisk-13-current.tar.gzwget -O jansson.tar.gz https://github.com/akheron/jansson/archive/v2.7.tar.gzwget http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2 |
Compile and install DAHDI and LibPRI
If you don't have any physical hardware you don't need to run these commands, however, it is still suggested to compile the modules, to allow you to add hardware later.
cd /usr/srctar xvfz dahdi-linux-complete-current.tar.gztar xvfz libpri-current.tar.gzrm -f dahdi-linux-complete-current.tar.gz libpri-current.tar.gzcd dahdi-linux-complete-*make allmake installmake configcd /usr/src/libpri-*makemake install |
Compile and install pjproject
If you are doing this on a 32 bit system, please note that you MUST set the following during configure:
--libdir=/usr/lib |
cd /usr/srctar -xjvf pjproject-2.4.tar.bz2rm -f pjproject-2.4.tar.bz2cd pjproject-2.4CFLAGS='-DPJ_HAS_IPV6=1' ./configure --prefix=/usr --enable-shared --disable-sound \--disable-resample --disable-video --disable-opencore-amr --libdir=/usr/lib64make depmakemake install |
Compile and Install jansson
If you are doing this on a 32 bit system, please note that you MUST set the following during configure:
--libdir=/usr/lib |
cd /usr/srctar vxfz jansson.tar.gzrm -f jansson.tar.gzcd jansson-*autoreconf -i./configure --libdir=/usr/lib64makemake install |
Compile and install Asterisk
If you are doing this on a 32 bit system, please note that you MUST set the following during configure:
--libdir=/usr/lib |
cd /usr/srctar xvfz asterisk-13-current.tar.gzrm -f asterisk-13-current.tar.gzcd asterisk-*contrib/scripts/install_prereq install./configure --libdir=/usr/lib64contrib/scripts/get_mp3_source.shmake menuselect |
You will be prompted at the point to pick which modules to build. Most of them will be enabled, but if you want to have MP3 support, you need to manually turn on 'format_mp3' on the first page.

After selecting 'Save & Exit' you can then continue
makemake installmake configldconfig |
Install Asterisk-Extra-Sounds
Note that this installs the (8khz) 'wav' soundfiles and G722 (High Definition 'Wideband') audio.
mkdir -p /var/lib/asterisk/soundscd /var/lib/asterisk/soundswget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-wav-current.tar.gzwget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-wav-current.tar.gztar xvf asterisk-core-sounds-en-wav-current.tar.gzrm -f asterisk-core-sounds-en-wav-current.tar.gztar xfz asterisk-extra-sounds-en-wav-current.tar.gzrm -f asterisk-extra-sounds-en-wav-current.tar.gz# Wideband Audio downloadwget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-core-sounds-en-g722-current.tar.gzwget http://downloads.asterisk.org/pub/telephony/sounds/asterisk-extra-sounds-en-g722-current.tar.gztar xfz asterisk-core-sounds-en-g722-current.tar.gzrm -f asterisk-core-sounds-en-g722-current.tar.gztar xfz asterisk-extra-sounds-en-g722-current.tar.gzrm -f asterisk-extra-sounds-en-g722-current.tar.gz |
Set ownership permissions
If you are doing this on a 32 bit system, please note that you MUST set the following during configure:
chown -R asterisk. /usr/lib/asterisk |
chown -R asterisk. /var/run/asteriskchown -R asterisk. /etc/asteriskchown -R asterisk. /var/{lib,log,spool}/asteriskchown -R asterisk. /usr/lib64/asteriskchown -R asterisk. /var/www/ |
A few small modifications to Apache.
sed -i 's/\(^upload_max_filesize = \).*/\120M/' /etc/php.inised -i 's/^\(User\|Group\).*/\1 asterisk/' /etc/httpd/conf/httpd.confsed -i 's/AllowOverride None/AllowOverride All/' /etc/httpd/conf/httpd.confservice httpd restart |
Install and Configure FreePBX
Download and extract FreePBX.
cd /usr/srcwget http://mirror.freepbx.org/modules/packages/freepbx/freepbx-13.0-latest.tgztar xfz freepbx-13.0-latest.tgzrm -f freepbx-13.0-latest.tgzcd freepbx./start_asterisk start./install -n |
That's it!
You can now start using FreePBX. Open up your web browser and connect to the IP address or hostname of your new FreePBX server. You will see the Admin setup page, which is where you set your 'admin' account password, and configure an email address to receive update notifications.
We hope you enjoy using FreePBX 13!
Install and Setup Commercial Modules
[Optional] Additional Installation Steps
If you wish to use Commercial Modules you will need to perform the additional steps below.
Enable the FreePBX Commercial yum repos
wget -P /etc/yum.repos.d/ -N http://yum.schmoozecom.net/schmooze-commercial/schmooze-commercial.repo |
yum clean all to clean out yum cache so it will find out new RPMs
yum clean all |
yum install needed RPMs for Commercial Modules
yum -y install php-5.3-zend-guard-loader sysadmin fail2ban incron ImageMagick |
Ensure you have the right mirrors to download and obtain commercial modules
/var/lib/asterisk/bin/freepbx_setting MODULE_REPO http://mirror1.freepbx.org,http://mirror2.freepbx.org |
Restart Apache and Install Sysadmin
service httpd restartfwconsole ma download sysadminfwconsole ma install sysadmin |
Suscribirse a:
Comentarios (Atom)