Soporte & Consultoria

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

miércoles, 8 de noviembre de 2017

a2billing caller id authentication

CLID Enablecid_enableyes

Ask PINcid_askpincode_ifnot_calleridYes
Then add the CID to the customer ( in this case  customer id is1  ) and all calls from my cell pjobe having this caller id will be authenticated automatically





enable direct dialing on a2billing( disabled enter pin)

use_dnid=yes  , number_try=1 , play_audio=no

a2billing rate

_

 A2BILLING 7 DIGITS RATE  EXAMPLE : 3051010

domingo, 5 de noviembre de 2017

a2billing enabled calling card with pin number


inbound calls to

[a2billing-out]
exten => _X.,1,AGI(a2billing.php,1)
exten => _X.,n,Hangup()



a2billing settings


cid_askpincode_ifnot_callerid=yes

use_dni=no

number_try=2

play_audio=yes

this will eneable  the ivr asking for pin # ( card number)

jueves, 2 de noviembre de 2017

restarting freepbx every midnight

crontab -e
@midnight /usr/sbin/fwconsole restart > /root/asterisk-results.txt 2> /root/asterisk-errror.txt


verify crontab -l

miércoles, 1 de noviembre de 2017

recording conference system

  1. [conferencesys]
  2. exten=>_x.,1,Answer()
  3. ;same=>n,System(php /var/www/html/conference/insert.php ${UNIQUEID} ${CDR(billsec)} ${CALLERID(num)} ${UNIQUEID})
  4. same=>n,Set(Id=${SHELL(php /var/www/html/conference/insert.php ${UNIQUEID} ${CDR(billsec)} ${CALLERID(num)} ${UNIQUEID})})
  5. same=>n,Playback(confirm-number-is)
  6. same=>n,Saydigits(${Id})
  7. same=>n,Set(CONFBRIDGE(bridge,record_conference)=yes)
  8. same=>n,Set(CONFBRIDGE(bridge,record_file)=/var/www/html/conference/${UNIQUEID}.wav)
  9. same=>n,Set(CONFBRIDGE(bridge,max_members)=1)
  10. same=>n,ConfBridge(${UNIQUEID})
  11. same=>n,hangup()
  12. exten=>h,1,Noop(${UNIQUEID} ..)
  13. same=>n,Set(path=${SHELL(find /var/www/html/conference -name ${UNIQUEID}*)})
  14. same=>n,System(mysql --user=root --password='1234' conferences -e "update recordings set path='${path:0:-1}',duration='${CDR(billsec)}' where Id='${Id}'")
  15. [listenrec]
  16. exten=>_x.,1,Answer()
  17. same=>n,read(idnum,enter-conf-call-number)
  18. same=>n,Set(Id=${SHELL(mysql --user=root --password='1234' --skip-column-names  conferences -e "select path from recordings where Id='${idnum}'")})
  19. same=>n,Noop(${Id:0:-5})
  20. same=>n,Playback(${Id:0:-5})
  21. <?php
  22. $link = mysqli_connect("localhost", "root", "1234", "conferences");
  23. /* check connection */
  24. if (mysqli_connect_errno()) {
  25.     printf("Connect failed: %s\n", mysqli_connect_error());
  26.     exit();
  27. }
  28. $conf_name=$argv[1];
  29. $duration=$argv[2];
  30. $cid=$argv[3];
  31. $path="/var/www/html/conference/$argv[4]";
  32. $query = "INSERT INTO  `conferences`.`recordings` (
  33. `id` ,
  34. `path` ,
  35. `conference_name` ,
  36. `duration` ,
  37. `callerid` ,
  38. `date` ,
  39. `reserved1` ,
  40. `reserved2`
  41. )
  42. VALUES (
  43. NULL ,  '$path',  '$conf_name',  '$duration',  '$cid',
  44. CURRENT_TIMESTAMP , NULL , NULL
  45. )";
  46. if(mysqli_query($link, $query)) {
  47. printf(mysqli_insert_id($link));
  48. exit();
  49. }
  50. else {
  51.  printf("Error: %s\n", mysqli_error($link));
  52. }
  53. /* close connection */
  54. mysqli_close($link);
  55. ?>
  56. Creating table
CREATE TABLE IF NOT EXISTS `recordings` (
  `id` int(11) NOT NULL AUTO_INCREMENT,
  `path` varchar(150) DEFAULT NULL,
  `conference_name` varchar(20) NOT NULL,
  `duration` varchar(10) NOT NULL,
  `callerid` varchar(20) DEFAULT NULL,
  `date` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
  `reserved1` varchar(20) DEFAULT NULL,
  `reserved2` varchar(20) DEFAULT NULL,
  PRIMARY KEY (`id`),
  UNIQUE KEY `id` (`id`,`conference_name`)
) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=14 ;



RAW Paste Data

martes, 31 de octubre de 2017

Asterisk Project… Asterisk Standard Channel Variables Various application variables

Saltar al final de los metadatos
Ir al inicio de los metadatos
  • ${CURL} - Resulting page content for CURL()
  • ${ENUM} - Result of application EnumLookup()
  • ${EXITCONTEXT} - Context to exit to in IVR menu (Background()) or in the RetryDial() application
  • ${MONITOR} - Set to "TRUE" if the channel is/has been monitored (app monitor())
  • ${MONITOR_EXEC} - Application to execute after monitoring a call
  • ${MONITOR_EXEC_ARGS} - Arguments to application
  • ${MONITOR_FILENAME} - File for monitoring (recording) calls in queue
  • ${QUEUE_PRIO} - Queue priority
  • ${QUEUE_MAX_PENALTY} - Maximum member penalty allowed to answer caller
  • ${QUEUE_MIN_PENALTY} - Minimum member penalty allowed to answer caller
  • ${QUEUESTATUS} - Status of the call, one of: (TIMEOUT | FULL | JOINEMPTY | LEAVEEMPTY | JOINUNAVAIL | LEAVEUNAVAIL)
  • ${QUEUEPOSITION} - When a caller is removed from a queue, his current position is logged in this variable. If the value is 0, then this means that the caller was serviced by a queue member. If non-zero, then this was the position in the queue the caller was in when he left.
  • ${RECORDED_FILE} - Recorded file in record()
  • ${TALK_DETECTED} - Result from talkdetect()
  • ${TOUCH_MONITOR} - The filename base to use with Touch Monitor (auto record)
  • ${TOUCH_MONITOR_PREF} - The prefix for automonitor recording filenames.
  • ${TOUCH_MONITOR_FORMAT} - The audio format to use with Touch Monitor (auto record)
  • ${TOUCH_MONITOR_OUTPUT} - Recorded file from Touch Monitor (auto record)
  • ${TOUCH_MONITOR_MESSAGE_START} - Recorded file to play for both channels at start of monitoring session
  • ${TOUCH_MONITOR_MESSAGE_STOP} - Recorded file to play for both channels at end of monitoring session
  • ${TOUCH_MIXMONITOR} - The filename base to use with Touch MixMonitor (auto record)
  • ${TOUCH_MIXMONITOR_FORMAT} - The audio format to use with Touch MixMonitor (auto record)
  • ${TOUCH_MIXMONITOR_OUTPUT} - Recorded file from Touch MixMonitor (auto record)
  • ${TXTCIDNAME} - Result of application TXTCIDName
  • ${VPB_GETDTMF} - chan_vpb

sábado, 28 de octubre de 2017

asterisk-voicemail-transcription-via-ibm-bluemix-speech-

https://jrklein.com/2015/08/17/asterisk-voicemail-transcription-via-ibm-bluemix-speech-to-text-api/

Microsft TTS

https://docs.microsoft.com/en-us/azure/cognitive-services/speech/concepts

https://azure.microsoft.com/en-us/services/cognitive-services/speech/

https://docs.microsoft.com/en-us/azure/cognitive-services/speech/concepts#recognition-modes

https://docs.microsoft.com/en-us/azure/cognitive-services/speech/getstarted/getstartedrest?tabs=curl

https://docs.microsoft.com/en-us/azure/cognitive-services/speech/api-reference-rest/supportedlanguages


 curl -v -X POST "https://speech.platform.bing.com/speech/recognition/interactive/cognitiveservicdetailed" -H "Transfer-Encoding: chunked" -H "Ocp-Apim-Subscription-Key: 7f4f6dcfa2d34ab7ac05f49dba4f34bbOO" -H "Content-type: audio/wav; codec=audio/pcm; samplerate=16000" --data-binary @hello-world.wav

https://azure.microsoft.com/es-es/try/cognitive-services/?apiSlug=speaker-recognition-api&country=DominicanRepublic&allowContact=true

miércoles, 25 de octubre de 2017

saving recording path on the cdr ( FreePBX)

  1. [macro-record-enable]
  2. include => macro-record-enable-custom
  3. exten => s,1,GotoIf($["${BLINDTRANSFER}" = ""]?check)
  4. exten => s,n,ResetCDR(w)
  5. exten => s,n,StopMixMonitor()
  6. exten => s,n(check),ExecIf($["${ARG1}"=""]?MacroExit())
  7. exten => s,n,GotoIf($["${ARG2}"="Group"]?Group:OUT)
  8. exten => s,n(Group),Set(LOOPCNT=${FIELDQTY(ARG1,-)})
  9. exten => s,n,Set(ITER=1)
  10. exten => s,n(begin),Noop(macro-record-enable group loop begin)
  11. exten => s,n,Set(TEXTEN=${CUT(ARG1,-,${ITER})})
  12. exten => s,n,Set(CALLFILENAME=g${TEXTEN}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
  13. exten => s,n,Goto(record)
  14. exten => s,n(continue),Set(ITER=$[${ITER}+1])
  15. exten => s,n,GotoIf($[${ITER}<=${LOOPCNT}]?begin)
  16. exten => s,n,MacroExit()
  17. exten => s,n(OUT),GotoIf($["${ARG2}"="IN"]?IN)
  18. exten => s,n,Set(CALLFILENAME=OUT${ARG1}-${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
  19. exten => s,n,Goto(record)
  20. exten => s,n(IN),Noop(macro-record-enable IN)
  21. exten => s,n,Set(CALLFILENAME=${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-${UNIQUEID})
  22. exten => s,n(record),MixMonitor(${EVAL(${MIXMON_DIR})}${CALLFILENAME}.${MIXMON_FORMAT},,${MIXMON_POST})
  23. exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME})
  24. exten => s,n,MacroExit()



I modify the recording macro adding the  additional line to  extensions_override_freepbx.conf



I just added this line  exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME})

martes, 24 de octubre de 2017

freepbx extensions_override_freepbx.conf saving on a DB

  1. [from-internal] save Vm on  DB ;save recording  on inbound
  2. exten=>h,1,Noop(${VM_MESSAGEFILE}   )
  3. same=>n,System(php /var/www/html/voicemail/insert.php ${VM_MESSAGEFILE} )
  4. ;same=>n,Set(CDR(accountcode)=00000)
  5. ;same=>n,Set(CDR(userfield)=222)
  6. same=>n,hangup()
  7.  

  1.  
  2. [macro-dialout-trunk] ;save recording  on outbound
  3. include => macro-dialout-trunk-custom
  4. exten => s,1,Set(DIAL_TRUNK=${ARG1})
  5. exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME});; code ${EPOCH},,%Y%m%d-%H%M%S)}
  6.  
  7. [from-did-direct]
  8. exten=>h,1,Set(CDR(userfield)=${MIXMONITOR_FILENAME}) ;save recording  on inbound

lunes, 23 de octubre de 2017

freepbx : failed to open stream: Permission denied

file(/etc/asterisk/asterisk.conf): failed to open stream: Permission denied

Make sure Selinux  is disbaled


[root@vultr ~]# sestatus
SELinux status:                 disabled




sábado, 21 de octubre de 2017

asterisk record

[surf_report]
exten=>_+x.,1,Answer()
same=>n,Set(path=/var/www/html/surf/)
same =>n(2),read(edit,${path}${EXTEN:1},1,,)
same=>n,GotoIf($["${edit}"="5"]?auth)
same=>n,hangup()
same=>n(auth),authenticate(1973)
same=>n(rec),playback(pls-enter-num-message-after-tone)
same=>n,Record(${path}${EXTEN:1}.wav,,,k)
same=>n,playback(${path}${EXTEN:1})
same => n(confirm),read(confirm,press-star-cancel,1,,)
same=>n,GotoIf($["${confirm}"="*"]?rec)
same=>n,Playback(auth-thankyou)
same=>n,hangup()


recording with confirmation

domingo, 15 de octubre de 2017

asterisk pjsip easy installation

sterisk 13.8.0 will come with a new option for enabling PJSIP functionality. This functionality is called bundling and comes courtesy of a community member, George Joseph, who you can also thank for such PJSIP additions as wizards for configuration and the PJSIP_HEADER dialplan function. Before we talk about bundling let’s take a look at the history of PJSIP usage in Asterisk and how we got to where we are today.
PJSIP itself is part of a set of libraries and tools which forms PJPROJECT. Another part is referred to as PJNATH and has been used since Asterisk 11 to provide ICE, STUN, and TURN support in the res_rtp_asterisk module. When Asterisk 11 was released PJPROJECT was embedded in Asterisk itself to make it easier for users to have the new functionality available. When the decision was made to work on a new PJSIP channel driver one of the desires expressed by the community was to remove PJPROJECT from Asterisk and have it be distributed using other mechanisms, such as by the distributions as packages or from a manual install process. Before Asterisk 12 was released this was completed and contributed upstream to Teluu who created PJPROJECT. This has meant that to enable PJSIP support in Asterisk you have needed to install PJPROJECT yourself using some method. As of Asterisk 13.8.0 another simpler option will be available instead: bundling.
Bundling allows a self-contained PJSIP to exist within Asterisk and be used by all functionality within it. It is enabled by passing an option to the configure script:
When you run ./configure, you can set the PJPROJECT_URL environment variable to point to an alternate site.
Example:
# ./configure --with-pjproject-bundled PJPROJECT_URL=http://pjsip.org/release/2.6
When the option is enabled the build process will download a version of PJPROJECT as specified in the bundling configuration, patch it with any changes that may not have yet been published in a PJPROJECT release, build it using the best options suitable for Asterisk, make it available to all the Asterisk PJSIP modules, and make the Asterisk PJSIP modules available for building. This reduces the barrier to entry for using PJSIP to a minimal amount allowing more people to use the new SIP functionality. There is no additional work required except for enabling the option.
While the lower barrier to entry may seem like the only immediate benefit there’s also some internal things that are improved by using bundling. By controlling the version of PJSIP that Asterisk is used against we can ensure that Asterisk will build and work properly against it. We can also ensure that both Asterisk and PJSIP have been built using the same configuration and that the configuration matches the usage required by Asterisk. This can lead to improved performance and reduce crashes.
There’s also no harm in using this new bundled support if you already have PJSIP installed. The PJSIP downloaded and built for Asterisk will only be bundled in Asterisk and not exposed to the rest of your system.

miércoles, 4 de octubre de 2017

sábado, 30 de septiembre de 2017

Asterisk Len & Execif

  1. exten=>001,1,Answer()
    same=>n,Noop(${CALLERID(num)})
    same=>n,Set(ARG1=${CALLERID(num)})
    same=>n,Noop( len of ${LEN(${ARG1})})
    same=>n,ExecIf($[${LEN(${ARG1})}= 11]?Set(CALLERID(num)=${ARG1:0:7}${RAND(1000,9999)}))
    same=>n,ExecIf($[${LEN(${ARG1})}> 11]?Set(CALLERID(num)=${ARG1:0:7}))

jueves, 21 de septiembre de 2017

Asterisk func_odbc

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

viernes, 15 de septiembre de 2017

Difference Between 180 Ringing and 183 Session Progress

Difference Between 180 Ringing and 183 Session Progress

In general, ringing is controlled via two Informational Responses in SIP: the 180 Ringing and the 183 Session Progress.
The main difference between them, is the 180 Ringing message instructs the UA to create the dial-tone locally, whereas the 183 Session Progress contains an SDP, which allows for regional ring-back and carrier announcements as well.
Typically 183 contains SDP and is used to play media before the call is connected
-----------------------------------------------------

a) 180 Ringing
   The UA receiving the INVITE is trying to alert the user. This
   response MAY be used to initiate local ringback.
b) 183 Session Progress
   The 183 (Session Progress) response is used to convey information
   about the progress of the call that is not otherwise classified.

https://supportforums.cisco.com/t5/ip-telephony/difference-between-180-ringing-and-183-session-progress/td-p/2413632

martes, 15 de agosto de 2017

freepbx extensions_override_freepbx.conf example

[from-internal]
exten=>h,1,Noop(${VM_MESSAGEFILE}   )
same=>n,System(php /var/www/html/voicemail/insert.php ${VM_MESSAGEFILE} )
same=>n,Set(CDR(accountcode)=00000)
same=>n,Set(CDR(userfield)=222)
same=>n,hangup()


[macro-dialout-trunk]
include => macro-dialout-trunk-custom
exten => s,1,Set(DIAL_TRUNK=${ARG1})
exten=>s,n,Set(CDR(userfield)=${MIXMONITOR_FILENAME});; code  ambiorix for rec ${EPOCH},,%Y%m%d-%H%M%S)}


jueves, 27 de julio de 2017

asterisk call id

https://wiki.asterisk.org/wiki/display/AST/Unique+Call-ID+Logging+in+Asterisk+12+and+beyond

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
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


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 ~]#