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, 12 de mayo de 2020

HOW TO USE AN ASTERISK CALLFILE

Articles


How to use an Asterisk Callfile

Asterisk call files are structured files which that tell asterisk how to initiate a call when when moved to the appropriate directory. you can use them in order to initei calls without an extension or bypass the dialplan for troubleshooting purposes. 

Requirements and general information on how it works 

  • pbx_spool.so module needs to be loaded into asterisk
  • Calls files will only be readed when they are moved into astspooldir directory defined in asterisk.conf (usually /var/spool/asterisk/outgoing/)
  • Upon detection Asterisk will immediately execute the directives unless the modification time is in the future, in which asterisk will wait for the time to on the server to match before placing executing. 
  • Upon completion asterisk will remove the call from spooling directory 

Syntax 

  • ​Specify where and how to call
    • Channel: <channel>: Channel to use for the call.
    • CallerID: "name" <number> Caller ID, Please note: It may not work if you do not respect the format: CallerID: "Some Name" <1234>
    • MaxRetries: <number> Number of retries before failing (not including the initial attempt, e.g. 0 = total of 1 attempt to make the call). Default is 0.
    • RetryTime: <number> Seconds between retries, Don't hammer an unavailable phone. Default is 300 (5 min).
    • WaitTime: <number> Seconds to wait for an answer. Default is 45.
    • Account: Set the account code to use.
  • If the call answers, connect it here:
    • Context: <context-name> Context in extensions.conf
    • Extension: <ext> Extension definition in extensions.conf
    • Priority: <priority> Priority of extension to start with
    • Set: Set a variable for use in the extension logic (example: file1=/tmp/to )
    • Application: Asterisk Application to run (use instead of specifiying context, extension and priority)
    • Data: The options to be passed to application
  • Other parameters 
    • AlwaysDelete: Yes/No - If the file's modification time is in the future, the call file will not be deleted
    • Archive: Yes/No - Move to subdir "outgoing_done" with "Status: value", where value can be Completed, Expired or Failed.

Examples

playback.call

channel: DAHDI/1/123456789
application: Playback
data: Demo-congrats
 
SendFax.call
 
channel: SIP/PROVIDER/1234567890
application: SendFax
data: fax.tiff
setvar=FAXID=1430402112
setvar=FAXOPT(ecm)=yes
setvar=FAXOPT(minrate)=2400
setvar=FAXOPT(maxrate)=14400

How to initiate a call file

  1. Create a callfile using
  2. Set file permissions with chmod 777 <filename>
  3. Move the file to the proper spool directory with #cp -ap /root/callfile /tmp/cf && mv /tmp/cf /var/spool/asterisk/outgoing/
Note: it's not recommended to copy the file to the spool directory because asterisk could start reading the file before the operating system stop writing it causing a failure. 

domingo, 3 de mayo de 2020

Asterisk Uninstall




 +--------- Asterisk Uninstall Complete -----+
 + Asterisk binaries, sounds, man pages,     +
 + headers, modules, and firmware builds,    +
 + have all been uninstalled.                +
 +                                           +
 + To remove ALL traces of Asterisk,         +
 + including configuration, spool            +
 + directories, and logs, run the following  +
 + command:                                  +
 +                                           +
 +             make uninstall-all