SippySkype Skype Adapter
From FreeSWITCH Wiki
What is SippySkype? (taken from SippySkype home page) SippySkype is a GPL licensed cross-platform Java software that allows making and receiving Skype calls from any SIP adapter. Basically, it's a Skype/FreeSwitch Bridge/Gateway/Proxy/Adapter/Converter.
Contents |
Interconnectivity architecture
SippySkype interconnects with FreeSWITCH as an add-on adapter to Skype client. The adapter acts as a single-line client User-agent to FreeSWITCH that can send and receive calls just like any other UA. SippySkype also allow for some basic switching capabilities in both directions. It can distribute calls coming from FreeSWITCH to different Skype contacts based on the Caller-ID field and can also send incoming Skype calls to different URI's based on the incoming Skype contact ID. It also has a very basic IVR mechanism allowing to dial through the SkypeOut / SpeedDials services.
Applicable interconnectivity settings
- Signaling: SIP/UDP or SIP/TCP
- Codecs: G.711μ only.
- DTMF: RFC2833, Info and analogue (in-band).
Limitations
- Supports only one codec
- Supports only one simultaneous call
Prerequisits
- SippySkype has to run on the same machine as the Skype client
- Skype client version 3 and above
- Java runtime version 1.5 and above
- Any OS that Skype2Java (Skype's Java API) works: Windows, Linux, OSX
Example implementation
Outline
This implementation example is based on the existing out-of-the-box FreeSwitch XML configuration with relevant additions. In this example, the italic settings should be customized to your deployment:
- Freeswitch machine: 192.168.0.100
- Skype machine: 192.168.0.200
- skypeuser1 - Preconfigured Skype contact in the client
- skypeuser2 - Preconfigured Skype contact in the client
- skypeuser3 - Preconfigured Skype contact in the client
- Extension 7770 – A number designated to general Skype outgoing calls with PIN code 1234
- Extension 7771 – An extension map to skypeuser1
- Extension 7772 – An extension map to skypeuser2
- Extension 7773 – An extension map to skypeuser3
- The SippySkype SIP port is mapped to UDP port 5077 for no reason at all
- Incoming calls coming from these three contacts will be directed respectively to extension 1001, 1002.
- For demonstration purposes, all calls coming from skypeuser3 are rejected.
- All other incoming calls will be directed to extension 9999 (MoH).
SippySkype Configuration
sippyskype.cfg settings
siptoskypeauthfile=SipToSkypeAuth.props skypetosipauthfile=SkypeToSipAuth.props skype_connect=yes skype_audiooutport=64432 skype_audioinport=64433 skype_audiooutgain=1 skype_audioingain=1.5 enableSkypeDtmfDetector=no autoShutdownMinutes=0 pintimeout=8 pinretrylimit=3 destinationtimeout=12 destinationretrylimit=3 pinFile=clips/enterPin.au destinationFile=clips/enterDest.au dialingFile=clips/dialing.au invalidPinFile=clips/invalidPin.au invalidDestFile=clips/invalidDest.au handleEarlyMedia=no sendSkypeIM=no host_port=5077 transport_protocols=udp ua_jar=ua.jar contact_url=sip:skype@192.168.1.200:5077 from_url="SippySkype" <sip:skype@192.168.1.100:5060> username=skype realm=192.168.1.100 passwd=1234 keepalive_time=45000 audio=yes audio_port=63200 audio_avp=0 audio_codec=PCMU audio_sample_rate=8000 audio_sample_size=1 audio_frame_size=320 dtmf2833payloadtype=101 do_register=yes
SipToSkypeAuth.props settings
7770,*,*,pin:1234 #Prompt for pin authorization, then prompt for destination (use Skype's speeddials or skypeout for skype destinations) 7771,*,*,skypeuser1 #Incoming sip caller with callerid of 7771 from any IP will dial the skypeuser1 7772,*,*,skypeuser2 7773,*,*,skypeuser3
SkypeToSipAuth.props settings
skypeuser1,sip:1001@192.168.1.100:5060 skypeuser2,sip:1002@192.168.1.100:5060 skypeuser3,deny *,sip:9999@192.168.1.100:5060
FreeSwitch setup
Set up the SippySkype adapter as a directory user (i.e. /conf/directory/default/skype.xml):
<include>
<user id="skype" ip="192.168.1.200">
<variables>
<variable name="user_context" value="default"/>
<variable name="process_cdr" value="true"/>
</variables>
</user>
</include>
Set up the Dial Plan extensions handling (i.e. /conf/dialplan/default.xml):
<extension name="skype">
<condition field="destination_number" expression="^(777[0-3])$">
<action application="set" data="effective_caller_id_number=$1"/>
<action application="bridge" data="user/skype@$${domain}"/>
</condition>
</extension>
Usage
- Dialing from extension 1001 to 7770 - Being prompt for PIN, entering 1234 and then making a SkypeOut / SpeedDials call
- Dialing from extension 1001 to 7771 - Make a call to Skype contact skypeuser1
- Dialing from extension 1001 to 7772 - Make a call to Skype contact skypeuser2
- Dialing from extension 1001 to 7773 - Make a call to Skype contact skypeuser3
- Accepting incoming call from Skype contact skypeuser1 - Call will be transfered to FreeSwitch extension 1001
- Accepting incoming call from Skype contact skypeuser2 - Call will be transfered to FreeSwitch extension 1002
- Accepting incoming call from Skype contact skypeuser3 - Call will be denied
- Accepting incoming call from any other Skype contact - Call with be transfered to FreeSwitch extension 9999 (MoH)
Limitations
Testing was done on:
- FreeSwitch version 1.0.0 build 8691
- SippySkype version V2 2008/06/28
Wasn't tested:
- SIP/TCP
- DTMF INFO and analogue
Known issues
- Authentication - It appears as the SippySkype SIP authentication mechanism is not compatible with the FreeSwitch one therefore authenticated registration doesn't seem to work.
