Вы находитесь на странице: 1из 16

Configuration Notes 296

Mediatrix 3000 with Asterisk


June 22, 2011

Proprietary 2014 Media5 Corporation

Configuration Notes 296

Table of Contents

Introduction ........................................................................................................................................................................... 3 Network Topology ................................................................................................................................................................. 3 Equipment Detail................................................................................................................................................................... 3 Configuration of the Fax Extension ....................................................................................................................................... 4 Configuration of the PBX Trunk ............................................................................................................................................ 7 Configuration of the PSTN Lines......................................................................................................................................... 11 General Configuration of the Mediatrix 3732 with Asterisk ................................................................................................. 16

Page 2 of 16

Configuration Notes 296

Introduction
This document outlines the configuration steps required to connect a Mediatrix 3000 series gateway with a 6FXO/2FXS card to an Asterisk open-source telephone system. It assumes that you have an Asterisk server properly installed. If you need technical assistance to configure your Asterisk server, the Media5 technical team can provide appropriate support to help you realizing your VoIP projects.

Network Topology
In the scenario used throughout this document, the Mediatrix 3732 (1 PRI, 6 FXO/2FXS) is used to: interface a PBX with an IP-PBX; provide PSTN access via analog lines; provide IP connectivity to analog phones and fax machines.

E1/!1 PSTN "#a$%& $i#e' PBX Ext. 2XX

IP

Mediatrix 3732 (1 PRI, 6 FXO/2FXS) 192.168.1.249

Ext. 1+3

IP(PBX ("'teri')) 192.168.1.163 Mediatrix 41+2S Ext. 1+2 "#a$%& P*%#e

IP P*%#e Ext. 1+1

The Asterisk IP-PBX provides: Call routing, Dial Plan o Including routes to local PSTN gateways Telephony services (voicemail, call forwarding, etc,) to IP users SIP Endpoints management Auto-Attendant

Equipment Detail
The configuration presented in this document applies to all FXO and/or PRI products running the DGW v2.0 firmware. Since we will concentrate on the configuration of the Mediatrix 3732, it is assumed that the Mediatrix 4102S and the IP phone are correctly configured with the IP-PBX and are able to make calls. Different Mediatrix products can be used depending on the needs. This configuration note was written and validated using the following platform and versions: Mediatrix 3732 DGW v2.0.8.118 Asterisk version 1.4.29.1

Page 3 of 16

Configuration Notes 296

Configuration of the Fax Extension


Configuration of Asterisk
We will begin by configuring an extension for the fax plugged in the FXS port number 1 of the Mediatrix 3732. 1. In the sip.conf configuration file, create a new extension by adding the following: [103] type=friend host=dynamic nat=no qualify=no canreinvite=no dtmfmode=info context=InternalExtensions secret=num103 t38pt_udptl=yes 2. ; This is the extension number (username) ; This is part of the method used by the Asterisk server to match ; incoming INVITES to this user. ; This means the extension will register to the Asterisk server ; The Mediatrix unit is not behind a NAT ; No keep alive is used ; No Re-Invite is sent to this extension ; The DTMF is sent/received in SIP INFO messages ; The context where the call from this extension is sent ; It is the same context for the IP phone and the Mediatrix 4102S ; The SIP authentication password ; This allows T.38 fax to be sent to this extension. ; This setting is set to no for the IP phone and Mediatrix 4102S

In the extensions.conf make sure the context exists: [InternalExtensions] exten => _1XX,1,Dial(SIP/${EXTEN},40,) ; This context currently allows the extensions to call each other.

3.

Reload the Asterisk settings by connecting to the Asterisk CLI (asterisk r) and typing the reload command.

If you want to use the T.38 protocol to transfer faxes, you can follow the procedure of the Configuration Notes 0259 Mediatrix 41xx With Asterisk web. If you use clear channel, skip this configuration.

Configuration of the Mediatrix 3732


1. 2. Log in the Mediatrix 3732 configuration web page. The default username is public with no password. In the Network -> Interfaces section, set the required IP information. In our example scenario, we will use the static IP address 192.168.1.249.

Page 4 of 16

Configuration Notes 296 3. In the SIP -> Servers section, set the IP address of your registrar and proxy. They are often the same as in our example scenario:

If your setup requires an outbound proxy or uses different port, you will also need to configure these in this web page. If your SIP server uses the default port (5060), we recommend putting :0 after the IP address to indicate to use the default port. 4. After clicking Submit, you will be presented with a message requesting to restart a service. We can go ahead and restart it now.

We can go ahead and restart it now. Follow the link, or go to the System -> Services section and click the Restart Required Services button.

Page 5 of 16

Configuration Notes 296 5. In the SIP -> Registrations section, configure the User Name, Friendly Name and Gateway for the FXS port used by the fax and click the Submit & Refresh Registration button. Here is what the configuration would look like in our scenario :

6.

In the SIP -> Authentication section, configure the authentication for the User Name configured for the FXS port by clicking on the Edit button on an empty authentication line. In our example, we will configure an authentication for the endpoint (FXS/1) to make sure this user name and password combination does not conflict with other user names we will configure. We will also disable the realm validation. We could also enter the realm asterisk, but since we will only use one realm in our scenario, it is simpler to disable the validation.

When the configuration is done, click the Submit & Refresh Registration button. 7. In the SIP -> Registrations section, the registration status should now be Registered.

8.

After the registration is successful, the IP phone and Mediatrix 4102 should be able to call the fax extension.

Page 6 of 16

Configuration Notes 296

Configuration of the PBX Trunk


Configuration of Asterisk
We will configure a user for the SIP authentication of the calls coming from the PBX (E1/T1 port of the Mediatrix 3732). 1. In the sip.conf configuration file, create a new extension by adding the following: [PBXTrunk] type= peer host=192.168.1.249 port=5061 nat=no qualify=no canreinvite=no dtmfmode=info context= FromPBX secret= TrunkPassword t38pt_udptl=yes 2. ; The SIP username used for calls coming from the PBX ; This is part of the method used by the Asterisk server to match ; incoming INVITES to this user ; This means the extension will not register to the Asterisk server. This ; is the IP address of the Mediatrix 3732 ; Port used for requests to and from the Mediatrix unit. ; The Mediatrix unit is not behind a NAT ; No keep alive is used ; No Re-Invite is sent to this extension ; The DTMF is sent/received in SIP INFO messages ; This is the context where the call from this extension is sent ; It is the same context for the IP phone and the Mediatrix 4102S ; The SIP authentication password ; This allows T.38 fax to be sent by this trunk ; This setting is set to no for the IP phone and Mediatrix 4102S

In the extensions.conf, add a context for calls coming from the PBX: [FromPBX] exten => _1XX,1,Dial(SIP/${EXTEN},40,) ; This allows the PBX users to reach extensions 100 to 199. The ; Asterisk server will make the extension ring for 40 seconds.

3.

Still in extensions.conf, modify the context of the extensions to allow them to send calls to the PBX: [InternalExtensions] exten => _1XX,1,Dial(SIP/${EXTEN},40,) exten => _2XX,1,Dial(SIP/${EXTEN}@PBXTrunk,40,)

; This allows the IP phone and Mediatrix 4102S to ; reach the PBX extensions 200 to 299

4.

Reload the Asterisk settings by connecting to the Asterisk CLI (asterisk r) and typing the reload command.

If you want to use the T.38 protocol to transfer faxes, you can follow the procedure of the Configuration Notes 0259 Mediatrix 41xx With Asterisk web. If you use clear channel, simply skip this configuration.

Page 7 of 16

Configuration Notes 296

Configuration of the Mediatrix 3732


1. The ISDN configuration of the Mediatrix 3732 is outside the scope of this document. Make sure your PRI interface has both Physical and Signalling up before continuing. For more information on the ISDN configuration, refer to the documentation available for your Mediatrix product.

2.

Create a new SIP gateway in the Mediatrix 3732. This gateway will be used to differentiate the calls coming from the PBX and the calls from the PSTN (analog lines). The tactic is to use different SIP ports so that Asterisk sees the PBX calls and the PSTN calls coming from two separate users (sip.conf) and can separate those users into different contexts (extensions.conf). This way, we can control the dial plan (context) of each type of calls. In the SIP -> Gateways section, type a new gateway name and click on the + sign to add a new gateway.

Page 8 of 16

Configuration Notes 296 3. Enter the port number configured in the Asterisk user for the new gateway and click Submit.

4. 5.

Restart the required services In the SIP -> Authentication section, configure the Authentication for the User Name of the user created in the Asterisk configuration file by clicking on the Edit button on an empty authentication line. In our example, we will configure an authentication for the Gateway to make sure this user name and password combination is only used for calls coming and going to the new Gateway we have configured.

6. 7.

When the configuration is done, click the Submit button. Go to the Call Router -> Status section. You will see that the Mediatrix unit has already created some routes for the FXS port we configured earlier.

8. 9.

We will now create routing rules for the E1T1 port connected to the PBX. Go to the Call Router -> Route Config section. Add a new Route by clicking the + sign in the Route section.

Page 9 of 16

Configuration Notes 296 10. In the new window, open the suggestion box next to the Sources and select the E1T1 port. Here is what it should look like :

11. Open the suggestion box next to the Destination and select the gateway we have created earlier :

12. Click the Submit button to add the route. This route will send calls that come from the PBX to the Asterisk server. We now need a route to send the calls from the Asterisk to the PBX. 13. Add a new Route by clicking on the + sign in the Route section. 14. In the new window, open the suggestion box next to the Sources and select the PBX gateway.

Page 10 of 16

Configuration Notes 296 15. Open the suggestion box next to the Destination and select the E1T1 port.

16. Click the Apply button at the bottom of the page to activate the new routes. The yellow Config modified indicator should return to normal. After the routes are applied, the IP phone, Mediatrix 4102 and fax extension should be able to dial the 2xx extensions available on the PBX and vice-versa.

Configuration of the PSTN Lines


Configuration of Asterisk
We will configure a user for the SIP authentication of the calls coming from the PSTN (FXO ports of the Mediatrix 3732). 1. In the sip.conf configuration file, create a new extension by adding the following: [PSTNTrunk] type= peer host=192.168.1.249 port=5062 nat=no qualify=no canreinvite=no dtmfmode=info context= FromPSTN secret= TrunkPassword t38pt_udptl=yes 2. ; SIP username used for calls coming from the PSTN ; This is part of the method used by the Asterisk server to match ; incoming INVITES to this user. ; This means the extension will not register to the Asterisk server. This ; is the IP address of the Mediatrix 3732 ; Port used for requests to and from the Mediatrix unit. ; The Mediatrix unit is not behind a NAT ; No keep alive is used ; No Re-Invite is sent to this extension ; The DTMF is sent/receive in SIP INFO messages ; Context where the call from this extension is sent ; It is the same context for the IP phone and the Mediatrix 4102S ; SIP authentication password ; This allows T.38 fax to be sent by this trunk. ; This setting is set to no for the IP phone and Mediatrix 4102S

In the extensions.conf, add a context for calls coming from the PSTN: [FromPSTN] exten => 900,1,Answer() exten => 900,2,Background(Company-Prompt) exten => 900,3,Hangup() exten => _1XX,1,Dial(SIP/${EXTEN},40,) exten => _2XX,1,Dial(SIP/${EXTEN}@PBXTrunk,40,)

;This plays a prompt (IVR) to the calling party and ; allows it to dial extensions

; This allows the IP phone and Mediatrix 4102S to ; reach the PBX extensions 200 to 299

3.

In the extensions.conf, modify the context of the PBX to allow the PBX users to send calls to the PSTN: [FromPBX] exten => _1XX,1,Dial(SIP/${EXTEN},40,) exten => _9X.,1,Dial(SIP/${EXTEN:1}@PSTNTrunk,40,)
Page 11 of 16

; This allows the PBX users to dial on the PSTN

Configuration Notes 296 ; and removes the 9 before dialling the number. 4. In the extensions.conf, modify the context of the extensions to allow them to send calls to the PBX: [InternalExtensions] exten => _1XX,1,Dial(SIP/${EXTEN},40,) exten => _2XX,1,Dial(SIP/${EXTEN}@PBXTrunk,40,) exten => _9X.,1,Dial(SIP/${EXTEN:1}@PSTNTrunk,40,) 5.

; This allows the IP phone and Mediatrix 4102S to ; dial on the PSTN.

You can reload the Asterisk settings by connecting to the Asterisk CLI (asterisk r) and typing the reload command.

Configuration of the Mediatrix 3732


1. 2. In the SIP -> Gateways section, type a new gateway name and click the + sign to add a new gateway named PSTN-Gateway. Enter the port number configured in the Asterisk user for the new gateway and click Submit.

3. 4.

Restart the required services. In the SIP -> Authentication section, configure the Authentication for the User Name of the user we created in the Asterisk configuration file by clicking on the Edit button on an empty authentication line. In our example, we will configure an authentication for the Gateway to make sure this user name and password combination is only used for calls coming from and going to the new Gateway we have configured.

5. 6. 7.

When the configuration is done, click the Submit button. Go to the Call Router -> Config section. We will now create routing rules for the FXO ports. Add a new Route by clicking the + sign in the Route section.

Page 12 of 16

Configuration Notes 296 8. In the new window, open the suggestion box next to the Sources and select the FXO ports one after the other until all the ports appear in the Value field. If only some ports are used, add only the ports that have a line connected to them. Here is what it should look like:

9.

Open the suggestion box next to the Destination and select the gateway we have created earlier:

10. Click the Submit button to add the route. This route will send calls that come from the PSTN to the Asterisk PBX. 11. To add a new route that will send calls from Asterisk to the PSTN, you must begin by adding a new Hunt. Click the + sign in the Hunt section. 12. Give a Name to the Hunt group. We will use PSTN in our example.

Page 13 of 16

Configuration Notes 296 13. Open the suggestion box next to the Destinations and select the FXO ports one after the other until all the ports appear in the Value field. Here is what it should look like :

14. Click the Submit button when done. This hunt allows us to take the first free line plugged in the Mediatrix unit when a call comes from the Asterisk server to the PSTN. 15. Add a new Route by clicking the + sign in the Route section. 16. In the new window, open the suggestion box next to the Sources and select the PSTN gateway. 17. Open the suggestion box next to the Destination and select the new hunt we created.

18. Click the Submit button. 19. Click the Apply button at the bottom of the page to activate the new routes. The yellow Config modified indicator should return to normal.

Page 14 of 16

Configuration Notes 296 20. If you have followed all the steps, the Call Router configuration should look as follows:

21. After the routes are applied, the PBX users and the IP users should now be able to send calls to the PSTN. 22. By default, the Mediatrix FXO ports answer any incoming call and play a dial tone enabling the remote calling party to dial an extension. To have the Mediatrix automatically call an IVR on the Asterisk server instead, we must configure the Automatic Call feature on the FXO ports. 23. In the Telephony -> Services section, select the first FXO endpoint (Slot3/FXO1). 24. In the Automatic Call section, set the Endpoint Specific to Yes. 25. Enable the Automatic Call Activation.

Page 15 of 16

Configuration Notes 296 26. Set the Automatic Call Target to the number of the IVR configured in the Asterisk Server (900).

27. Repeat the three last steps for each endpoint you need configured.

General Configuration of the Mediatrix 3732 with Asterisk


Configuration of the DTMF transport
In the Telephony -> CODECS section, set the Transport Method in the DTMF Transport section to the value that corresponds to the value of the dtmfmode variable configured in the user (sip.conf) of the in Asterisk server. 1. Here is what the value of the Transport Method should be for each corresponding value of the dtmfmode variable: rfc2833 = Out-of-Band using RTP info = Out-of-Band using Signalling Protocol o When setting the DTMF Transport to Out-of-Band using Signalling Protocol, the interopDtmfTransportMethod variable has to be modified to the infoDtmfRelay value. See your product documentation for more details on how to set this variable. inband = In-band

Configuration of the Voice Activity Detection


On some Asterisk versions, it is preferable to disable the Voice Activity Detection. These versions of Asterisk will only send RTP packets when there are incoming RTP packets. Disabling the Voice Activity detection will prevent dead air in some scenarios. In the Telephony -> CODECS section, set the Generic Voice Activity Detection to Disable.

Page 16 of 16

Вам также может понравиться