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, 10 de diciembre de 2015

AMI EVENT PHP


 root@asterisk-dominicana:/var/www/monitor#  php 1.php AMIEventName

example  root@asterisk-dominicana:/var/www/monitor# php 1.php DialBegin


<?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);

//if(stristr($result,'HangupRequest')){ //no used
if (preg_match("/\b$argv[1]\b/i", $result, $match)){
$r=explode("\n",$result);

foreach( $r as $key=>$value){

echo " $key : $value\n";

}



continue;


}



}

}

fclose($socket);

?>

Allowing Chrome Mic and Camera with Webrtc

Use your camera and microphone in Chrome

You can use your camera and microphone for sites in Chrome, like Google Hangouts or Skype. Sometimes, you need to give sites permission first.
  1. Open Chrome.
  2. Navigate to a site that wants to use your microphone and camera.
  3. In the dropdown that appears, you have a few options:
    • Allow: This allows the site to use your camera and microphone. You'll see a notice to confirm this. 
    • Block: This prevents the site from using your camera and microphone. Note: Some sites won't work if you choose this option. For example, you might not be able to join a video conference.
       
You can change which sites can use your camera and microphone:
  1. Open Chrome.
  2. In the top right, click the Chrome menu Chrome menu .
  3. Click Settings.
  4. Click Show advanced settings.
  5. In the "Privacy" section, click Content settings.
  6. In the "Media" section, click one of the options:
    • Ask when a site requires access to your camera and microphone: Chrome alerts you whenever a site asks to use to your camera and microphone.
    • Do not allow sites to access your camera and microphone: Automatically deny any site requests to use your camera and microphone.
  7. To remove permissions you already granted to sites, click Manage exceptions. 
Note: If you're using a Chrome device at work or school, your network administrator might set camera and microphone settings for you. In that case, you can't change them here. Learn about using a managed Chrome device.

https://support.google.com/chrome/answer/2693767?hl=en

lunes, 7 de diciembre de 2015

google tts from command line

[google-tts]
exten=>*68,1,Answer()
same=>n,System(wget -q -U Mozilla -O /var/www/tts/${UNIQUEID}.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&client=t&tl=en&q=This is google tts test")
same=>n,System(/usr/bin/sox /var/www/tts/${UNIQUEID}.mp3 -t raw -r 8000 -s -2 -c 1 /var/www/tts/${UNIQUEID}.sln)
same=>n,Wait(1)
same=>n,System(/bin/rm -rf /var/www/tts/${UNIQUEID}.mp3)
same=>n,Wait(1)
same=>n,Playback(/var/www/tts/${UNIQUEID})


wget -q -U Mozilla -O output.mp3 "http://translate.google.com/translate_tts?ie=UTF-8&client=t&tl=en&q= hello world"


[ttsreader]

exten=>*69,1,Answer()
same=>n,System(wget -q -U Mozilla -O /var/www/tts/${UNIQUEID}.ulaw "http://tts.readspeaker.com/a/speak?key=@fe06be53ad0a5f0ddc7779d481e46aec@&audioformat=ulaw&lang=en_us&voice=Male01&text=%22hello+world%22")
same=>n,Wait(1)
same=>n,Playback(/var/www/tts/${UNIQUEID})

domingo, 6 de diciembre de 2015

Array version of AMI event


<?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);

//if(stristr($result,'HangupRequest')){ //not used any more

if (preg_match("/\bDialBegin\b/i", $result, $match)){
$r=explode("\n",$result);

foreach( $r as $key=>$value){

echo " $key : $value\n";

}

continue;

}

}

}

fclose($socket);

?>





sábado, 5 de diciembre de 2015

Asterisk AMI hangup event reader

<?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);

if(stristr($result,'SoftHangupRequest')){

echo  $result;

break;


}

}

}

fclose($socket);

?>
http://www.ibm.com/developerworks/library/os-php-readfiles/

miércoles, 2 de diciembre de 2015

How to install dahdi

DAHDI

The Digium Asterisk Hardware Device Interface, or DAHDI (formerly known as Zaptel), is the software Asterisk uses to interface with telephony hardware. We recommend that you install it even if you have no hardware installed, because DAHDI is a dependency required for building the timing module res_timing_dahdi and is used for Asterisk dialplan applications such as MeetMe().
Another dependency is required for installing DAHDI, and that is the kernel source. It is important that the kernel version being used match exactly that of the kernel source being installed. You can use uname -a to verify the currently running kernel version:
  • CentOS: sudo yum install kernel-devel-`uname -r`
  • Ubuntu: sudo apt-get install linux-headers-`uname -r`
The use of uname -r surrounded by backticks (`) is for filling in the currently running kernel version so the appropriate package is installed.
The following commands show how to install DAHDI-linux-complete 2.4.0+2.4.0. There may be a newer version available by the time you are reading this, so check downloads.asterisk.org first. If there is a newer version available, just replace the version number in the commands:
$ cd ~/src/asterisk-complete/
$ mkdir dahdi
$ cd dahdi/
$ svn co http://svn.asterisk.org/svn/dahdi/linux-complete/tags/2.4.0+2.4.0
$ cd 2.4.0+2.4.0
$ make
$ sudo make install
$ sudo make config
You will need to have Internet access when running the make all command, as it will attempt to download the latest hardware firmware from the Digium servers.

After installing DAHDI, we can move on to installing Asterisk.

http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/installing_how_to_install_it.html

martes, 1 de diciembre de 2015

Fixing the vicidial DB,

 DB issue could case any type of problem as agent not getting calls



mysqlcheck -u root -p --auto-repair --check --optimize --all-databases


password vicidialnow