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, 30 de diciembre de 2017

twilio sms url help

https://support.twilio.com/hc/en-us/articles/223183648-Sending-and-Receiving-Limitations-on-Calls-and-SMS-Messages

https://www.twilio.com/docs/api/messaging/message

//https://www.twilio.com/docs/guides/how-to-confirm-delivery-in-php#receive-status-events-in-your-web-application


https://support.twilio.com/hc/en-us/articles/223181708-Can-my-Twilio-SMS-messages-be-blacklisted-as-spam-


https://www.twilio.com/blog/2017/12/how-to-set-up-sms-broadcasts-in-five-minutes.html

asterisk control playback

exten=>002,1,Answer()


exten=>002,n,controlplayback(/var/www/html/cdr/recordings/1514305802.24597,10000,#,*,0,1,2,,)




# avanza

* retrocede

0 para

1 pausa y vuelve a reiniciar donde se quedo pausado

2  empieza desde el principio



Arguments
  • filename
  • skipms - This is number of milliseconds to skip when rewinding or fast-forwarding.
  • ff - Fast-forward when this DTMF digit is received. (defaults to #)
  • rew - Rewind when this DTMF digit is received. (defaults to *)
  • stop - Stop playback when this DTMF digit is received.
  • pause - Pause playback when this DTMF digit is received.
  • restart - Restart playback when this DTMF digit is received.
  • options
    • otime )
      • time - Start at time ms from the beginning of the file.

jueves, 21 de diciembre de 2017

Directories Used by Asterisk


Asterisk uses several directories on a Linux system to manage the various aspects of the system, such as voicemail recordings, voice prompts, and configuration files. This section discusses the necessary directories, all of which are created during installation and configured in the asterisk.conf file.

/etc/asterisk/

The /etc/asterisk/ directory contains the Asterisk configuration files. One file, however—zaptel.conf—is located in the /etc/ directory. The Zaptel hardware was originally designed by Jim Dixon of the Zapata Telephony Group as a way of bringing reasonable and affordable computer telephony equipment to the world. Asterisk makes use of this hardware, but any other software can also make use of the Zaptel hardware and drivers. Consequently, the zaptel.conf configuration file is not directly located in the /etc/asterisk/directory.

/usr/lib/asterisk/modules/

The /usr/lib/asterisk/modules/ directory contains all of the Asterisk loadable modules. Within this directory are the various applications, codecs, formats, and channels used by Asterisk. By default, Asterisk loads all of these modules at startup. You can disable any modules you are not using in the modules.conf file, but be aware that certain modules are required by Asterisk or are dependencies of other modules. Attempting to load Asterisk without these modules will cause an error at startup.

/var/lib/asterisk

The /var/lib/asterisk/ directory contains the astdb file and a number of subdirectories. The astdb file contains the local Asterisk database information, which is somewhat like the Microsoft Windows Registry. The Asterisk database is a simple implementation based on v1 of the Berkeley database. The db.c file in the Asterisk source states that this version was chosen for the following reason: “DB3 implementation is released under an alternative license incompatible with the GPL. Thus, in order to keep Asterisk licensing simplistic, it was decided to use version 1 as it is released under the BSD license.”
The subdirectories within /var/lib/asterisk/ include:
agi-bin/
The agi-bin/ directory contains your custom scripts, which can interface with Asterisk via the various built-in AGI applications. For more information about AGI, see Chapter 8, Protocols for VoIP.
firmware/
The firmware/ directory contains firmware for various Asterisk-compatible devices. It currently contains only the iax/ subdirectory, which holds the binary firmware image for Digium’s IAXy.
images/
Applications that communicate with channels supporting graphical images look in the images/ directory. Most channels do not support the transmission of images, so this directory is rarely used. However, if more devices that support and make use of graphical images are released, this directory will become more relevant.
keys/
Asterisk can use a public/private key system to authenticate peers connecting to your box via an RSA digital signature. If you place a peer’s public key in your keys/ directory, that peer can be authenticated by channels supporting this method (such as the IAX2 channels). The private key is never distributed to the public. The reverse is also true: you can distribute your public key to your peers, allowing you to be authenticated with the use of your private key. Both the public and private keys—ending in the .pub and .key file extensions, respectively—are stored in the keys/ directory.
mohmp3/
When you configure Asterisk for Music on Hold, applications utilizing this feature look for their MP3 files in the mohmp3/ directory. Asterisk is a bit picky about how the MP3 files are formatted, so you should use constant bitrate (CBR) encoding and strip the ID3 tags from your files.
sounds/
All of the available voice prompts for Asterisk reside in the sounds/ directory. The contents of the basic prompts included with Asterisk are in the sounds.txt file located in your Asterisk source code directory. Contents of the additional prompts are located in the sounds-extra.txt file in the directory to which you extracted theasterisk-sounds package earlier in this chapter.

/var/spool/asterisk/

The Asterisk spool directory contains several subdirectories, including dictate/, meetme/, monitor/, outgoing/system/tmp/, and voicemail/ (see Figure 3.4, “/var/spool/asterisk/ directory structure”). Asterisk monitors the outgoing directory for text files containing call request information. These files allow you to generate a call simply by moving the correctly structured file into the outgoing/ directory.
Figure 3.4. /var/spool/asterisk/ directory structure
/var/spool/asterisk/ directory structure
Call files being placed into the outgoing/ directory can contain useful information, such as the Context, Extension, and Priority where the answered call should start, or simply the application and its arguments. You can also set variables and specify an account code for Call Detail Records. More information about the use of call files is presented in Chapter 9, The Asterisk Gateway Interface (AGI).
The dictate/ directory is the default location where the Dictate() application looks for files.
The meetme/ directory is the location where MeetMe() conference recordings are saved.
Recordings from either one-touch recording (the w and W flags to the Dial() application), the MixMonitor(), or Monitor() applications are stored in the monitor/ directory.
system/ is used by the System() application for temporary storage of data.
The tmp/ directory is used, funny enough, to hold temporary information. Certain applications may require a place to write files to before copying the complete files to their final destinations. This prevents two processes from trying to write to and read from a file at the same time.
All voicemail and user greetings are contained within the voicemail/ directory. Extensions configured in voicemail.conf that have been logged in to at least once are created as subdirectories of voicemail/.

/var/run/

The /var/run/ directory contains the process ID (PID) information for all active processes on the system, including Asterisk (as specified in the asterisk.conf file). Note that /var/run/ is OS-dependent and may differ.

/var/log/asterisk/

The /var/log/asterisk/ directory is where Asterisk logs information. You can control the type of information being logged to the various files by editing the logger.conffile located in the /etc/asterisk/ directory. Basic configuration of the logger.conf file is covered in Appendix D, Configuration Files.

/var/log/asterisk/cdr-csv

The /var/log/asterisk/cdr-csv directory is used to store the CDRs in comma-separated value (CSV) format. By default information is stored in the Master.csv file, but individual accounts can store their own CDRs in separate files with the use of the accountcode option (see Appendix A, VoIP Channels for more information).

jueves, 14 de diciembre de 2017

Early Media

Early media is simply media that is sent before a call is answered. It’s not the voice of the person you called, but rather system tones, announcements, or any other sound that the phone company wants to send your way. It’s the distinctive ringing you hear when you call a telephone in England. It’s an “all circuits are busy” message. It’s anything you might hear until you hear the called party’s voice.
Early media is typically supported by the use of the 183 Session In Progress response. Unlike a 180 Ringing response, 183 will contain SDP. This SDP is used to establish a media connection that carries those network tones and messages. It will eventually be torn down when the call is answered, but until then, it’s a way for the caller to audibly hear call progress.
I have been talking about early media in terms of the public switched telephone network (PSTN), but early media is also used by some IP PBXs. Why? Because they want to play the same kinds of sounds that the PSTN uses. They want to play announcements and country specific ring-back. Remember, PBXs are rooted in the same TDM world as the PSTN and have adopted much of its behavior.

https://andrewjprokop.wordpress.com/2014/04/18/sip-media-management-early-media-vs-late-media/

https://tools.ietf.org/html/rfc3960

miércoles, 13 de diciembre de 2017

asterisk expressions

same=>n,GotoIf($[$["${profile_id:0:-1}"= "6"] & $["${version:0:-1}"<"7"]]?from-internal,970040015,1)


same=>n,GotoIf($[$["${profile_id:0:-1}"= "6"] & $["${version:0:-1}">="7"] & $["${version:0:-1}"<="8"]]?from-internal,970040010,1)

sábado, 9 de diciembre de 2017

Asterisk timing calls based on API

#!/usr/bin/php -q

<?php
error_reporting(E_ALL);
set_time_limit(30);
//require_once('/root/phpagi-svn/phpagi.php');
require_once('/var/lib/asterisk/agi-bin/phpagi-2.20/phpagi.php');
 $agi = new AGI();
$agi->answer();
$agi->stream_file("silence/1");
$url=file_get_contents("http://108.61.221.173/match_info.php?cid=$argv[1]&did=$argv[2]");

$url=json_decode($url, true);
$agi->verbose("$url[blocked] $argv[1] $argv[2] ***");
$agi->verbose("$url[timer] ***");
$agi->verbose("continue with the script execution ***");

if ($url[blocked]>0){
echo " calls blocked";
$agi->verbose("calls blocked");

$agi->stream_file("im-sorry");
$agi->hangup();
exit();

}

else {

//$agi->stream_file("auth-thankyou");

$agi->set_autohangup($url[blocked]);
$agi->verbose("calls allowed");
$agi->set_variable("timeout",$url[timer]);

}
exit();

?>