En esta presentación podrás encontrar como integrar tus desarrollos con Asterisk PBX utilizando su API y AMI para realizar requests y consumir sus servicios.
Break Async AGI loop channel status: Returns status of the connected channel control stream file: Send the given file, allowing playback to be controlled by the given digits, if any. exec: Executes a given get data: Gets data on a channel hangup: Hangup the current channel noop: Does nothing receive char: Receives one character from channels supporting it receive text: Receives text from channels supporting it record file: Records to a given file say alpha: Says a given character string say date: Say a date say datetime: Say a formatted date and time
set music: Enable/Disable Music on hold generator, example "SET MUSIC ON default" set priority: Prioritizes the channel stream file: Sends audio file on channel verbose: Logs a message to the asterisk verbose log wait for digit: Waits for a digit to be pressed say digits: Says a given digit string say number: Says a given number say phonetic: Say the given character string. say time: Say a time send image: Sends images to channels supporting it send text: Sends text to channels supporting it set callerid: Sets callerid for the current channel set context: Sets channel context
ET import sys from asterisk.agi import * agi = AGI() # for a complete list of US cities, go to # http://www.weather.gov/xml/current_obs/ weatherURL = [] weatherURL.append("http://w1.weather.gov/xml/current_ob s/KNYC.xml") #NYC weatherURL.append("http://w1.weather.gov/xml/current_ob s/KJFK.xml") #JFK weatherURL.append("http://w1.weather.gov/xml/current_ob s/KART.xml") #Watertown, NY weatherURL.append("http://w1.weather.gov/xml/current_ob s/KBGM.xml") #Binghamton
comandos de forma remota en Asterisk, la seguridad es un factor esencial /etc/asterisk/manager.conf [general] enabled = yes port = 5038 bindaddr = 127.0.0.1 debug = on [python] secret = PythonTijuana deny=0.0.0.0/0.0.0.0 permit=127.0.0.1/255.255.255.255 read = system,call,log,verbose,command,agent,user write = system,call,log,verbose,command,agent,user,originate
and ability to run system management commands, such as Shutdown, Restart, and Reload. call - Information about channels and ability to set information in a running channel. log - Logging information. Read-only. verbose - Verbose information. Read-only. agent - Information about queues and agents and ability to add queue members to a queue. user - Permission to send and receive UserEvent. config - Ability to read and write configuration files. command - Permission to run CLI commands. Write-only. dtmf - Receive DTMF events. Read-only. reporting - Ability to get information about the system. cdr - Output of cdr_manager, if loaded. Read-only. dialplan - Receive NewExten and VarSet events. Read-only. originate - Permission to originate new calls. Write-only.