Sunday 1 December 2013

Asterisk and SIP Protocol


The Session Initiation Protocol (SIP) is a peer-to-peer protocol, and while it is common to have a setup where endpoints act as clients, and some sort of gateway acts as a server, the protocol itself thinks in terms of peer-to-peer relationships. What this means is that a SIP telephone is quite capable of making a direct connection to another SIP telephone, without a PBX in between.


The reality is that most SIP transactions happen through a server of some sort, and in the case of Asterisk, it is common to have the PBX remain in the middle, bridging all connections. When a SIP call is made from a telephone to another telephone through Asterisk, there are actually two calls happening: a call from the originating set to Asterisk, and another separate call from Asterisk to the destination set (this second leg of the call might not even use SIP). Asterisk bridges the two together.

Using a SIP phone with Asterisk means that you will want to configure the SIP telephone to send all its calls to Asterisk, even though the device is quite capable of directly connecting to another SIP endpoint without the Asterisk server. The phone will treat Asterisk as its proxy server (even though Asterisk is in fact a Back to Back User Agent, or B2BUA), and will look to Asterisk for routing decisions for all calls.

Saturday 30 November 2013

Asterisk integration with Cisco Unified Communication Manager using SIP Trunk

Today we are gonna integrate Asterisk with Cisco Unified Communications Manager.

Below is the setup:



Configuration on CUCM:

Configure Cisco IP Communicator with the TFTP address and copy the 'Device Name'.

























Create a phone in CUCM:


CUCM application -> Device -> Phone -> Add New

Phone Type: Cisco IP Communicator




















Select the device protocol: SIP



















Device Name: Enter the Device Name copied on Cisco IP Communicator






















Below are mandatory fields has to be filled in while Cisco IP Communicator

Device Pool:
SIP Profile:
Phone Button Template:
Device Security Profile:


Create SIP Trunk:

























Mention the IP address of Asterisk for registraton



Create a Route Pattern:

























Asterisk Extensions starts with patter 98XXX. Hence the pattern is managed as below with the Gateway as 'Asterisk' SIP Trunk.







  Now we are going to manage ASTERISK:
 SIP extensions and SIP trunk has to be created on /etc/asterisk/sip.conf





































Calls has to reach the extensions when dialed. So a dialplan has to be managed in /etc/asterisk/extension.conf









Note: I will explain in details about the sip.conf and extension.conf in a later post.

Registering XLite on Asterisk with the credentials configured in sip.conf




Asterisk SIP registration status



That's it. We are good to make a call.


Calling from Cisco IP communicator to Asterisk extension










Please find the configuration as text for your reference:


/etc/asterisk/sip.conf:


;Asterisk extensions
[98001]
secret=1234
context=cisco
qualify=yes
type=friend
host=dynamic


[98002]
secret=1234
context=cisco
qualify=yes
type=friend
host=dynamic


;SIP Trunk to Cisco
[fromcisco]
type=friend
qualify=yes
allow=all
nat=no
insecure=very
host=10.1.1.25
context=cisco
dtmfmode=rfc2833


register=>cisco@10.1.1.25

/etc/asterisk/extension.conf


[cisco]
exten => _98XXX,1,AGI(lookup.agi)
exten => _98XXX,n,Set(CALLERID(name)=${lookupcid})
exten => _98XXX,n,Dial(SIP/${EXTEN},5)
exten => _98XXX,n,Voicemail(${EXTEN}@default)
exten => _98XXX,n,Hangup()


exten => 99999,1,VoiceMailMain()


exten => _7XXXX,1,Dial(SIP/fromcisco/${EXTEN},20)
exten => _7XXXX,n,Hangup()


Hope you find a good time :)


Thanks,
Asterisk Techs Team

Welcome All

Greetings Folks,


This blog is to explore Asterisk PBX. I would post Asterisk based techs and infos on this blog.

First, what is Asterisk PBX:

It is a open source software switch / PBX / Telephony System created by Mark Spencer of Digium in 1999.

Like any PBX, it allows attached telephones to make calls to one another, and to connect to other telephone services, such as the public switched telephone network (PSTN) and Voice over Internet Protocol (VoIP) services. Its name comes from the asterisk symbol, *.

Asterisk is released under a dual license model, using the GNU General Public License (GPL) as a free software license and a proprietary software license to permit licensees to distribute proprietary, unpublished system components.

Originally designed for Linux, Asterisk also runs on a variety of different operating systems including NetBSD, OpenBSD, FreeBSD, Mac OS X, and Solaris. Asterisk is small enough to run in an embedded environment like Customer-premises equipment-hardware running OpenWrt.
 
The PBX comes with AGI and AMI which are API. Using these APIs it is possible to design the call flow or working of the telephony system with almost any programming language.
 
 Lets see Asterisk Techs in the forthcoming posts.Hope you all enjoy.
 
Please share your feedback to improve the blog.
 
Warm greetings,
Asterisk Techs Team :)