Asterisk Basics (SIP)



Similar documents
ASTERISK & PHP. Hans-Christian Otto International PHP Conference 2010 SE Berlin, June 1, 2010

Overview of Asterisk (*) Jeff Gunther

Applications between Asotel VoIP and Asterisk

Mediatrix 3000 with Asterisk June 22, 2011

Skype connect and Asterisk

Micronet VoIP Solution with Asterisk

Asterisk By Example...doing useful VoIP things. Jonny Martin

Asterisk Cluster with MySQL Replication. JR Richardson Engineering for the Masses

Asterisk: The Open Source PBX Solution Adam Olson Systems and network administrators typically deal with

VoIP Workshop PacNOG3

Asterisk & ENUM. Extending the Open Source PBX. Michael Haberler, IPA Otmar Lendl, nic.at

NOC Workshop VoIP in the NOC labs SANOG10

Configuring the Cisco SPA8800 IP Telephony Gateway in an Asterisk Environment

VOIP with Asterisk & Perl

Setup Guide: on the MyNetFone Service. Revision History

Configuration Notes 290

Trunks User Guide. Schmooze Com Inc.

Using Polycom KIRK Wireless Server 300 or 6000 with Asterisk

Asterisk: The Definitive Guide

Performance Benchmark Test for Asterisk B2BUA. 13 November

Building Robust IPTSP Based on Open Source Technology. Anowar Hasan Sabir, BDCOM Online Ltd. Bangladesh

PBX Manager Portal v2.0

Asterisk - The Basics

Basic configuration of the GXW410x with Asterisk

Introduction. What is DUNDi? Configuring Asterisk for use with DUNDi

Asterisk Primer. Presented at Apricot, Bali, Feb 26 th Marc Blanchet Viagénie.

SIP Session-Timers Support in Asterisk

ADTRAN SBC and Avaya IP Office PBX SIP Trunk Interoperability

Internet telephony Asterisk system.

How to Push CDR Files from Asterisk to SDReporter. September 27, 2013

Software Based VoIP Lab A step by step guide to setting up and configuring an IP-PBX. Donal O Connor DNET 4 donaloconnor@gmail.com

Guideline for SIP Trunk Setup

Atcom MP01 and Elastix Server

Abstract. Avaya Solution & Interoperability Test Lab

VoxStack GSM Gateway API. Version: Author: Joe.Yung

VOIP, Linux, and Asterisk Making Beautiful Voice Together

Asterisk. Michael Kershaw

Open Source Telephony Projects as an Application Development Platform. Frederic Dickey Director Product Management

TekSIP Proxy frontend for Asterisk PBX

Quick Provisioning Guide for Third-Party PBX

Version: SIPPBXUM.101

Ryan Brown October 9, 2004 The Burgh Live, LLC. Voice over IP using Asterisk (*)

General Guidelines for SIP Trunking Installations

Test on IX130 Performance

Allow Auto Answer by Call-Info: No Yes. Turn off speaker on remote disconnect: No Yes

Grandstream Networks, Inc. Asterisk PBX Configuration Guide GXP21xx IP Phone/GXP1450 IP Phone

Using DUNDi with a Cluster of Asterisk Servers! General Description and Scope

Software Communication System 500 Release 1.0 System Features

Setup the Asterisk server with the Internet Gate

Grandstream Networks, Inc. UCM6100 Series IP PBX Appliance CDR and REC API Guide

Technical Bulletin Using Polycom SoundPoint IP and Polycom SoundStation IP Phones with Asterisk

Trixbox. by MATT FLORELL and JAMES PEARSON

Asterisk Reference Information Version rc2. Asterisk Development Team Asterisk.org

DUNDi, So Easy A Caveman Could Do It!

ADTRAN SBC and Cisco Unified Call Manager SIP Trunk Interoperability

Thirdlane PBX Manager Users Guide 12/04/2007. Third Lane Technologies, LLC 39 Power Lane Fairfax, CA

Asterisk. Technical Application Notes

Telephony with an Asterisk phone system

04/09/2007 EP520 IP PBX. 1.1 Overview

AT&T SIP Trunk Compatibility Testing for Asterisk

Configurator Administrators Guide

BlackBerry Mobile Voice System. Version: 5.3. Administration Guide

From the command line- a user can begin Asterisk (v1.6), and access the Asterisk CLI by typing:

Asterisk Overview. Berkeley In Munich Tech Talks prepared by. Emil Stoyanov

8 Port Modular IP PBX Solution 8 Port IP PBX + SIP Gateway System IPG-80XG

TEL 500. Voice Communications. Week 1 Write Up. Session Initiation Protocol Lab. Submitted To: Prof Ronny Bull. By: Sai Sharan Korvi

What you need today is Essence IPBX for tomorrow s. productivity

General Guidelines for SIP Trunking Installations

Dashboard...4. Agents...5 SIP Queues Trunk Dial Plan Audio Cally Square Pre Analytics Settings...

Unicorn60x0 IP ANALOG GATEWAY ASTERISK CONFIGURATION

TEL 500 VOICE COMMUNICATIONS PROJECT REPORT IMPLEMENTATION OF SMALL CALL CENTER WITH AUTO ATTENDENT AND QUEUES SUBMITTED TO: RONNY L.

IPPBX FAQ. For Firmware Version: V2.0/V

Background 1 Table 1 Software & Firmware Versions Tested 1 Figure 1 Integra s Universal Access (UA) IP PBX Test Configuration 1

Practical Guide. How to setup VoIP Infrastructure using AsteriskNOW

Asterisk Command-Line Interface Reference

You da M.A.N. Voice, over IP, over stuff

EZLoop IP-PBX Enterprise SIP Server

A System for Auto-Provisioning VOIP Telephones for Asterisk

1) How do I setup my SIP trunk for inbound/outbound calling? We authenticate IP-PBX SIP Trunking traffic by:

Implementation of a Fully Functional VoIP Server Inside of a Campus Network

Fig. Setting up of a VoIP call. Fig. Experimental setup

PBXware End User Guide Bicom Systems

TEL 500 WRITE UP WEEK 8 FREE PBX SIP LAB SUBMITTED TO: PROF. RONNY BULL BY: ANUSHA ALIGAPALLY

FreePBX R14. SIP Trunk Provisioning Guide

Two Standards: H.323 / SIP Bridging both worlds. João Pereira - FCCN - Portugal

MEGAPBX. User Manual

NAT TCP SIP ALG Support

spiderstar VoIP Interface Version 4.0 User manual

Application Notes for Avaya IP Office 7.0 Integration with Skype Connect R2.0 Issue 1.0

Asterisk Business Edition TM Digium Partner Certification

FWS KWV-4310 Specification V 1.1

Using OpenSIPS as a PBX

CommuniGate Pro Real-Time Features. CommuniGate Pro Internet Communications VoIP, , Collaboration, IM

Transcription:

03/12/10 Budapest / Hungary MÉSZÁROS Mihály

OpenSIPS vs Asterisk from SIP point of view Opensips Proxy, no media handling IPv6 and Ipv4 and multicast Transport protocols sctp,tcp,udp,tls RFC3263 NAPTR, SRV Very felxible so you should know very well what you are doing, so need more knowledge. Commitred to strictly follow the IETF SIP RFC-s Sip register binding AoR to many SIPURI Forking, or sequntial sip forwarding Asterisk B2BUA,Media server Ipv4 only Transport prtocols 1.4 only udp! 1.6 udp,tcp,tls Easy to learn and use Lazy and quick and dirty SIP implementation Trancoding and MCU features sip register implementation can only handle AoR <=>ip:port binding MoH is activated if there is established call with only single direction media. No SRTP Slide 2

Few from asterisk functions SIP B2BUA GW SIP,ISDN/POTS,H.323,MGCP,XMPP etc. Media Server IVR MoH Call Park Call pickup Voicemail Monitor (Lawful interception etc.) Transcoding MCU Call Queue Slide 3

History Goal:Bridging the gap between Traditional and Network Telephony Asterisk is an IP PBX wit interface to other systems and protols (IAX,SIP,H.323,XMPP,MGCP,SCCP,ISDN/POTS,etc.) Motivation Price Flexibility Security Interoperability The community led by Mark Spencer of Digium Zapta Jim Dixon CPU has enough power to software can replace DSP in some cases. Digium PC POTS/ISDN cards Slide 4

DAHDI The old name: ZAPTEL Drivers for Digium PC cards ISDN Primary rate ISDN Basic Rate ISDN POTS analog FXO/FXS DSP for media transcoding DSP for echo cancellation Asterisk Timer ztdummy dahdi_dummy At least meetme application is depending on it. Slide 5

Versions 1.2.x 1.4.x obsoleted Old stable 1.4.29 1.6.x Branch Release Date: 2006-12-23 Security only fixes: 2010-12-23 End of Life (EOL): 2011-12-23 devel 1.8.x LTS Long Term Support Release date: TBD (estimated Q3 2010) Roadmap https://issues.asterisk.org/roadmap_page.php Slide 6

Architecture Architecture Core Modules API app funct format chan res bridge Slide 7

Configuration Static File Slide 8 configuration asterisk.conf modules.conf sip.conf sip_notify.conf musiconhold.conf rtp.conf queue.conf voicemail.conf meetme.conf logger.conf cdr.conf udptl.conf (T.38) Static File Runtime reloadable Include file Realtime extconfig.conf backends SQL postgresql MySQL odbc Ldap etc.

Config templating (sip.conf) [basic-options](!) dtmfmode=rfc2833 context=from-office type=friend [natted-phone](!,basic-options) nat=yes canreinvite=no host=dynamic [public-phone](!,basic-options) nat=no canreinvite=yes [my-codecs](!) disallow=all allow=ilbc allow=g729 allow=gsm allow=g723 allow=ulaw [ulaw-phone](!) disallow=all allow=ulaw ; a template ; another template inheriting basic-options ; another template inheriting basic-options ; a template for my preferred codecs ; and another one for ulaw-only ; and finally instantiate a few phones [2133](natted-phone,my-codecs) secret = peekaboo [2134](natted-phone,ulaw-phone) secret = not_very_secret [2136](public-phone,ulaw-phone) secret = not_very_secret_either Slide 9

Logger/Asterisk CLI Logger logger.conf [general] [logfiles] console => notice,warning,error messages => notice,warning,error Type debug verbose notice warning error asterisk -r Asterisk -vvvvvvr increase verbosity level to 6 asterisk -rx "logger reload" Auto-complete <tab>, <?> Commands Core commands debug verosity level - Core set debug - Core set verbosity codecs - core show codecs - core show translation Help - core show applications - core show function Core - core show uptime - core show settings etc. Slide 10

General dialplan Static or dynamic (extensions.conf) Dialplan reload from CLI Dialplan broken into section called context for example context blabla is seems like: [blabla], and as separator char. When Asterisk parses the dialplan, it converts any commas in the application arguments to pipes. Extensions (number and/or letters) exten => 3rt45 exten => _361X. Applications For example application: Dial(),WaitExten(),Goto(),Macro(), NoOp(),Set(), etc. Slide 11

Dialplan syntax Pattern prefixed by _ X any digit from 0-9 Z any digit from 1-9 N any digit from 2-9 [1235-9] any digit in the brackets (in this example, 1,2,3,5,6,7,8,9). wildcard, matches anything remaining (e.g. _9011. matches anything starting with 9011 excluding 9011 itself)! wildcard, causes the matching process to complete as soon as it can unambiguously determine that no other matches are possible Priority 1 integer n next previous+1 regardless of whether the previous priority was associated with the current extension or not s same + int integer n+2 or s+2 () label/alias jump to this with goto() Most important standard extensions s start: no extension t timeout h hangup: clean up the call i invalid: unknown extension Slide 12

dialplan / extensions example [default] exten => 6245,hint,SIP/Grandstream1&SIP/Xlite1(Joe Schmoe) ; Channel hints for presence exten => 6245,1,Dial(SIP/Grandstream1,20,rt) ; permit transfer exten => 6245,n(dial),Dial(${HINT},20,rtT) ; Use hint as listed exten => 6245,n,Voicemail(6245,u) ; Voicemail (unavailable) exten => 6245,s+1,Hangup ; s+1, same as n exten => 6245,dial+101,Voicemail(6245,b) ; Voicemail (busy) exten => 6361,1,Dial(IAX2/JaneDoe,,rm) ; ring without time limit exten => 6389,1,Dial(MGCP/aaln/1@192.168.0.14) include => context1 [context1] exten => 6391,1,Dial(JINGLE/asterisk@digium.com/mogorman@astjab.org);Dial via jingle exten => 6390,1,Dial(JINGLE/caller/callee) ; Dial via jingle using labels Slide 13

Dialplan syntax Special Contexts general general settings like: static, writeprotect, autofallthrough, priorityjumping globals global variables definition and initiation regcontext see sip.conf example [context] exten => someexten,{priority label{+ -}offset}[(alias)],application(arg1,arg2,...) Contexts contain several lines, one for each step of each extension. One may include another context in the current one as well, optionally with a date and time. Included contexts are included in the order they are listed. Switches may also be included within a context. The order of matching within a context is always exact extensions, pattern match extensions, includes, and switches. Includes are always processed depth-first. So for example, if you would like a switch "A" to match before context "B", simply put switch "A" in an included context "C", where "C" is included in your original context before "B". Location and mapping ENUM E164 Number to URI mapping DuNDi Distributed Universal Number Discovery Slide 14

Variables Types Global SetGlobalVar() Shared Function SHARED() Channel Set() Environment ${ENV(foo)} String Handling Functions ${LEN(foo)} String length ${foo:offset:length} Substring ${foo}${bar} Concat $[expression] exmple: exten => 321,1,Set(COUNT=3) exten => 321,n,Set(NEWCOUNT=$[$ {COUNT} + 1]) exten => 321,n,SayNumber($ {NEWCOUNT}) Most important predefined channel variables ${CALLERID(all)} ${CALLERID(num)} ${CALLERID(name)} ${DIALSTATUS} CHANUNAVAIL, CONGESTION, BUSY, NOANSWER, ANSWER, CANCEL, HANGUP ${CONTEXT} ${CHANNEL} ${EXTEN} Slide 15

Operators and function boolean / logical Slide 16 expr1 expr2 expr1 & expr2!expr1 comparison expr1 = expr2 expr1!= expr2 expr1 < expr2 expr1 > expr2 expr1 <= expr2 expr1 >= expr2 Arithmetic expr1 + expr2 expr1 - expr2 - expr (unary negation operator) expr1 * expr2 expr1 / expr2 expr1 % expr2 Regular expression expr1 : regexp2 The regular expression is anchored to the beginning of the string with an implicit '^'. expr1 =~ expr2 The match is not anchored to the beginning of the string. Conditional operator expr1? expr2 :: expr3 Operator Precedence 1. Parentheses: (, ) 2. Unary operators!, - 3. Regular expression comparison: :, =~ 4. Multiplicative arithmetic operators: *, /, % 5. Additive arithmetic operators: +, - 6. Comparison operators: =,!=, <, >, <=, >= 7. Logical operators:, & 8. Conditional operator:? : Function FUNCTION_NAME(argument) ${FUNCTION_NAME($ {FUNCTION_NAME(argument)})}

Macro Example [macro-xyz] exten => s,1,dial(${arg1},${arg2},t) Macro definition is similar to context xyz is the name of the macro Can triggered from any context with [default] exten => 6601,1,Macro(xyz,SIP/1000,10) Where SIP/100 is ARG1 and 10 is Arg2 In a macro context, extra channel variables are available. ${ARG1}: The first argument passed to the macro ${ARG2}: The second argument passed to the macro (and so on) ${MACRO_CONTEXT}: The context of the extension that triggered this macro ${MACRO_EXTEN}: The extension that triggered this macro ${MACRO_OFFSET}: Set by a macro to influence the priority where execution will continue after exiting the macro ${MACRO_PRIORITY}: The priority in the extension where this macro was triggered Slide 17

AstDB database Berkley DB version 1 familly, key, value Used to store for example SIP registration Functions what can be used from dialplan to manipulate data in this database DB(family/key) Read from or write to the Asterisk database. DB_DELETE(family/key) Return a value from the database and delete it. DB_EXISTS(family/key) Check to see if a key exists in the Asterisk database. Example exten => 456,1,Set(DB(test/count)=1) exten => 456,n,Set(COUNT=${DB(test/count)}) exten => 456,n,SayNumber(${COUNT}) Slide 18

Asterisk as B2BUA vs. reinvite direct media Slide 19

Sip dial strings Sip dial strings SIP/devicename SIP/username@domain (SIP uri) SIP/username[:password[:md5secret[:authna me[:transport]]]]@host[:port] SIP/devicename/extension Device is a UA [] Slide 20

sip.conf [general] Fax pass trough T.38 Outgoing registration Sip domain Realtime NAT Media Subscribe Session-timer Check call keep-alive sending sip messages RTP timer Check call keep-alive using rtp timout SIP timer [authentication] Realm,user,pass to auth outgoing requests it requested by UAS or by proxy. Sip devices [devicename] type - User» search incoming message with the From: header user part - Peer» Search incoming message peer ip addr - Friend= User and Peer» search incoming message with the From: header user part and after if no match found then search by src ip. canreinvite - - bridged media direct media qualify - SIP Option ping dtmfmode host Slide 21

voicemail.conf imap or disk storage Default file storage /var/spool/asterisk/voicemail/ Sections Voicemail files are inside this folder are grouped by context/voicemailbox [general] format Email options [zonemessages] Time zone greetings and date/time format Voicemail contexts [default] - Format: mailbox => password,name[,email[,pager_email[,options]]] - Eample: 4200 => 9855,Mark Spencer,markster@linux-support.net,mypager@digium.com,attach=no serveremail=myaddy@digium.com tz=central maxmsg=10 [other] [etc] Slide 22

Call parking / MeetMe Parking MeetMe (MCU) features.conf meetme.conf parkext parkpos context parkingtime Parking lot Context parkedcalls Applications ParkAndAnnounce: Park and Announce Example [rooms] conf => 600 Room Auth /Pin Applications MeetMe: MeetMe conference bridge. MeetMeAdmin: MeetMe conference administration. ParkedCall: Answer a parked call. MeetMeCount: MeetMe participant count. Slide 23

Programing interfaces AGI / AMI Asterisk Gateway Interface Programing inerface AGI, EAGI, DeadAGI, FastAGI STDIN,STDOUT,STDERR Interface implementation perl,php,python etc. extension.conf exten=>123,1,answer() exten=>123,2,agi(agi-test.agi) Asterisk Manager Interface manager.conf Directory manager.d Request-respose Example Call files /var/spool/asterisk/outgoing/ Click-to-call!Move file instead of copy! Action: GetConfig Filename: users.conf ActionID: 9873497149817 Response: Success ActionID: 987397149817 Category-000000: general Line-000000-000000: fullname=new User Line-000000-000001: userbase=6000 Line-000000-000002: hasvoicemail=yes Line-000000-000003: hassip=yes Line-000000-000004: hasiax=yes Line-000000-000005: hasmanager=no Line-000000-000006: callwaiting=yes Line-000000-000007: threewaycalling=yes Line-000000-000008: callwaitingcallerid=yes Line-000000-000009: transfer=yes Line-000000-000010: canpark=yes Line-000000-000011: cancallforward=yes Line-000000-000012: callreturn=yes Line-000000-000013: callgroup=1 Line-000000-000014: pickupgroup=1 Line-000000-000015: host=dynamic Slide 24

CDR calldate: datetime of the started call clid: Caller*ID with text (80 characters) src: Caller*ID number (string, 80 characters) dst: Destination extension (string, 80 characters) dcontext: Destination context (string, 80 characters) channel: Channel used (80 characters) dstchannel: Destination channel if appropriate (80 characters) lastapp: Last application if appropriate (80 characters) lastdata: Last application data (arguments) (80 characters) duration: Total time in system, in seconds (integer), from dial to hangup billsec: Total time call is up, in seconds (integer), from answer to hangup disposition: What happened to the call: ANSWERED, NO ANSWER, BUSY, FAILED amaflags: What flags to use: see amaflags: DOCUMENTATION, BILLING, IGNORE etc. accountcode: What account number to use: Asterisk billing account, (string, 20 characters) uniqueid: Unique Channel Identifier (32 characters) (In some cases, uniqueid is appended) user field: A user-defined field, maximum 255 characters Slide 25

Accounting / CDR CDR asterisk-stat Billing Backends CSV custom(file) Manager interface ODBC PostgreSQL radius sqlite Tds MySQL not installed by default Can be installed from asterisk addons packagae MySQL CREATE TABLE `cdr` ( `calldate` datetime NOT NULL default '0000-00- 00 00:00:00', `clid` varchar(80) NOT NULL default '', `src` varchar(80) NOT NULL default '', `dst` varchar(80) NOT NULL default '', `dcontext` varchar(80) NOT NULL default '', `channel` varchar(80) NOT NULL default '', `dstchannel` varchar(80) NOT NULL default '', `lastapp` varchar(80) NOT NULL default '', `lastdata` varchar(80) NOT NULL default '', `duration` int(11) NOT NULL default '0', `billsec` int(11) NOT NULL default '0', `disposition` varchar(45) NOT NULL default '', `amaflags` int(11) NOT NULL default '0', `accountcode` varchar(20) NOT NULL default '', `userfield` varchar(255) NOT NULL default '' ); Slide 26

References http://www.asterisk.org/ http://www.digium.com http://www.voip-info.org http://downloads.oreilly.com/books/9780596510480.pdf http://astbook.asteriskdocs.org http://www.asteriskguru.com http://www.amoocon.de http://www.voip-info.org/wiki/view/asterisk+variables http://www.voip-info.org/wiki/index.php?page=asterisk+config+extensions.conf http://www.voip-info.org/wiki/view/asterisk+dialplan+patterns http://www.voip-info.org/wiki/view/asterisk+tips+openhours http://www.voip-info.org/wiki/view/asterisk+priorities http://www.voip-info.org/wiki/view/asterisk+standard+extensions http://linuxinnovations.com/index.html http://www.panoramisk.com/wp-content/uploads/2007/05/asterisk-call-flow-outbridge.png http://www.panoramisk.com/wp-content/uploads/2007/05/asterisk-call-flow-inbridge.png http://areski.net/asterisk-stat-v2/about.php extensions.conf Slide 27

Thank You! 28