Soporte & Consultoria

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

martes, 18 de julio de 2017

sábado, 15 de julio de 2017

FreePBX custom extension




[from-internal-custom]
exten=>_100,1,Answer()
same=>n,Playback(hello-world)

sábado, 8 de julio de 2017

Google Speech API

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

lunes, 5 de junio de 2017

freepx asterisk service


Saltar al final de los metadatos
Ir al inicio de los metadatos
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 Server
After=mariadb.service
 
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/usr/sbin/fwconsole start -q
ExecStop=/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.service
ln -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.service
freepbx.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 Hooks
Aug 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  5523
Aug 17 09:20:09 firewall.xrobau.com fwconsole[5020]: Running Post-Asterisk Scripts
Aug 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

Ir al inicio de los metadatos
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})

jueves, 11 de mayo de 2017

fix freepbx session permision

This is is fixed   with  a fwconsole chown   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)