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, 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()

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


PHP

<?php


$db_values=array();

$filename=$argv[1].".txt";
   // echo "$filename  path  <br><br>";
$vm_prop=file($filename);
foreach($vm_prop as $key=>$value) {
//echo" $key => $value<br>";
$db_values[]=$value;
}
print_r($db_values);


function clean($var) {
$var=stristr($var, '=');
$var=str_replace ("=" ,"",$var);

return $var;

}
$path=$argv[1].".wav";
//$path=str_replace("txt","wav",$path);
$origmailbox=clean($db_values[4]);
$duration=clean($db_values[16]);
$callerchan=clean($db_values[10]);
$callerid=clean($db_values[11]);
$origdate=clean($db_values[12]);



$link = mysqli_connect("localhost", "asteriskuser", "amp109", "asteriskcdrdb");

/* check connection */
if (mysqli_connect_errno()) {
    printf("Connect failed: %s\n", mysqli_connect_error());
    exit();
}


$query = "INSERT INTO `voicemails` (`id`, `origmailbox`, `context`, `macrocontext`, `exten`, `rdnis`, `priority`, `callerchan`, `callerid`, `origdate`, `origtime`, `category`, `duration`, `path`) VALUES (NULL, '$origmailbox', 'context', 'macro-context-1', 'exten', 'rdsi', 'prio', '$callerchan', '$callerid', '$origdate', 'origtime', 'categ', '$duration', '$path')";


if(mysqli_query($link, $query)) {

printf ("New Record has id %d.\n", mysqli_insert_id($link));
}

else {

 printf("Error: %s\n", mysqli_error($link));

}
/* close connection */
mysqli_close($link);
?>


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