Setup Guide: on the MyNetFone Service Revision History Version Author Revision Description Release Date 1.0 Sampson So Initial Draft 02/01/2008 2.0 Sampson So Update 27/09/2011 1
Table of Contents Introduction... 3 Getting Started... 3 Basic Configuration for MyNetFone SIP End Point... 4 SIP End Point... Error! Bookmark not defined. Sip.conf... 4 Extensions.Conf... 6 Basic Sample Configuration for My Net Fone Sip IP Trunk:... 7 Sip.conf... 7 General Section... 9 Extensions.Conf... Error! Bookmark not defined. Additional Information:... 10 Key Words... Error! Bookmark not defined. 2
Introduction Asterisk is an open source/free software implementation of a telephone private branch exchange (PBX). Like any PBX, it allows a number of attached telephones to make calls to one another, and to connect to other telephone services including the public switched telephone network (PSTN). "Its name comes from the asterisk symbol, *, which in UNIX (and Unix- like operating systems such as Linux) and DOS environments represents a wildcard, matching any sequence of characters in a filename." Source: http://en.wikipedia.org/wiki/asterisk_pbx Getting Started The basic Asterisk software includes many features available in proprietary PBX systems: Users can create new functionality by writing dial plan scripts in Asterisk's own language, by adding custom modules written in C, or by writing Asterisk Gateway Interface (AGI) scripts in Perl or other languages. To attach ordinary telephones to a Linux server running Asterisk, or to connect to PSTN trunk lines, the server must be fitted with special hardware. Digium and a number of other firms sell PCI cards to attach telephones, telephone lines, T1 and E1 lines, and other analog and digital phone services to a server. Source: http://en.wikipedia.org/wiki/asterisk_pbx 3
MyNetFone offer two types of Asterisk configuration for different platforms. They are: 1. SIP End Point use this option of you only need one number/line to make and receive calls on. 2. SIP IP Trunk use this option if you require multiple voice lines and numbers (e.g. different numbers for each staff member) SIP End Point - Basic Configuration for MyNetFone This is referred as the Username password authentication method to connect your Asterisk PBX to the MyNetFone service. You will be using the SIP configuration details from your initial Service Confirmation email to setup your Asterisk PBX. Using this configuration method, you can make multiple outgoing calls from the same SIP End Point and incoming calls will be routed to your Asterisk PBX based on your SIP End Point line number (09xxxxxx). If you require multiple inbound lines (e.g. different phone numbers & lines for different staff members), you would need multiple SIP End Points with different line numbers. In this case, a more suitable solution would be the MyNetFone SIP IP Trunk service which uses a different SIP connection method, and offers plans that provide between 2 to 40+ voice lines. Below is a sample of SIP End Point configuration email. You will be entering the following information into the Asterisk Sip.conf file to build your SIP End Point connection. Sip.conf The sip.conf file contains parameters relating to the configuration of SIP client access to the Asterisk server. Clients must be configured in this file before they can place or receive calls using the Asterisk server. The sip.conf file is read from the top down. The first section is for general server options, such as the IP address and port number to bind to. The next sections define client parameters such as the username, password, and default IP address for unregistered clients. Sections are delineated by a 4
name in brackets. The first section is called General (which cannot be used as a client name.) The next sections begin with the client name in brackets, followed by the client options. Source: http://www.digium.com/en/docs/asterisk_handbook/sip.conf.html Below is our sample Asterisk configuration for general settings. If you are setting up a Trixbox, please refer to the link provided in the Additional Information section (page 10). 5
Extensions.Conf The following shows how to setup an extension in asterisk. The extension example used below is 2222 (you can assign the extension you require instead). The second portion of this extensions.conf illustrates how to have your Asterisk PBX remove prefixes when the number is dialed. This would be used only when clients are required to dial a specific line to make an outgoing call. 6
SIP Trunk - Basic Configuration for MyNetFone The SIP Trunk uses the registerd IP and CLI (Caller ID) authentication method. Users must have a Static Public IP Address and their MyNetFone DIDs (Direct In- Dial Number/s) to utilise the service. Once the SIP IP Trunk is setup, the DIDs provided by MyNetFone will associate with register IP. The benefit of the SIP Trunk is that it does not require usernames and passwords for authentication. Once the SIP Trunk connection is operational, you can route multi inbound and outbound calls via the CLI. It is much more flexible than the SIP End Point method as it allows the DIDs to be presented directly to your Asterisk PBX to route instead of the 09xxxxxx numbers. The setup of this service however is different to SIP End Point method, as it requires no register string in your Asterisk PBX. The user may be required to setup IP NAT from the General config if their modem/router is not capable of NATing their public IP in the SIP packets. Sip.conf The sip.conf file contains parameters relating to the configuration of the SIP client access to the Asterisk server. Clients must be configured in this file before they can place or receive calls using the Asterisk server. The sip.conf file is read from the top down. The first section is for general server options, such as the IP address and port number to bind to. The next sections define client parameters such as the username, password, and default IP address for unregistered clients. Sections are delineated by a name in brackets. The first section is called general (which cannot be used as a client name.) The next sections begin with the client name in brackets, followed by the client options. Source: http://www.digium.com/en/docs/asterisk_handbook/sip.conf.html On the next page is our sample Asterisk configuration for general settings. 7
8
General Section In some cases you may need to unbind the port for incoming calls. Add the below command in General. Extensions.Conf The following shows how to setup an extension in asterisk. The extension example used below is 2222 (you can assign the extension you require instead). The second portion of this extensions.conf illustrates how to have your Asterisk PBX remove prefixes when the number is dialed. This would be used only when clients are required to dial a specific line to make an outgoing call. 9
Additional Information The following keywords are defined in /etc/asterisk/sip.conf port: The port Asterisk should listen for incoming SIP connections. The default is 5060, in keeping with standards. Takes as an argument a port number (which must not be in use by any other service.) bindaddr: The IP address Asterisk should listen on for incoming SIP connections. If the machine has multiple real or aliased IP addresses, this option can be used to select which IP addresses Asterisk listens on. The default behavior is to listen on all available interfaces and aliases. Takes as it's argument an IP address (which must be an interface available on the system.) context: Sets a default context all further clients are placed in, unless overridden within their client definition. type: The type option sets the connection class for the client. Options are peer: A device which recieves calls from the asterisk server. user: A device that makes calls through the asterisk server. friend: a device that can both recieve and send calls through the asterisk server. This makes sense for most desk handsets and other devices. If unsure, you this value. should probably set type to secret: Sets the password for the client. Takes an alphanumeric string. host: Sets the IP address or resolvable host name of the device. This can alternately be set to 'dynamic' in which case the host is expected to come from any IP address. This is the most common option, and normally necessary within a DHCP network. defualtip: This option can be used when the host keyword is set to dynamic. When set, the Asterisk server will attempt to send calls to this IP address when a call is received for a SIP client that has not yet registered with the server. username: This option sets the username the Asterisk server attempts to connect when a call is received. Used when for some reason the value is not the same as the username the client registered. canreinvite: This option is used to tell the server to never issue a reinvite to the client. This is used to interoperate with some (buggy) hardware that crashes if we reinvite, such as the common Cisco ATA 186. context: When defined within a client definition, this keyword sets the default context for this client only. Source: http://www.digium.com/en/docs/asterisk_handbook/sip.conf.html Trixbox Configuration- Click on the link and look up Appendix B with MyNetFone http://dumbme.voipeye.com.au/trixbox/index1.htm Asterisk Support - http://www.asterisk.org/support Asterisk Handbook Document - http://www.digium.com/en/supportcenter/documentation/viewdocs/asterisk_handbook 10