Interoperability/PBX/Asterisk

From Snom User Wiki

Jump to: navigation, search

Contents

Overview

Asterisk is a complete PBX in software. It runs on Linux and provides all of the features you would expect from a PBX and more. Asterisk does voice over IP in three protocols, and can interoperate with almost all standards-based telephony equipment using relatively inexpensive hardware. Asterisk provides Voicemail services with Directory, Call Conferencing, Interactive Voice Response and Call Queuing. It has support for three-way calling, caller ID services, ADSI, SIP and H.323 (as both client and gateway). As SIP protocol is much simpler and doesn’t rule out any of the features required in the PBX world, nowadays many people prefer it. Basic SIP building blocks include, for example, SIP proxy and registrar. Asterisk can’t really be described as either of these. It is closer to a media gateway with SIP proxy/registrar- type features that make it possible to build a feature-rich PBX system (or network).

Asterisk was originally written by Mark Spencer of Digium dba Linux Support Services Inc. Code has been contributed from Open Source coders around the world.

All snom phone models can be used with Asterisk.

snom Asterisk support

snom phones are fully interoperabel with Asterisk. Please check our new Asterisk Support site for details.

Basic Asterisk configuration

The relevant files for SIP phones in Asterisk are sip.conf, extensions.conf and voicemail.conf.The configuration depend on the desired dial plan and usernames e.g. preference to use phone extensions as a usernames.

sip.conf

sip.conf describes some general SIP parameters and all the SIP devices in the Asterisk PBX system. Please check the Asterisk sample files that come with the software or see our sample file section.

extensions.conf

Extensions.conf describes the dialplan for the Asterisk PBX system. It can be used in many ways. Please check the Asterisk sample files that come with the software or see our sample file section.

voicemail.conf

voicemail.conf describes how all the mailboxes should behave. Please check the Asterisk sample files that come with the software or see our sample file section.

snom configuration for Asterisk interoperability

Basic configuration

In order to use snom phones with Asterisk, you will need to configure some SIP parameters.

SIP Lines

  • Go to the Identity/ Line page
  • Fill in the name, account and registrar. Use Asterisk’s IP address in the registrar field. Do not configure the mailbox here.

SIP codecs

snom and Asterisk both support several codecs but unlike snom, a separate license is required for Asterisk when using g.729 codec (Contact Digium inc.)

Message Waiting Indication (MWI)

MWI also works with Asterisk. If someone has left you a voicemail, you will receive indication of this (MWI). In snom 3xx, this will be displayed in two ways: a yellow LED will blink and there will be an MWI on the display. This is cleared only when you check your voicemails (and delete them).

In order to set this scenario up, configure the following:

sip.conf: mailbox=<your Mailboxnumber>
extensions.conf: exten => asterisk,1,VoiceMailMain()

Multicast Streaming

Multicast Streaming is possibile in Asterisk starting from version 1.8. You must use the MulticastRTP channel like these lines of extension.conf:

; Paging via multicast RTP
exten => 201,1,Dial(MulticastRTP/basic/239.255.255.245:5555)

When you dial the 201 extension Asterisk starts sending a multicast stream to 239.255.255.245 port 5555, so you need to configure multicast_listen/mc_address on your phones. At the moment of writing (2013/03/14) there is an Asterisk open issue that breaks this feature if you're using a file as a audio source.

Function keys

Intercom

Add to your extensions.conf

exten => 2400,1,Set(VXML_URL=intercom=true)
exten => 2400,2,SIPAddHeader(Alert-Info: <http://www.notused.com>\;info=alert-autoanswer\;delay=0)
exten => 2400,3,Page(SIP/snom1&SIP/snom2)

Please note that Asterisk doesn't act as a pure proxy SIP, if you need to use the intercom function key you must preserve the Alert-Info Header with a similar dialplan:

; extract Alert-Info header from initial INVITE
exten => _15[0-9],1,Set(AIH=${SIP_HEADER(Alert-Info)})
; if Alert-Info is present goto "hasalertinfo"
exten => _15[0-9],n,GotoIf($["${AIH}" != ""]?hasalertinfo)
; else dial
exten => _15[0-9],n,Dial(SIP/${EXTEN})
exten => _15[0-9],n,Hangup()
; Alert-Info is present: add Alert-Info header to outgoing INVITE
exten => _15[0-9],n(hasalertinfo),SipAddHeader(Alert-Info: ${AIH})
; dial the extension
exten => _15[0-9],n,Dial(SIP/${EXTEN})
exten => _15[0-9],n,Hangup()

Shared Line

This isn't currently supported by Asterisk.

Extension Monitoring (BLF) & Call Pick-Up

Snom phones will only support this feature on unpatched Asterisk versions. See the requirements and possible implementation in our "Call Pick-Up" article.

Here you can find a little howto explaining hot to take advantage of Asterisk "device states" feature.

Sample Files

Example 1: To reach your snom phone, you can, for example, have the following three lines for extension 910 in extension.conf:

extension.conf

exten => 910,1,Dial,sip/${EXTEN}|30
exten => 910,2,voicemail2,u910
exten => 910,102,voicemail2,b910
${EXTEN} is an internal variable. Here it means that
you are going to dial sip/910.
  • Although it is also possible to use a username other than the extension number, using the extension number makes management and documentation a little easier.
  • Details for 910 are in sip.conf:

sip.conf

[general]
port = 5060 ; Port to bind to
bindaddr = 0.0.0.0 ; Address to bind to A
context = default ;Default for incoming calls
disallow=gsm
allow=alaw ; Allow a-law
;allow=g729
disallow=ulaw

[910]
type=friend (inbound and outbound calls accepted)
secret=password_for_this_phone
host=dynamic
callerid=JOHN <910>
defaultip=10.1.1.2 (will be used if not yet registered)
dtmfmode=inband (use this with inband mode DTMF)
;dtmfmode=rfc2833 (use this with outband mode DTMF)
mailbox=910 (Asterisk VM-system’s mailbox #)
[maria] (here a name is used instead of #)
type=friend
secret=password_for_this_phone
host=dynamic
callerid=MARIA <916>
defaultip=10.1.1.3
dtmfmode=inband
mailbox=916
etc.

voicemail.conf

910 => 1234, John Fischer, support@snom.de
  • 910 is the mailbox number.
  • 1234 is the password.
  • Using the mail address makes it possible to receive voicemails as a mail attachment (wav).

Example 2:

sip.conf

[general]
context=default
allowguest=no
realm=snom
bindport=5060
bindaddr=0.0.0.0
pedantic=no 
vmexten=voicemail
disallow=all
allow=ulaw
language=en
dtmfmode = inband ; Can be RFC2833 or INFO with version 5
subscribecontext = from-sip ; Moderatly important that it matches the context :)

[123]
type=friend
context=from-sip
secret=1234
host=dynamic
mailbox=1234@context,2345
restrictcid=no

extension.conf

[from-sip]
exten => 123,hint,SIP/123 ; I am testing the difference of before or after
exten => 123,1,Dial(SIP/123)

[intercom]
exten => 601,1,SIPAddHeader(Call-Info: sip:192.168.20.1\; answer-after=0)
exten => 601,n,Dial(SIP/101)

[overhead-paging]
exten => 602,1,Wait(1)
exten => 602,n,SIPAddHeader(Call-Info: sip:192.168.20.1\; answer-after=0)
exten => 602,n,Page(SIP/101&SIP/102&SIP/103&SIP/104&SIP/105|q)

Links

External

FAQ

Personal tools
Interoperability