<?xml version="1.0" encoding="utf-8"?>
<html>
{{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.|}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. -Still here as of Oct. 2014.
Another thing to note that as of Asterisk version 1.6 the refer method for transferring calls is not supported in sipX. Please refer to Asterisk documentation regarding SIP Refer method used by Asterisk. An untested work around since transfers worked in Asterisk version 1.4 is to use the option in sip.conf called pedantic, which will either make Asterisk pay more attention to SIP "call-IDs", "to", and "from" or just "call-IDs" alone.
pedantic = yes|no : Enable slow, pedantic checking of Call-ID:s, multiline SIP headers and URI-encoded headers. Default no (in Asterisk 1.8 default yes)
Basically, you can think of the pedantic setting as being one that is important
to SIP purists or those who do make use of more advanced/less used nuances of
the SIP protocol.
For instance, RFC 3261 plainly spells out that the way to identify whether an
incoming message belongs to a specific dialog is to check the call-id, to tag,
and from tag. With pedantic mode disabled, all we look at is the call-id because
in the majority of situations, the call-id is suitable for identifying which
dialog the request belongs to. However, if you know that tag checking is
important, then it will be enabled by turning on pedantic mode.
There are other RFC-mandated operations which will only occur if pedantic mode
is enabled. Typically, the reason why we restrict these operations to when
pedantic mode is enabled is because it is a lot easier/more efficient not to
perform the operations and because in most cases things work fine without
performing the operations.
Mark Michelson
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. Interested on how to compare sipXecs IP PBX with Asterisk?
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.
...
Panel | ||||
---|---|---|---|---|
#Remove the hash (#) character in the line below (before the word ztdummy at the end of the line)
ztdynamic ztd-eth wct1xxp wct4xxp # ztdummy
|
}}
The following set of commands compiles and installs both the zaptel drivers as well as Asterisk for a 2.6 Linux kernel (Fedora Core 3).
{{Box Code|Compile zaptel, libpri and Asterisk|
...
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: |
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 |
}}
2. Asterisk General Configuration
Two SIP phones will be registered with Asterisk. Assigned numbers are "320" and "321", respectively.
...
Panel | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
}}
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 |
2. Asterisk Configuration Files
{{Box File|extensions.conf|
...
Panel | ||||||||
---|---|---|---|---|---|---|---|---|
|
...
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 | ||||||||
---|---|---|---|---|---|---|---|---|
;
|
}}
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.
...
Panel | ||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|
;
|
}}</html>