Asterisk to DiaStar SIP Scenarios

From ProjectDiaStar

Jump to: navigation, search

Contents

Introduction

Inbound SIP calls to a DiaStar/Asterisk system may be done a number of different ways, both with and without a SIP registrar/proxy. The following sections will explain each scenario and outline its advantages and disadvantages.

Calls Terminate on DiaStar

This is the most common way of configuring and using the system. Calls from SIP endpoints are directed to a SIP URL that contains the IP address/name of the DiaStar server. The SIP user name - in this example 1001 - sip:1001@demosys.projectdiastar.org:5060 - is passed to Asterisk as part of the connection process and will most likely refer to the desired extension in the Asterisk dialplan. The following diagram shows this configuration during a multimedia play/record:

The full range of DiaStar functions are available in this configuration - video transcoding, specialized video functions such as play and record and video conferencing. Play and record are done directly on DiaStar, and the media used reside on the DiaStar server. The transcoding engine is between the SIP endpoint and other DiaStar functionality, allowing transcoding to take place, when necessary, before sending any media streams back to the SIP phone or as soon as media is received from the phone. Remember that bi-directional media streams are always maintained to/from Asterisk so that the media can be used there.

Conferencing is a little more involved in this scenario:

While the call terminates on DiaStar, the conference is entered into by "looping" the media streams from Diastar to Asterisk and then back to DiaStar into the desired conference. There are several advantages here. This allows conferees from the DiaStar server running the conference, another DiaStar server or directly from Asterisk. Transcoding can be done so that users with different codecs, frame rates, and resolutions can be mixed into the same conference. The disadvantage is the two extra hops the media stream needs to take. Some amount of latency is introduced any time a separate connection is made on a stream.

There is also the possibility of a "native" conference on the DiaStar system which avoids this loop. It is done... [JT or Ant - more info]

Most of the Asterisk configuration info on the Diastar wiki assumes that this is the scenario in use.

Calls Terminate on Asterisk

It is sometimes necessary that SIP video calls terminate directly on Asterisk. For example, there may be parts of the application that must be done in Asterisk - routing or database lookups. The final disposition of the call will likely be a video conference, which can be entered on DiaStar directly from Asterisk:

This is a convenient, direct way to get into a video conference, but there are several disadvantages here. No video transcoding is possible - Asterisk cannot transcode video. So, video streams must be homogeneous from the SIP phone, through Asterisk, across the Asterisk-DiaStar streams and into the conference.

In addition, other DiaStar media functions - video play and record - cannot be directly used in this scenario. Only SIP calls that terminate on DiaStar can do this. There is however, another scenario which involves Asterisk that can do this.

Calls Terminate on Asterisk, Asterisk Used for B2B UA and Registrar/Proxy

Asterisk may be set up to act as a SIP Registrar/Proxy and back-to-back SIP user agent. This accomplishes several things. First, a registrar is often needed in the system. As such, it is convenient to use Asterisk for the registrar rather than set up an external service to do this. Once SIP phones have registered, all outbound calls from the phone may be dialed by number rather than IP name/address.

A simple registrar usually only relays SIP signaling, but a back-to-back user agent also relays the media streams. While addition latency is a disadvantage of this, there is a major advantage. A SIP phone calls and connects with Asterisk. Then, back-to-back media allows Asterisk to make a SIP call into DiaStar where it is able, like any other SIP call, to take advantage of video transcoding, play and record. Thus, SIP registration and DiaStar video functionality are both possible.

External Registrar/Proxy

There may also be a need for a Registrar/Proxy, where it is desirable to use an external (non-Asterisk) registrar. Note that DiaStar cannot itself be used as a registrar, but it can be easily configured to register with one. Asterisk is also able to register with a SIP registrar.

Common open source SIP servers that are able to act as registrars include OpenSIPs and sipXecs. It is easiest to set one of these up on the Asterisk or DiaStar system, rather than a system of its own. Since only SIP signaling is relayed, demands on the system are minimal, even for a large call volume.

Calls can be redirected from the registrar/proxy to any of the Asterisk or DiaStar scenarios shown above.

Personal tools