Real-time multimedia and communication in packet networks Asterisk AGI and Manager Interface.

Slides:



Advertisements
Similar presentations
Network II.5 simulator ..
Advertisements

JavaScript FaaDoOEngineers.com FaaDoOEngineers.com.
® IBM Software Group © 2006 IBM Corporation Rational Software France Object-Oriented Analysis and Design with UML2 and Rational Software Modeler 04. Other.
1 © 2001 John Urrutia. All rights reserved. Chapter 5 The Shell Overview.
Browsers and Servers CGI Processing Model ( Common Gateway Interface ) © Norman White, 2013.
Session 6 Server-side programming - ASP. An ASP page is an HTML page interspersed with server-side code. The.ASP extension instead of.HTM denotes server-side.
CS Lecture 03 Outline Sed and awk from previous lecture Writing simple bash script Assignment 1 discussion 1CS 311 Operating SystemsLecture 03.
A CHAT CLIENT-SERVER MODULE IN JAVA BY MAHTAB M HUSSAIN MAYANK MOHAN ISE 582 FALL 2003 PROJECT.
1 Java Networking – Part I CS , Spring 2008/9.
Linux+ Guide to Linux Certification, Second Edition
Definitions, Definitions, Definitions Lead to Understanding.
Guide To UNIX Using Linux Third Edition
Guide To UNIX Using Linux Third Edition
CGI Programming: Part 1. What is CGI? CGI = Common Gateway Interface Provides a standardized way for web browsers to: –Call programs on a server. –Pass.
Real-time multimedia and communication in packet networks Asterisk The open source IP PBX.
Tutorial 6 Forms Section A - Working with Forms in JavaScript.
Slide 1 of 9 Presenting 24x7 Scheduler The art of computer automation Press PageDown key or click to advance.
CGI Programming Languages Web Based Software Development July 21, 2005 Song, JaeHa.
Form Handling, Validation and Functions. Form Handling Forms are a graphical user interfaces (GUIs) that enables the interaction between users and servers.
NETWORK CENTRIC COMPUTING (With included EMBEDDED SYSTEMS)
Server- Side technologies Client-side vs. Server-side scripts PHP basic ASP.NET basic ColdFusion.
FALL 2005CSI 4118 – UNIVERSITY OF OTTAWA1 Part 4 Web technologies: HTTP, CGI, PHP,Java applets)
Agenda  Terminal Handling in Unix File Descriptors Opening/Assigning & Closing Sockets Types of Sockets – Internal(Local) vs. Network(Internet) Programming.
AGI + PHP “Making phones jump through fiery hoops of death.” Rob Peck dealnews.com PHP Appalachia 2008.
A gentle introduction to Asterisk Anthony Critelli.
FTP (File Transfer Protocol) & Telnet
Lecture 7 Interaction. Topics Implementing data flows An internet solution Transactions in MySQL 4-tier systems – business rule/presentation separation.
VoIP, Asterisk, and Java Michael P. Plezbert Agilis Systems, Inc St. Louis Java Users Group April 13, 2006.
Introduction to Python
HTTP HTTP stands for Hypertext Transfer Protocol. It is an TCP/IP based communication protocol which is used to deliver virtually all files and other.
Week 7 Working with the BASH Shell. Objectives  Redirect the input and output of a command  Identify and manipulate common shell environment variables.
Chapter Four UNIX File Processing. 2 Lesson A Extracting Information from Files.
Guide To UNIX Using Linux Fourth Edition
– Introduction to the Shell 10/1/2015 Introduction to the Shell – Session Introduction to the Shell – Session 2 · Permissions · Users.
TCP/IP Essentials A Lab-Based Approach Shivendra Panwar, Shiwen Mao Jeong-dong Ryoo, and Yihan Li Chapter 5 UDP and Its Applications.
ITIS 1210 Introduction to Web-Based Information Systems Chapter 23 How Web Host Servers Work.
10/13/2015 ©2006 Scott Miller, University of Victoria 1 Content Serving Static vs. Dynamic Content Web Servers Server Flow Control Rev. 2.0.
Silberschatz, Galvin and Gagne  2002 Modified for CSCI 399, Royden, Operating System Concepts Operating Systems Lecture 6 System Calls OS System.
Linux+ Guide to Linux Certification, Third Edition
UNIX Commands. Why UNIX Commands Are Noninteractive Command may take input from the output of another command (filters). May be scheduled to run at specific.
Website Development with PHP and MySQL Saving Data.
Shell Programming. Creating Shell Scripts: Some Basic Principles A script name is arbitrary. Choose names that make it easy to quickly identify file function.
1 Welcome to CSC 301 Web Programming Charles Frank.
1 © Netskills Quality Internet Training, University of Newcastle HTML Forms © Netskills, Quality Internet Training, University of Newcastle Netskills is.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
Real-time multimedia and communication in packet networks iLanga.
Creating Web Documents: How the Web works Client / Server Protocols Access methods Homework: Complete experiment & report on Discussion Forum.
TEL500-Voice Communications IVR using Speech Recognition in Asterisk Devesh Mendiratta Sameer Deshmukh & Srinivas Madlapelli.
Introduction to Programming the WWW I CMSC Winter 2003.
WWW: an Internet application Bill Chu. © Bei-Tseng Chu Aug 2000 WWW Web and HTTP WWW web is an interconnected information servers each server maintains.
Chapter Three The UNIX Editors.
SKYPIAX, how to add Skype capabilities to FreeSWITCH (and Asterisk) CHICAGO, USA, September 2009.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
IS-907 Java EE World Wide Web - Overview. World Wide Web - History Tim Berners-Lee, CERN, 1990 Enable researchers to share information: Remote Access.
Executable scripts. So far We have made scripts echo hello #for example And called it hello.sh Run it as sh hello.sh This only works from current directory?
Lesson 3-Touring Utilities and System Features. Overview Employing fundamental utilities. Linux terminal sessions. Managing input and output. Using special.
Introduction to Python Dr. José M. Reyes Álamo. 2 Three Rules of Programming Rule 1: Think before you program Rule 2: A program is a human-readable set.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
CSI 3125, Preliminaries, page 1 Networking. CSI 3125, Preliminaries, page 2 Networking A network represents interconnection of computers that is capable.
Linux+ Guide to Linux Certification, Second Edition
CS 330 Class 8 Homework A pattern that contains a word with an optional period A pattern that contains Fred with a space (not Freddy) See regexp.txt guest4.htm.
Fall 2000C.Watters1 World Wide Web and E-Commerce Servers & Server Side Processing.
Linux Administration Working with the BASH Shell.
Transport Protocols Relates to Lab 5. An overview of the transport protocols of the TCP/IP protocol suite. Also, a short discussion of UDP.
CS 330 Class 7 Comments on Exam Programming plan for today:
CSE 303 Concepts and Tools for Software Development
#01 Client/Server Computing
CST8177 Scripting 2: What?.
Introduction to Bash Programming, part 3
#01 Client/Server Computing
Presentation transcript:

Real-time multimedia and communication in packet networks Asterisk AGI and Manager Interface

Last Practical Create a calculator application using the Asterisk dialplan E.g. phone an extension * answers and provide an IVR menu saying press 1 to go to the calculator, 2 to go somewhere else, and 3 to go somewhere further If I press 1 – must be routed to calculator where I am prompted to choose to go to multiplication menu, division menu, add menu or subtraction menu 1,2,3,4 Within each menu – prompt user for expression separated by star (*)‏ So in addition menu, pressing 100*20 should return 120 While in multiplication menu pressing 100*20 will return 2000 Results can be played using Festival After each result should have option of another operation or going to one of the other menus (+-/*)‏ Remember to check out - Check out the Cut function!

Controlling Asterisk Number of ways Asterisk can be controlled Dialplan Asterisk scheduling (call me)‏ Asterisk Gateway Interface (AGI)‏ Manager Interface

AGI AGI allows us to add functionality to Asterisk with many different programming languages Java, Perl, PHP, C, Pascal – Anything! Provides a standard interface through which programs may control asterisk Used for advanced logic or to communicate with resources such as relational databases and external devices Allows asterisk to perform tasks that would be otherwise difficult or impossible

AGI – How it works The AGI script is called from the dialplan‏ Asterisk and your program communicate via the STDIN, STDOUT and STDERR communications channels (file handles in programming)‏ Your AGI scripts reads input via its STDIN file handle Your AGI script writes back to asterisk via its STDOUT file handle Your AGI program writes error message back to asterisk via its STDERR file handle

Starting your AGI program Syntax: exten => extennumber,priority,application,arguments The application is “AGI” The argument is the filename of your program The script must be: executable (chmod +x filename)‏ located in /var/lib/asterisk/agi-bin in source versions of asterisk Located in /usr/share/asterisk/agi-bin in binary vesions of asterisk Example: Run a perl script agi-test.agi exten => 1,2,AGI, agi-test.agi

Passing args exten 1,2,AGI,agi-test.agi|${ARG1}|${ARG2} AGI programs always receive two args 1 – path to the AGI script 2 – Arguments passed from the dialplan Notes about arguments: If no arg is given – the arg is empty. Consists of everything on the line following the verticle bar after the file name, up until the final vertical bar‏ Quotes are taken as being part of the argument

Communicating with * Use 'show agi' at the CLI will give you a list of commands At script startup time, * sends a group of variables to your script which you have to read in Each item is sent on a line terminated with a newline. The last item is followed by an empty line agi_request: agi-test.agi agi_channel: SIP/1000-bcgd162 agi_language: en agi_context: mtsietsi agi_extention: 105 agi_priority: 2 Commands sent to * must be terminated with newline

AGI examples‏ Perl - /usr/share/asterisk/agi-bin/agi-test.agi Java - /usr/share/asterisk/agi-bin/mosJava.java /usr/share/asterisk/agi-bin/mosJava.agi

Manager API A client/server module that allows us to interact with * via TCP/IP Similar to SMTP and HTTP Communicates using tags “header:value” terminated with a newline First tag must be one of the following Action: an action requested by the client. Response: A response to an action from Asterisk Event: An event reported by Asterisk to the client

Manager interface (login)‏ telnet into on port 5038 Login Action: Login Username: voipuser Secret: voipuser Events: off /r/n

Manager interface (Originate)‏ Action: Originate Channel: SIP/1000 Exten: s Context: mtsietsi Priority: 1 Timeout: 10000

Manager interface (Monitor)‏ Action: Monitor Channel: SIP/ab5s51182s File: monitor Mix: 1

Today's Practical 1) Extend your calculator to incorporate an AGI program Do the calculation Parse the numbers Take a number to a power Solve complex problems i.e. y = ax 4 + ax 3 = ax 2 + ax + a