Soporte & Consultoria

Soporte Remoto y Consultoria skype : ambiorixg12.
Nota no se brinda ningun tipo de consulta o soporte fuera del blog de forma gratuita

domingo, 27 de diciembre de 2015

FreePBX Disabling Voicemail standard Prompt



Settings> Voicemail Admin> DialPlan Behaviour uncheck "Disable Standard Prompt"

http://community.freepbx.org/t/do-not-play-please-leave-message-after-tone-voicemail/16654

sábado, 26 de diciembre de 2015

Daily Call counter

Sucessfully conected to the database asterisk
TOTALCLIDDestinationDurationcontextCalldate
2"102" <004368>009142599811431internal2015-12-27 00:52:09

<?php

require_once("func.php");
require_once("setting.php");
$titles=Array("TOTAL","CLID","Destination","Duration","context","Calldate");

$record=array("total","clid","dst","billsec","dcontext","calldate");

$query="select Distinct count(dst) as total,billsec,clid,dst,dcontext,calldate  from cdr where SUBSTRING(calldate,1,10)=curdate() and dcontext like '%internal%' group by src";

$db_con=conect_db($setting[host],$setting[username],$setting[password],"asterisk");

table($titles);

display_records($db_con,$query,$record);


?>




viernes, 25 de diciembre de 2015

Starting fail2ban: ERROR Found no accessible config files for 'filter.d/freepbx' under /etc/fail2ban


Remove fail2ban and make sure  freepbx commercial repo are enables

[root@vultr etc]# yum remove fail2ban


Then install freepbx from the repo called  schmooze-commercial
issue this command


[root@vultr etc]#yum --disablerepo="*" --enablerepo="schmooze-commercial" install fail2ban





[root@vultr etc]# yum repolist
Loaded plugins: fastestmirror, security
Loading mirror speeds from cached hostfile
 * base: mirror.dattobackup.com
 * epel: ftp.osuosl.org
 * extras: mirrors.lga7.us.voxel.net
 * updates: centos.mirror.constant.com
repo id                                                                                repo name                                                                                        

                status
base                                                                                   CentOS-6 - Base                                                                                  

                 6,575
epel                                                                                   Extra Packages for Enterprise Linux 6 - x86_64                                                  

                11,836
extras                                                                                 CentOS-6 - Extras                                                                                

                    48
schmooze-commercial                                                                    schmooze-commercial                                                                              

                   163
updates                                                                                CentOS-6 - Updates                                                                              

                   958
repolist: 19,580


[root@vultr etc]# service fail2ban start

jueves, 24 de diciembre de 2015

Admin Interface logs you out on selection of any menu option



p_lindheimerPhilippe Lindheimer added a comment - 17/Feb/12 7:44 PM
note the permission denied errors? Did you use the scripts to upgrade PHP, that is your problem as php breaks ownership of these for the apache user.
We have updated amportal to fix this (even though it's not a FreePBX issue). If you are up-to-date with framework, executing "amportal chown" should fix the ownership issue.

VoIPTekVoIPTek added a comment - 17/Feb/12 11:30 PM
FYI yes, did update PHP as per Tony using "yum install php *".
The chown did fix the problem on one of the servers.
Thanks!

pmonevpmonev added a comment - 15/Aug/12 9:32 PM
Look at your httpd log files to find messages like this:
[Aug 15 14:06:57 2012|Wed] [error] [192.168.24.139|client] PHP Warning: session_start(): open(/var/lib/php/session/sess_q370hsbon837v7a2cuhvj2r7t7, O_RDWR) failed: Permission denied (13) in /apps/www/amp/docs/admin/config.php on line 71, referer: http://asterisk1.mventix.com/admin/config.php
Then from the terminal do:
rm -f /var/lib/php/session/sess_q370hsbon837v7a2cuhvj2r7t7
Make sure to replace sess_q370hsbon837v7a2cuhvj2r7t7 with the session that is in your log files.
/etc/init.d/httpd restart
That fixed my problem.

miércoles, 23 de diciembre de 2015

Missed call notification and hold and un hold notificator

php missed.php > /dev/null 2 &



#!/usr/bin/php
<?php
require("setting.php");

$socket = fsockopen($host,"5038", $errno, $errstr,10);
      if (!$socket){
        echo "$errstr ($errno)\n";
        }else{
            fputs($socket, "Action: Login\r\n");
            fputs($socket, "UserName: $username\r\n");
            fputs($socket, "Secret: $secret\r\n\r\n");
            fputs($socket, "Action: WaitEvent\r\n");
            fputs($socket, "Action: Logoff\r\n\r\n");

   while(!feof($socket)){

  $result=fread($socket,5000);
  $result.=date("Y-m-d H:i:s");

$events=array("SoftHangupRequest","Hold","Unhold");


foreach($events as $value) {

if (preg_match("/\b$value\b/i", $result, $match)){

if (preg_match("/\bRing\b/i", $result, $match)){

echo $result;



mail("ambiorixg12@gmail.com","You have a missed call",$result);


}



if (preg_match("/\bHold\b/i", $result, $match)){

echo $result;



mail("ambiorixg12@gmail.com","Call is Unhold",$result);


}

if (preg_match("/\bUnhold\b/i", $result, $match)){

echo $result;



mail("ambiorixg12@gmail.com","Caller Has been Onhold",$result);

}


}
continue;


}

}

}

fclose($socket);

?>

martes, 22 de diciembre de 2015

setting random callerid

Easy Hard Way
[rand-cid]
exten=>_x.,1,Noop(Let's change  cid ${CALLERID(num)})
same=>n,Set(cid=${RAND(1000,9999)})
same=>n,Set(area=${EXTEN:1:6})
same=>n,Noop(new cid is ${area}${cid} )
same=>n,Set(CALLERID(num)=${area}${cid})
same=>n,Return(${CALLERID(num)})


[outbound]
exten=>_008.,1,Gosub(rand-cid,${EXTEN:3},1)
same=>n,Dial(SIP/rapidvox/${EXTEN:3})
same=>n,Hangup()


;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
easy way
[random-cid]
exten=>_1nxxnxxxxxx,1,Noop(catching the caller id ${CALLERID(num)})
same=>n,Set(cid=${RAND(1000,9999)})
same=>n,Set(area=${EXTEN:1:6})
same=>n,Noop(new cid is ${area}${cid} )
same=>n,Set(CALLERID(num)=${area}${cid})
same=>n,Dial(SIP/rapidvox/${EXTEN})

Asterisk Rand Function

RAND()

RAND(min,max)
(beginning Asterisk 1.4)
Returns a randomly-generated number between min and max inclusive. The default for min is 0, for max the default is the largest integer supported by the system (usually 2147483647).
; Choose a random number between 1 and 10 (inclusive):
exten => 123,1,Set(coincidence=${RAND(1,10)})

; Game of chance:
exten => 123,1,GotoIf($[${RAND(0,100)} < 25]?won:lost)
exten => won,1,Playback(won)
exten => won,n,Goto(123,1)
exten => lost,1,Playback(lost)
exten => lost,n,Goto(123,1)