Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

{{Box Important|This page was written in 2005 and is a bit out of date. Most of the reasons why you would want to interconnect sipX with Asterisk have gone away as sipX has not only caught up in terms of supported features, but in more and more areas has taken the lead, is more robust and easier to use. We expect therefore that this page will be deleted early 2007 after we finish sipX release 3.8.|}

Introduction - Interconnecting sipXecs IP PBX with the Asterisk PBX

There are many reasons for interconnecting sipXecs with Asterisk. This Wiki explores some of them giving you detailed instructions of how to get to a combined system that works. Intentionally the use cases described here are as simple as possible. There are many more things you could do; however, the instructions that follow will get you to a working system combining sipXecs IP PBX with Asterisk. It allows you to explore advantages and disadvantages of both system and is meant to educate and amuse.

Why interconnect sipX with Asterisk ?

The sipX system is the next generation IP PBX - a comprehensive Enterprise Communications server fully standards based, extendable, and interoperable. One of the project's major design goals is ease of installation and use. If you already have an Asterisk PBX installed, you might want to consider adding the sipX SIP server for the following advantages:

...

*Interested in participating in a great effort? Follow the sipX core developers and learn about best industry practices in terms of coding standards, use of modern languages such as C++, Java, and XML, automated build environments based on auto-tools and ant, unit test frameworks for automated regression testing, embedded documentation using doxygen, Web technologies and application middleware, as well as Web services technologies such as SOAP and XML RPC.

Use Cases considered

The following use cases shall be considered and will be described below. They intentionally are kept as simple as possible:

...

For production installations it shall be recommended to use two different systems for Asterisk and sipX. By using different ports for SIP signaling it is possible to run both applications on the same machine. However, don't expect great performance from either in this case.

Installing sipX and Asterisk on Fedora Core

Two independent servers were chosen as the test setup. The Asterisk server runs Fedora Core 2 while the sipX server runs Fedora Core 3. The following represents detailed instructions of getting both systems to work as intended.

Installing sipX 3.0 on Fedora Core 3

First, install sipX on FC3.

Installing Asterisk on Fedora Core 3

Install Fedora Core 3 on an empty system

Install Fedora Core (minimum system, no X server) following the instructions provided by Red Hat.

...

Panel

ip.addr.of.host asterisk.your.domain asterisk

Compile Asterisk from Source

There are binaries available for Asterisk from a variety of sources; however, the most reliable approach in our experience is to compile it from source. The following commands check out the latest stable version of both Asterisk and the zaptel drivers from the cvs repository at Digium. In this example we assume that there is no hardware card from Digium present in the system and therefore applications like Meetme have to rely on the dummy driver ztdummy to derive timing from the USB circuit.

...

modprobe zaptel

Panel

modprobe ztdummy

}}

Asterisk Configuration Files

There are lots of configuration files that can be used with Asterisk. In this example we only use the minimum set of configuration files and parameters required to start Asterisk and accomplish the use cases as defined above. Please refer to the Asterisk documentation for more advanced configurations or different applications. Necessary modifications to these sample configuration files are described below.
{{Box Code|Install required configuration files|

...

Note: This is a console interface, so that you will end up with a lot of comments printed on your screen, a couple of errors for config files that are not found (that's ok), and a command prompt at the end.

Connecting Phones

Configuring phones to be used with sipX

The sipX configuration server allows fully automated remote management of supported phones and gateways using a Web UI or SOAP access (Simple Object Access Protocol, part of Web Services).

...

Every SIP phone can be used with the sipX system. Additional phones are being added to the plug & play management capability and if you would like to have a particular phone supported, please have a look at the sipX config server project at SIPfoundry or the developer documentation about Adding support for managed phones.

Configuring sipXphone to register with Asterisk

In this particular example we used sipXphone to connect to Asterisk as this is a configuration not that often described. sipXphone is a solid SIP softphone licensed under the LGPL open source license and downloadable from SIPfoundry. sipXphone is documented on the sipX Wiki. sipXphone has a phone like skin.

...

Panel

Device Line:
SIP URL: sip:320@asterisk.your.domain
Registration: Register
Authentication Credentials:
Realm: asterisk
User ID: 320
Password: <secret defined in sip.conf>

Configuration Examples

For all the different use cases, the following general settings were used:

1. DNS Configuration

Two independent hosts are used:

...

Panel

dig -t SRV _sip._tcp.your.domain
dig -t SRV _sip._udp.your.domain

}}

2. Asterisk General Configuration

Two SIP phones will be registered with Asterisk. Assigned numbers are "320" and "321", respectively.

...

Panel
No Format
type = friend
No Format
secret = password
No Format
username = 321
No Format
host = dynamic      ; phone uses DHCP
No Format
dtmfmode = rfc2833  ; sipx likes that

}}

3. sipX General Configuration

Asterisk is defined as an unmanaged gateway in sipX. This allows the creation of a custom dialing rule to forward calls to Asterisk similarly to calls that are forwarded to any other gateway:
<center>

</center>

...

Configuration of the new dial plan rule for Asterisk:
<center>

</center>

Use Case 1: Interconnect Asterisk and sipX as two independent PBX systems with an integrated dial plan

1. Dial Plan

The following dial plan was chosen for this setup:

Panel

Extensions Comments
2xx Extensions reachable through sipX
3xx Extensions reachable through Asterisk
100 Extension for the auto-attendant (on sipX)
101 Extension for the voice mail system (on sipX)

2. Asterisk Configuration Files

{{Box File|extensions.conf|

...

These settings mean that if a 2xx extension is dialed from an Asterisk phone, a SIP call is placed to 2xx@your.domain. The parameter '1' means priority 1; the parameter '30' means to have the call time out after 30 seconds and the parameter 't' means allow transfer. Timeouts have to be set carefully in order to allow for the appropriate time for the call to roll over to voice mail if not picked up. The last command assures that a call is terminated after a timeout.

Use Case 2: Substitute SER with sipX as a SIP proxy front-end to Asterisk

SER and Asterisk have been a good combination in many cases already as is documented in a variety of places. This example shows how SER can be substituted for sipX. Primary objective is not to replace SER as a highly scalable SIP proxy, but to use sipX's additional capability of remotely managing SIP phones and gateways using the sipX Configuration Server.

Use Case 3: Use Asterisk as a conferencing server for sipX

The following sets up three extensions for conferencing: 500, 501, and 502. The pin code for each is '12345'. No special features, such as music on hold are used here.
{{Box File|meetme.conf|

...

Panel

conference

No Format
exten => 500,1,Meetme(500|M)
No Format
exten => 501,1,Meetme(501|M)
No Format
exten => 502,1,Meetme(502|M)

;
default

No Format
include => conference

}}

Use Case 4: Use Asterisk as a PSTN gateway

The following illustrates how to use Asterisk to connect to FWD for SIP trunking services. The configuration is derived from the Asterisk Wiki. In order for this to work a whole needs to be punched into the NAT/Firewall making the Asterisk host an 'exposed host'. This is quite a hack and we are still trying to find out how the FWD STUN server could be used with Asterisk. Comments welcome.

...