https://cloud.google.com/speech/docs/languages
https://cloud.google.com/speech/docs/basics
https://github.com/GoogleCloudPlatform/php-docs-samples/blob/master/speech/quickstart/quickstart.php
https://cloud.google.com/speech/docs/getting-started
https://cloud.google.com/speech/docs/basics
https://cloud.google.com/speech/docs/reference/libraries#client-libraries-usage-php
https://cloud.google.com/speech/docs/
Interactive guide
https://codelabs.developers.google.com/codelabs/cloud-speech-intro/index.html?index=..%2F..%2Findex#0
quick
https://cloud.google.com/speech/docs/reference/libraries
translation
https://cloud.google.com/php/docs/reference/
default credentials
https://github.com/google/google-auth-library-php
https://developers.google.com/identity/protocols/application-default-credentials
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, 8 de julio de 2017
lunes, 5 de junio de 2017
freepx asterisk service
Saltar al final de los metadatos
- Creado por Rob Thomas, modificado por última vez por Andrew Nagy el may 01, 2017
As most distributions have moved to systemd, here's an example startup script that you may customize for your installation.
This has been tested to work on CentOS 7.
Contents of /etc/systemd/system/freepbx.service
[Unit]Description=FreePBX VoIP ServerAfter=mariadb.service[Service]Type=oneshotRemainAfterExit=yesExecStart=/usr/sbin/fwconsole start -qExecStop=/usr/sbin/fwconsole stop -q[Install]WantedBy=multi-user.target |
From there you can enable it so it starts automatically
Note that on Debian 8.1, you need to use After=mysql.service, not After=mariadb.service.
[root@firewall ~]# systemctl enable freepbx.serviceln -s '/etc/systemd/system/freepbx.service' '/etc/systemd/system/multi-user.target.wants/freepbx.service'[root@firewall ~]# |
And then start it yourself if you haven't already
[root@firewall ~]# systemctl start freepbx[root@firewall ~]# |
You can check the output of the startup with the 'systemctl status' command
[root@firewall ~]# systemctl status -l freepbx.servicefreepbx.service - FreePBX VoIP Server Loaded: loaded (/etc/systemd/system/freepbx.service; enabled) Active: active (exited) since Mon 2015-08-17 09:20:09 AEST; 52s ago Process: 5020 ExecStart=/usr/sbin/fwconsole start (code=exited, status=0/SUCCESS) Main PID: 5020 (code=exited, status=0/SUCCESS)Aug 17 09:20:06 firewall.xrobau.com fwconsole[5020]: Running Sysadmin HooksAug 17 09:20:06 firewall.xrobau.com fwconsole[5020]: Starting Asterisk...Aug 17 09:20:06 firewall.xrobau.com fwconsole[5020]: 0/100 [>---------------------------] 0%Aug 17 09:20:07 firewall.xrobau.com fwconsole[5020]: 33/100 [=========>------------------] 33%Aug 17 09:20:08 firewall.xrobau.com fwconsole[5020]: 66/100 [==================>---------] 66%Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: 99/100 [===========================>] 99%Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: 100/100 [============================] 100%Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: Asterisk Started on 5523Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: Running Post-Asterisk ScriptsAug 17 09:20:09 firewall.xrobau.com systemd[1]: Started FreePBX VoIP Server.[root@firewall ~]# |
domingo, 28 de mayo de 2017
Creating and Manipulating Channels from the CLI
- Creado por Rusty Newton el may 02, 2014
Here we'll mention a few commands that allow you to create or manipulate channels at the CLI during runtime.
channel request hangup
Provided by the core, this command simply allows you to request that a specified channel or all channels be hungup.
Usage: channel request hangup <channel>|<all>
Request that a channel be hung up. The hangup takes effect
the next time the driver reads or writes from the channel.
If 'all' is specified instead of a channel name, all channels
will see the hangup request.
An example:
newtonr-laptop*CLI> core show channels Channel Location State Application(Data) SIP/6001-00000001 (None) Up Playback(demo-congrats) 1 active channel newtonr-laptop*CLI> channel request hangup SIP/6001-00000001 Requested Hangup on channel 'SIP/6001-00000001' [May 2 09:51:19] WARNING[7045][C-00000001]: app_playback.c:493 playback_exec: Playback failed on SIP/6001-00000001 for demo-congrats
Here I made a call to an extension calling Playback, then from the CLI I requested that the established channel be hung up. You can see that it hung up in the middle of playing a sound file, so that sound file fails to continue playing.
channel originate
Provided by res_clioriginate.so, this command allows you to create a new channel and have it connect to either a dialplan extension or a specific application.
There are two ways to use this command. A call can be originated between a channel and a specific application, or between a channel and an extension in the dialplan. This is similar to call files or the manager originate action. Calls originated with this command are given a timeout of 30 seconds. Usage1: channel originate <tech/data> application <appname> [appdata] This will originate a call between the specified channel tech/data and the given application. Arguments to the application are optional. If the given arguments to the application include spaces, all of the arguments to the application need to be placed in quotation marks. Usage2: channel originate <tech/data> extension [exten@][context] This will originate a call between the specified channel tech/data and the given extension. If no context is specified, the 'default' context will be used. If no extension is given, the 's' extension will be used.
An example:
newtonr-laptop*CLI> channel originate SIP/6001 extension 9999@somecontext
== Using SIP RTP CoS mark 5
-- Called 6001
-- SIP/6001-00000004 is ringing
> 0x7f0828067710 -- Probation passed - setting RTP source address to 10.24.18.16:4046
-- SIP/6001-00000004 answered
-- Executing [9999@somecontext:1] VoiceMailMain("SIP/6001-00000004", "") in new stack
-- <SIP/6001-00000004> Playing 'vm-login.gsm' (language 'en')
> 0x7f0828067710 -- Probation passed - setting RTP source address to 10.24.18.16:4046
We originated a call to the chan_sip peer 6001 in this case. The extension parameter tells it what extension to connect that channel to once the channel answers. In this case we connect it to an extension calling VoiceMailMain.
channel redirect
Provided by res_clioriginate.so, this command allows you to redirect an existing channel to a dialplan extension.
Usage: channel redirect <channel> <[[context,]exten,]priority>
Redirect an active channel to a specified extension.
An example:
-- Executing [100@from-internal:1] Playback("SIP/6001-00000005", "demo-congrats") in new stack
> 0x7f07ec03e560 -- Probation passed - setting RTP source address to 10.24.18.16:4048
-- <SIP/6001-00000005> Playing 'demo-congrats.gsm' (language 'en')
newtonr-laptop*CLI> channel redirect SIP/6001-00000005 somecontext,9999,1
Channel 'SIP/6001-00000005' successfully redirected to somecontext,9999,1
[May 2 09:56:28] WARNING[7056][C-00000005]: app_playback.c:493 playback_exec: Playback failed on SIP/6001-00000005 for demo-congrats
-- Executing [9999@somecontext:1] VoiceMailMain("SIP/6001-00000005", "") in new stack
-- <SIP/6001-00000005> Playing 'vm-login.gsm' (language 'en')
Here we make a call from SIP/6001 to a 100@from-internal, which results in a call to Playback. After the call is established, we issue a 'channel redirect' to redirect that channel to the extension 9999 in the context 'somecontext'. It is immediately placed into that extension and we hear the VoicemailMain prompt.
miércoles, 24 de mayo de 2017
writing data fron Asterisk to a file using php
<?php
$file="/etc/asterisk/data.txt";
$data=$argv[1]."\n";
$data.="$argv[2]";
file_put_contents("$file", $data,FILE_APPEND);
?>
exten=>_1011,1,Noop()
same=>n,system(php /root/script_write.php ${CHANNEL} ${UNIQUEID})
$file="/etc/asterisk/data.txt";
$data=$argv[1]."\n";
$data.="$argv[2]";
file_put_contents("$file", $data,FILE_APPEND);
?>
exten=>_1011,1,Noop()
same=>n,system(php /root/script_write.php ${CHANNEL} ${UNIQUEID})
jueves, 11 de mayo de 2017
fix freepbx session permision
This is is fixed with a fwconsole chown
[2017-May-11 11:18:02] [PHP-WARNING] (Unknown:0) - Unknown: open(/var/lib/php/session/sess_58fcq9tj2015tvkin9lqo1s6m3, O_RDWR) failed: Permission denied (13)
[2017-May-11 11:18:02] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)
[2017-May-11 11:18:06] [WARNING] (libraries/modulefunctions.legacy.php:7) - Depreciated Function module_getinfo detected in /var/www/html/admin/modules/cxpanel/functions.inc.php on line 52
[2017-May-11 11:18:06] [WARNING] (libraries/modulefunctions.legacy.php:7) - Depreciated Function module_getinfo detected in /var/www/html/admin/modules/cxpanel/functions.inc.php on line 71
[2017-May-11 11:18:06] [PHP-NOTICE] (/var/www/html/admin/modules/sysadmin/functions.inc/general.php:41) - Undefined index: deploymentid
[2017-May-11 11:18:06] [PHP-WARNING] (Unknown:0) - Unknown: open(/var/lib/php/session/sess_58fcq9tj2015tvkin9lqo1s6m3, O_RDWR) failed: Permission denied (13)
[2017-May-11 11:18:06] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)
[2017-May-11 11:18:12] [PHP-WARNING] (Unknown:0) - Unknown: open(/var/lib/php/session/sess_58fcq9tj2015tvkin9lqo1s6m3, O_RDWR) failed: Permission denied (13)
[2017-May-11 11:18:12] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)
amportal chown
[2017-May-11 11:16:39] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)[2017-May-11 11:18:02] [PHP-WARNING] (Unknown:0) - Unknown: open(/var/lib/php/session/sess_58fcq9tj2015tvkin9lqo1s6m3, O_RDWR) failed: Permission denied (13)
[2017-May-11 11:18:02] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)
[2017-May-11 11:18:06] [WARNING] (libraries/modulefunctions.legacy.php:7) - Depreciated Function module_getinfo detected in /var/www/html/admin/modules/cxpanel/functions.inc.php on line 52
[2017-May-11 11:18:06] [WARNING] (libraries/modulefunctions.legacy.php:7) - Depreciated Function module_getinfo detected in /var/www/html/admin/modules/cxpanel/functions.inc.php on line 71
[2017-May-11 11:18:06] [PHP-NOTICE] (/var/www/html/admin/modules/sysadmin/functions.inc/general.php:41) - Undefined index: deploymentid
[2017-May-11 11:18:06] [PHP-WARNING] (Unknown:0) - Unknown: open(/var/lib/php/session/sess_58fcq9tj2015tvkin9lqo1s6m3, O_RDWR) failed: Permission denied (13)
[2017-May-11 11:18:06] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)
[2017-May-11 11:18:12] [PHP-WARNING] (Unknown:0) - Unknown: open(/var/lib/php/session/sess_58fcq9tj2015tvkin9lqo1s6m3, O_RDWR) failed: Permission denied (13)
[2017-May-11 11:18:12] [PHP-WARNING] (Unknown:0) - Unknown: Failed to write session data (files). Please verify that the current setting of session.save_path is correct (/var/lib/php/session)
jueves, 13 de abril de 2017
CID Lookup
[from-cnam]
exten=>_x.,1,Noop( **${CALLERID(name)}** **${CALLERID(num)}**)
;same=>n,GotoIf($["${CALLERID(name)}" != "Unknown"]?valid)
same=>n,GotoIf($["${CALLERID(name)}" != ""]?valid)
same=>n,Set(name=${SHELL(php /var/www/html/cname/cid.php ${CALLERID(num)})})
same=>n,Set(CALLERID(name)=${name})
same=>n(valid),Goto(from-trunk,${EXTEN},1)
<?php
error_reporting(0);
$url=file_get_contents("http://api.everyoneapi.com/v1/phone/$argv[1]?account_sid=AC95f600f22fe04ab9a74a501aed72ff73&auth_token=AU926f2e2d89124cbdaa92f76b1ab7ff27&pretty=true&data=name");
$url=json_decode($url, true);
//print_r($url);
//print_r($url[data][expanded_name]);
if(!$url['data']['expanded_name']) {
echo "Unknow Caller";
exit();
}
foreach($url['data']['expanded_name'] as $key=>$value){
}
$cname=$url['data']['expanded_name']['first'];
$cname.=" ".$url['data']['expanded_name']['last'];
echo $cname;
exit();
?>
exten=>_x.,1,Noop( **${CALLERID(name)}** **${CALLERID(num)}**)
;same=>n,GotoIf($["${CALLERID(name)}" != "Unknown"]?valid)
same=>n,GotoIf($["${CALLERID(name)}" != ""]?valid)
same=>n,Set(name=${SHELL(php /var/www/html/cname/cid.php ${CALLERID(num)})})
same=>n,Set(CALLERID(name)=${name})
same=>n(valid),Goto(from-trunk,${EXTEN},1)
<?php
error_reporting(0);
$url=file_get_contents("http://api.everyoneapi.com/v1/phone/$argv[1]?account_sid=AC95f600f22fe04ab9a74a501aed72ff73&auth_token=AU926f2e2d89124cbdaa92f76b1ab7ff27&pretty=true&data=name");
$url=json_decode($url, true);
//print_r($url);
//print_r($url[data][expanded_name]);
if(!$url['data']['expanded_name']) {
echo "Unknow Caller";
exit();
}
foreach($url['data']['expanded_name'] as $key=>$value){
}
$cname=$url['data']['expanded_name']['first'];
$cname.=" ".$url['data']['expanded_name']['last'];
echo $cname;
exit();
?>
viernes, 7 de abril de 2017
${EXTEN} MANIPULATION
The
${EXTEN} variable properly has the syntax ${EXTEN:x:y}, where x is the starting position and y is the number of digits to return. Given the following dial string:94169671111
${EXTEN:1:3}would contain416${EXTEN:4:7}would contain9671111${EXTEN:-4:4}would start four digits from the end and return four digits, giving us1111${EXTEN:2:-4}would start two digits in and exclude the last four digits, giving us16967${EXTEN:-6:-4}would start six digits from the end and exclude the last four digits, giving us67${EXTEN:1}would give us everything after the first digit, or4169671111(if the number of digits to return is left blank, it will return the entire remaining string)
Suscribirse a:
Comentarios (Atom)