Soporte & Consultoria

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

jueves, 26 de febrero de 2015

Como solucionar el error 403 Forbidden Goautodial/Vicidia al acceder a los RECORDINGS


nano /etc/httpd/conf.d/goautodial.conf

<Directory "/var/spool/asterisk/monitorDONE">
  Order Deny,Allow
  Deny from all
  #Allow from 127.0.0.1 190.166.139.32
  Allow from all
 Options Indexes FollowSymLinks
Options -Indexes MultiViews
</Directory>

Alias /RECORDINGS /var/spool/asterisk/monitorDONE
Alias /recordings /var/spool/asterisk/monitorDONE


Si queremos solo permitir  X direcion IP usamos Allow from 127.0.0.1 190.166.139.32

Si queremos  permitir acceso a cualquier IP usamos    Allow from all

En mi caso yo comente la primera opcion con # y  permiti acceso a todo el mundo, luego reinicamos apache

TAMBIEN AGREGUE ESTA OPCION  Options -Indexes MultiViews para evitar que puedan acceder directamente a todas las grabaciones o lista de archivos y carpetas.


  service httpd restart

lunes, 23 de febrero de 2015

convirtiendo de wav a mp3 y enviandolo a correo

As an alternative (if all you need is to encode a Wave file to MP3) you can just use LAME to achieve the same results, for example:
lame -b 32 --resample 8 -a <wavefilename> <mp3filename>
LAME can be installed on CentOS painlessly using yum. You'll first need the RPMForge repository:
rpm -Uhv http://apt.sw.be/redhat/el5/en/i386/rpmforge/RPMS/rpmforge-release-0.3.6-1.el5.rf.i386.rpm
Then:
yum install lame

exten=>h,1,GotoIf($["${TOUCH_MIXMONITOR_OUTPUT}"=""]?hangup)

exten=>h,2,System(/usr/bin/lame /var/spool/asterisk/monitor/${TOUCH_MIXMONITOR_OUTPUT}.wav /var/spool/asterisk/monitor/${TOUCH_MIXMONITOR_OUTPUT}.mp3)

exten=>h,3,System(/usr/bin/mpack -s "file you wanted"  /var/spool/asterisk/monitor/${TOUCH_MIXMONITOR_OUTPUT}.mp3 nick.j.black@gmail.com)


exten=>h,4(hangup),Noop()

sábado, 7 de febrero de 2015

passando argumentos a un agi

 exten=>_02,1,agi(/var/lib/asterisk/agi-bin/ivr_system/ivr_system.php,${EXTEN},${CALLERID(num)})


desde php agi

$agi->verbose("this is  exten  $argv[1]  this is callerid $argv[2]");

What is Quality of Service?

How QoS Impacts Your VoIP Calls

As you review your network, you may hear the term QoS. What does it mean - and why should it matter to you?
Networks are capable of using a protocol named Quality of Service (QoS) to prioritize important traffic types. With an unmanaged switch (typically, a consumer-class switch) all network traffic is sent as it is received. No differentiation or fragmentation is assigned to types of traffic or traffic order. This means that as one person is sending a large video file over your network or server, then they will be using up a large portion of the available bandwidth for that application. In turn, it could starve out other applications, such as voice. If someone later picks up the phone to make a call, this call (your voice traffic) will also be transmitted on the same network pipe as the video file.

MP3 tools for Asterisk

http://www.mp3louder.com/  Incremento del Sonido
http://media.io/ Convertidor de  Audio

martes, 3 de febrero de 2015

Google Rss reader

#!/usr/bin/php -q
<?
set_time_limit(30);
require('/var/lib/asterisk/agi-bin/phpagi-2.20/phpagi.php');
#require('conect.php'); //No necesitamos conexion a base de datos
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();

#$result = $agi->get_data('/var/lib/asterisk/sounds/custom/noticias',8000 ,1);   //esta no tiene limite en la entrada pero tiene 8 segundo de timeout
$result = $agi->get_data('welcome',8000 ,1);   //esta no tiene limite en la entrada pero tiene 8 segundo de timeout
$keys = $result['result'];


if($keys==1)

{

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"Titulares \",es");
$xml = simplexml_load_file('http://hoy.com.do/feed/');

foreach ($xml->channel->item as $item){
 
$agi->verbose($item);


$desc=substr($item->description,0,300);

$agi->verbose($desc);

$agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$item->title\",es");

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$desc\",es");


$agi->set_variable("desc",$item->description);

$agi->set_variable("title",$item->title);
}
 }




if($keys==2)

{

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"Precios de los combustibles republica Dominicana\",es");
$xml = simplexml_load_file('http://www.seic.gov.do/rss/combustibles.aspx/');

foreach ($xml->channel->item as $item){
 
$agi->verbose($item);


$desc=substr($item->description,0,300);

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$item->title\",es");

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$desc\",es");


$agi->set_variable("desc",$item->description);

$agi->set_variable("desc",$item->title);
}
 }


if($keys==3)

{

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"Titulares \",es");
$xml = simplexml_load_file('http://listindiario.com.do/rss/eldeporte/');

foreach ($xml->channel->item as $item){
 
$agi->verbose($item);


$desc=substr($item->description,0,300);

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$item->title\",es");

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$item->title\",es");


$agi->set_variable("desc",$item->description);

$agi->set_variable("desc",$item->title);
}
 }





if($keys==4)

{

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"Titulares \",es");
$xml = simplexml_load_file('http://news.google.es/news?cf=all&ned=es&hl=es&topic=t&output=rss');

foreach ($xml->channel->item as $item){
 
$agi->verbose($item);


$desc=substr($item->description,0,300);

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$item->title\",es");

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"$desc\",es");


$agi->set_variable("desc",$item->description);

$agi->set_variable("desc",$item->title);
}
 }



if($keys==0)

{

$agi->exec_goto('agi',4567,1);

}




if($keys=="")

{

$agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"Por favor haga una selección..\",es");
 $agi->exec_goto('agi',4567,1);


}


else  {

 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"Esta opción no es válida. por favor intentelo nuevamente \",es");
 $agi->exec_goto('agi',4567,1);   
}
 $agi->exec_agi("/var/lib/asterisk/agi-bin/google/googletts.agi,\"fin de las noticias hasta luego.\",es");

?>

Asterisk IVR calling card system

#!/usr/bin/php -q
<?
set_time_limit(30);
require('/var/lib/asterisk/agi-bin/phpagi-2.20/phpagi.php');
require('conect.php'); //conection to the DB
error_reporting(E_ALL);
$agi = new AGI();
$agi->answer();


$agi->verbose("this is  exten  $argv[1]  this is callerid $argv[2]");
 $result = $agi->get_data('agent-pass',4000); //4 segundos de timeout acepta cualquier cantidad de numeros

//$result = $agi->get_data('/var/lib/asterisk/agi-bin/ivr-system/sounds/intro',4000 ,4);  //esta opcion solo acepta entrada de  4 digitos maximo

//$result = $agi->get_data('/var/lib/asterisk/sounds/agi/recording_sound/intro',8000);   //esta no tiene limite en la entrada pero tiene 8 segundo de timout





$keys = $result['result'];


$query = mysql_query("SELECT * FROM  `users` WHERE password='$keys' LIMIT 1");


if ($query) {

if($row = mysql_fetch_array($query)) {

$agi->verbose( $row);



$agi->stream_file("/var/lib/asterisk/agi-bin/ivr_system/sounds/thankyou","#");




$result= $agi->get_data('/var/lib/asterisk/agi-bin/ivr_system/sounds/intro',4000); //4 segundos de timeout acepta cualquier cantidad de numeros

$keys = $result['result'];

$agi->verbose($callNum);



$channels="australia";  //trunk name



$agi->exec('DIAL',"SIP/$channels/$keys");



}

else

{   
$agi->stream_file("/var/lib/asterisk/agi-bin/ivr_system/sounds/invalid","#");
$agi->stream_file("/var/lib/asterisk/agi-bin/ivr_system/sounds/goodbye","#");


//$agi->exec_goto('ivr-call',2727,1);


}

}

//$agi->hangup();


[ivr-call]
exten=>_0282091985,1,Set(GLOBAL(LOOPCOUNT)=1)
exten=>_0282091985,2,agi(/var/lib/asterisk/agi-bin/ivr_system/ivr_system.php,${EXTEN},${CALLERID(num)})
same=>n,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
same=>n,verbose(value of ${LOOPCOUNT})
same=>n,GotoIf($[${LOOPCOUNT} > 3]?hangup)
same=>n,Goto(ivr-call,0282091985,1)
same=>n(hangup),Hangup()





;;;using read
exten => 0204,1,Read(NUMBER,/var/lib/asterisk/agi-bin/ivr_system/sounds/intro,11,3) ;numero de 11 digitos eje: 18097143489
same=>n,DIal(SIP/callcentric/${NUMBER},,10)
;exten => 02,n,SayNumber(${NUMBER})


*/
?>


<?
    $dbhost='localhost';
    $dbuser='root';
        $dbpass=12334;
    $dbname='asterisk';

    $db = mysql_connect($dbhost, $dbuser, $dbpass) or die("Couldn't connect to the database.");

    mysql_select_db($dbname) or die("Couldn't select the database");

?>





domingo, 1 de febrero de 2015

Envio Automatico de DTMF

exten=>_*.,1,Noop()
same=>n,Dial(SIP/rapidvox/${EXTEN:1},,M(dtmf))

[macro-dtmf]
exten => s,1,Wait(1)
exten => s,2,SendDTMF(1)
exten => s,3,SendDTMF(2)

MYSQL Asterisk writing

[default]
exten =>_x.,1,System(mysql --user=root --password='123456' asterisk -e 'INSERT INTO `conference`(`conference_id` , `callerid` , `destination` , `conference_room` , `date` )VALUES (NULL ,"${CALLERID(num)}", "${CDR(dst)}", "${UNIQUEID}", NULL)')
exten=>_x.,2,Answer()
same=>n,Noop( echo this is  ${UNIQUEID})
same=>n,ConfBridge(${UNIQUEID})
;exten =>h,1,System(mysql --user=root --password='123456' asterisk -e 'INSERT INTO `conference`(`conference_id` , `callerid` , `destination` , `conference_room` , `date` )VALUES (NULL ,"${CALLERID(num)}", "${CDR(dst)}", "${UNIQUEID}", NULL)')

Asterisk feature code

nano  /etc/asterisk/features.conf

  testfeature => #9,peer,Playback,tt-monkeys  ;Allow both the caller and callee to play
; ;tt-monkeys to the opposite channel

 /etc/asterisk/extensions.conf

[test_feauture_code]
exten =>_412,1,Set(__DYNAMIC_FEATURES=testfeature)
exten=>_412,2,Dial(SIP/102,,Tt)

Now you just can dial  411 and then #9