SipToSis with Asterisk

February 1, 2010 at 16:59 (Asterisk) (, , , , , )

I was little busy these days, had a lot of work to do like re-waterproofing my bathtub..

2010-02-17 Edit: Please Read the references i shown on the end of this Post to have an HowTo how to exactly install SipToSis! If i find the Time i can write a detailed Howto with Display environment variables etc, but only if i get some comments to do so :)

Nevertheless i finally managed to Get a working Skype <-> Asterisk connection via SipToSis. Hurray!
I didn’t get Skypeiax to work..

This is how i did it – with Asterisk 1.4.x branch on the same machine skype should also do – running Debian 5.0

First you really need to have a working asterisk distribution , second you need to install Xvfb virtual frame buffer and skype itself the installation and configuration will depend between the systems so i can only cover debian here.
Xtightvnc helps you to install and configure Skype the first time.

  • You need to install xvfb, tightvncserver, dbus-x11, dbus, xfce4 ( for configuring skype)
  • Next, download skype (from here) and install it
  • Then we need SipToSis and install it:
    Download it from here unpack it and move it into /usr/local/siptosis

Use the following command to startup an X-11 VNC Server to start skype and configure it:

# vncserver

Connect to vncserver, usually to the display “:1” so in Tightvnc you need to enter the address like this: “172.0.0.254:1”.

After this, open up an console and start Skype:

# /usr/bin/skype

and configure a new (or existing) user in this VNC session, then close everything and kill the VNC Server:

#killall -9 vncserver

 

Now we have skype ready, we need to configure SipToSis, this is what i changed in the default siptosis.cfg config:

#host_port=5070
#username=skypests
#passwd=unimportantpassword
#do_register=no
host_port=5070
contact_url=sip:skypetestuser@172.0.0.254:5070
from_url="skypetestuser" <sip:siptosisuser@172.0.0.254:5060>
username=siptosisuser
realm=asterisk
passwd=siptosisregpassword
expires=3600
do_register=yes
minregrenewtime=120
regfailretrytime=15

Now we need to configure Asterisk with our new SIP User so it knows where to go when SipToSis tries to connect.
Asterisk’s sip.conf:

[siptosisuser]
username=siptosisuser
type=friend
context=from-sip
secret=siptosisregpassword
host=dynamic
nat=no
dtmfmode=auto
canreinvite=no ;(possibly set to yes if you know what you are doing)
qualify=yes

incominglimit=1
outgoinglimit=1
call-limit=1
busylevel=1

insecure=invite,port

As alwas the context is important, this is how i configured the extensions.conf:

For incoming Skype Calls:

[from-sip]
;Dialin from Skype
exten => skype,1,Dial(SIP/myPhone,30,j)

For Outgoing Skype Calls:

exten => 101,1,Dial(SIP/siptosisuser/mySkypeUser)

Save and restart Asterisk.

Now it it time to boot everything together, but first we need a startup script for our SipToSys System.

Startup Script use this for easy copy & paste:

--------------------------------------------------
#!/bin/sh
# loading sound driver
/sbin/modprobe snd_dummy
# setting DISPLAY
export DISPLAY=:1
# starting virtual framebuffer X-Server
nohup /usr/bin/Xvfb ${DISPLAY} -screen scrn 300x600x8 >/dev/null &
#Start Skype
nohup skype >/dev/null &
#Give it some Time to boot
sleep 5
#Start SipToSiS
cd /usr/local/siptosis
nohup ./SipToSis_linux siptosis.cfg >/dev/null &
-------------------------------------------------- 

After executing it look in the asterisk console (asterisk -r) and try to call the Skype user! ;)

Hopefully this is a way for you to make it easier to understand the Connection between Asterisk and skype. 

Have phun :)

References:
SipToSis Website: http://www.mhspot.com/sts/siptosis_ata_howto.html
SipToSis Forum: http://www.mhspot.com/stsforum/index.php
older SipToSis Infos: http://www.vitki.net/v/soho/voip

Startup Script: here
SipIAX Informations: http://www.opennet.ru/base/net/skype2sip.txt.html (use google translator)

Advertisements

1 Comment

  1. SipToSis with Asterisk « Predictor's Blog said,

    […] SipToSis with Asterisk SipToSis with Asterisk […]

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: