Resource icon

TUTORIAL How to add Skype and FreeSwitch to existing PIAF 2013-05-25

No permission to download

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
sukasem submitted a new resource:

How to add Skype and FreeSwitch to existing PIAF - Integrate Multiple Users and Multiple Channels Skype to Asterisk

Goal:
- To integrate Skype to PIAF
- Ability to have multiple Skype channels with same username and multiple usernames.
- No need for dedicate server to run FreeSwitch

Credits/References:
1. Big thanks to Bill Simon who wrote this guide http://www.personal.psu.edu/wcs131/blogs/psuvoip/2011/12/skype_for_asterisk_the_hard_way.html
2. FreeSwitch WiKi http://wiki.freeswitch.org/wiki/Mod_skypopen
3. PIAF Members: Ward, w1ve, Geo...

Before You Start:
1. Make sure you have...
Read more about this resource...
 
  • Like
Reactions: rjaiswal and lgaetz

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
Sorry, I have no time to test it yet. This is out of my memory before PIAF Forum crashed. Feel free to post any errors, I will fix it.
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
The other day I have problem with Skype client crash but FreeSwitch works fine. I didn't realize that Skype crashed because it have ring back but no answer. I thought no one pick up the phone.

So I create this dialplan to make Skype echo test and if Skype answer then it should work
exten => 2607,1,NoOp(Start Testing...)
exten => 2607,n,Set(COUNT=0)
exten => 2607,n(Testcall),Set(COUNT=$[${COUNT}+1])
exten => 2607,n,GotoIf($["${COUNT}" = "4"]?Email)
exten => 2607,n,Wait(10)
exten => 2607,n,Dial(Local/*[email protected],15,L(5000))
exten => 2607,n,GotoIf($["${DIALSTATUS}" = "ANSWER"]?OK:Testcall)
exten => 2607,n(Email),System(echo "Please Check Your Skype/FreeSwitch!" | mail -s "Skype Trunk Failed" [email protected])
exten => 2607,n,Hangup()
exten => 2607,n(OK),NoOp("Everyting Seems To Work Just Fine")
exten => 2607,n,Hangup()
You can set up Reminder (Other->Reminders) to do a test call everyday.

Or anyone has better idea to test it, please chime in ;)
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
I just installed the following on a dedicated box, but needed to
disable the sound drivers for the Skype installation. Below are the instructions to perform this
task. Your sound driver names may be different.

PIAF Installed Version = 2.0.6.4 under *HARDWARE* ¦
FreePBX Version = 2.11.0.10 ¦
Running Asterisk Version = 11.5.0 ¦
Asterisk Source Version = 11.5.0 ¦
Dahdi Source Version = 2.7.0 ¦
Libpri Source Version = 1.4.12 ¦
IP Address = 192.168.1.119 on eth0 ¦
Operating System = CentOS release 6.4 (Final) ¦
Kernel Version = 2.6.32-358.6.2.el6.i686 - 32 Bit


Sound Modules - How to disable for Skype Installation.

1. Enter : lsmod | grep snd (lists snd modules, those marked used by 0 are not used)

On my system, I see the following:

snd_hda_codec_hdmi 22905 4
snd_hda_codec_realtek 56796 1
snd_hda_intel 23032 0
snd_hda_codec 101885 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 5026 1 snd_hda_codec
snd_seq 44709 0
snd_seq_device 5124 1 snd_seq
snd_pcm 67800 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_timer 17152 2 snd_seq,snd_pcm
snd 51792 9 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer
soundcore 6390 1 snd
snd_page_alloc 6882 2 snd_hda_intel,snd_pcm

2. Lets backup the current environment:
cd /etc/modprobe.d
cp blacklist.conf blacklist.confSAVE

3. Check to see what is in the blacklist.conf alrady by entering : more blacklist.conf
The current blacklist already contains a statement:
# sound drivers
blacklist snd-pcsp

Need to add the modules above - all should be disabled

blacklist snd_hda_codec_hdmi
blacklist snd_hda_codec_realtek
blacklist snd_hda_codec
blacklist snd_hwdep
blacklist snd_seq_device
blacklist snd_pcm
blacklist snd_timer
blacklist snd
blacklist soundcore
blacklist snd_page_alloc
blacklist snd_hda_intel
blacklist snd_seq

4. vi blacklist.conf (add the list as discovered above)

5. Save and reboot.

6. Log back on as root and enter : lsmod | grep snd
You should see nothing. Back to the install....
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
I just installed the following on a dedicated box, but needed to
disable the sound drivers for the Skype installation. Below are the instructions to perform this
task. Your sound driver names may be different.

PIAF Installed Version = 2.0.6.4 under *HARDWARE* ¦
FreePBX Version = 2.11.0.10 ¦
Running Asterisk Version = 11.5.0 ¦
Asterisk Source Version = 11.5.0 ¦
Dahdi Source Version = 2.7.0 ¦
Libpri Source Version = 1.4.12 ¦
IP Address = 192.168.1.119 on eth0 ¦
Operating System = CentOS release 6.4 (Final) ¦
Kernel Version = 2.6.32-358.6.2.el6.i686 - 32 Bit


Sound Modules - How to disable for Skype Installation.

1. Enter : lsmod | grep snd (lists snd modules, those marked used by 0 are not used)

On my system, I see the following:

snd_hda_codec_hdmi 22905 4
snd_hda_codec_realtek 56796 1
snd_hda_intel 23032 0
snd_hda_codec 101885 3 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel
snd_hwdep 5026 1 snd_hda_codec
snd_seq 44709 0
snd_seq_device 5124 1 snd_seq
snd_pcm 67800 3 snd_hda_codec_hdmi,snd_hda_intel,snd_hda_codec
snd_timer 17152 2 snd_seq,snd_pcm
snd 51792 9 snd_hda_codec_hdmi,snd_hda_codec_realtek,snd_hda_intel,snd_hda_codec,snd_hwdep,snd_seq,snd_seq_device,snd_pcm,snd_timer
soundcore 6390 1 snd
snd_page_alloc 6882 2 snd_hda_intel,snd_pcm

2. Lets backup the current environment:
cd /etc/modprobe.d
cp blacklist.conf blacklist.confSAVE

3. Check to see what is in the blacklist.conf alrady by entering : more blacklist.conf
The current blacklist already contains a statement:
# sound drivers
blacklist snd-pcsp

Need to add the modules above - all should be disabled

blacklist snd_hda_codec_hdmi
blacklist snd_hda_codec_realtek
blacklist snd_hda_codec
blacklist snd_hwdep
blacklist snd_seq_device
blacklist snd_pcm
blacklist snd_timer
blacklist snd
blacklist soundcore
blacklist snd_page_alloc
blacklist snd_hda_intel
blacklist snd_seq

4. vi blacklist.conf (add the list as discovered above)

5. Save and reboot.

6. Log back on as root and enter : lsmod | grep snd
You should see nothing. Back to the install....
Or you can just disable sound from bios which is much easier. ;)
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
On the old Q100 and Q150 Lenovo's, it's not in the BIOS. These are the dollar store variety machines... :)

At any rate, the installation did not work for me - freeswitch through a ton of errors and didn't install properly. Not sure where the log is on this install, but someone else might try it. This was done on a fresh install on a 32bit machine this morning.

Didn't even create a freeswitch bin directory...

cd bin
-bash: cd: bin: No such file or directory
[email protected]:/usr/local/freeswitch $ ls
conf skypopen
[email protected]:/usr/local/freeswitch $

Addition:

Is there a way to uninstall what is there and start over?

Addition 2:

Removed the freeswitch directories and did a clean install. The last few lines of the install had errors and the /usr/local/freeswitch/bin directory was never propagated. Since I was running this on the actual machine, I couldn't do a screen dump, and of course /usr/local/freeswitch/log was empty.
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
Sorry, I have no time to test it yet. This is out of my memory before PIAF Forum crashed. Feel free to post any errors, I will fix it.
Reran, and here is what the console errors are (more attached in error.txt). Keep in mind, this is not a VM installation. I did pipe the install out to a txt file, if needed for trouble-shooting, but the errors at the bottom appear to be an issue.

Edit: Added the install.log

Code:
bootstrap: automake --no-force --add-missing --copy
configure.in:6: installing `./missing'
src/Makefile.am: installing `./depcomp'
bootstrap: rm -rf autom4te.cache
configure.in:150: installing `build/config/compile'
configure.in:27: installing `build/config/config.guess'
configure.in:27: installing `build/config/config.sub'
configure.in:16: installing `build/config/install-sh'
configure.in:16: installing `build/config/missing'
src/mod/applications/mod_expr/Makefile.am: installing `build/config/depcomp'
configure: WARNING: Could not find erlang, mod_erlang_event will not build, use --w
ith-erlang to specify the location
./configure: line 4853: AX_COMPILER_VENDOR: command not found
rm: cannot remove `conftest*': No such file or directory
grep: /usr/src/freeswitch/libs/apr/libtool: No such file or directory
config.status: WARNING:  'apr-config.in' seems to ignore the --datarootdir setting
rm: cannot remove `libtoolT': No such file or directory
config.status: WARNING:  'Makefile.in' seems to ignore the --datarootdir setting
config.status: WARNING:  'lib/Makefile.in' seems to ignore the --datarootdir settin
g
/bin/sh: /usr/src/freeswitch/libs/curl/missing: No such file or directory
configure: WARNING: `missing' script is too old or missing
configure: WARNING: dlfcn.h: present but cannot be compiled
configure: WARNING: dlfcn.h:    check for missing prerequisite headers?
configure: WARNING: dlfcn.h: see the Autoconf documentation
configure: WARNING: dlfcn.h:    section "Present But Cannot Be Compiled"
configure: WARNING: dlfcn.h: proceeding with the preprocessor's result
configure: WARNING: dlfcn.h: in the future, the compiler will take precedence
./configure: line 14588: : supported targets:.* elf: command not found
config.status: WARNING:  'config/autoconf.mk.in' seems to ignore the --datarootdir
setting
./configure: line 2002: /shtool: No such file or directory
configure: WARNING: *** External libs (FLAC, Ogg, Vorbis) disabled. ***
configure: WARNING: Touching files in directory tests/.
configure: WARNING: ** STUN support disabled **
./configure: line 11508: srcdir: command not found
config.status: WARNING:  'apr-config.in' seems to ignore the --datarootdir setting
rm: cannot remove `libtoolT': No such file or directory
crypto/cipher/aes_icm.c:323: warning: âaes_icm_advanceâ defined but not used
crypto/math/math.c:635: warning: âv128_left_shift2â defined but not used
config.status: WARNING:  'apr-config.in' seems to ignore the --datarootdir setting
rm: cannot remove `libtoolT': No such file or directory
host2str.c: In function âldns_key2buffer_strâ:
host2str.c:1473: warning: unused variable âiâ
net.c: In function âldns_sock_waitâ:
net.c:292: warning: unused variable âxâ
tif_dirinfo.c:195: warning: missing initializer
tif_dirinfo.c:195: warning: (near initialization for âtiffFields[138].field_subfiel
dsâ)
tif_jpeg.c: In function âJPEGDecodeRawâ:
tif_jpeg.c:1360: warning: comparison between signed and unsigned integer expression
s
t4_tx.c:307: warning: âbest_colour_resolutionâ defined but not used
t43.c:131: warning: ât43_create_headerâ defined but not used
testcpuid.c:89: warning: no previous prototype for âhas_MMXâ
testcpuid.c:113: warning: no previous prototype for âhas_SIMDâ
testcpuid.c:137: warning: no previous prototype for âhas_SIMD2â
testcpuid.c:161: warning: no previous prototype for âhas_3DNowâ
multipart mismatch with Recursive multipart ()
cc1: warnings being treated as errors
tport_type_ws.c: In function âtport_recv_stream_wsâ:
tport_type_ws.c:231: error: format â%ldâ expects type âlong intâ, but argument 11 h
as type âssize_tâ
make[9]: *** [tport_type_ws.lo] Error 1
make[8]: *** [all] Error 2
make[8]: *** No rule to make target `tport/libtport.la', needed by `libsofia-sip-ua
.la'.  Stop.
make[7]: *** [all-recursive] Error 1
make[6]: *** [all-recursive] Error 1
make[5]: *** [all] Error 2
make[4]: *** [/usr/src/freeswitch/libs/sofia-sip/libsofia-sip-ua/libsofia-sip-ua.la
] Error 2
make[3]: *** [mod_sofia-all] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
mv: cannot stat `/usr/local/freeswitch/conf/autoload_configs': No such file or dire
ctory
[email protected]:~ $  lsmod | grep snd
[email protected]:~ $
 

Attachments

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
Reran, and here is what the console errors are (more attached in error.txt). Keep in mind, this is not a VM installation. I did pipe the install out to a txt file, if needed for trouble-shooting, but the errors at the bottom appear to be an issue.

Edit: Added the install.log

Code:
bootstrap: automake --no-force --add-missing --copy
configure.in:6: installing `./missing'
src/Makefile.am: installing `./depcomp'
bootstrap: rm -rf autom4te.cache
configure.in:150: installing `build/config/compile'
configure.in:27: installing `build/config/config.guess'
configure.in:27: installing `build/config/config.sub'
configure.in:16: installing `build/config/install-sh'
configure.in:16: installing `build/config/missing'
src/mod/applications/mod_expr/Makefile.am: installing `build/config/depcomp'
configure: WARNING: Could not find erlang, mod_erlang_event will not build, use --w
ith-erlang to specify the location
./configure: line 4853: AX_COMPILER_VENDOR: command not found
rm: cannot remove `conftest*': No such file or directory
grep: /usr/src/freeswitch/libs/apr/libtool: No such file or directory
config.status: WARNING:  'apr-config.in' seems to ignore the --datarootdir setting
rm: cannot remove `libtoolT': No such file or directory
config.status: WARNING:  'Makefile.in' seems to ignore the --datarootdir setting
config.status: WARNING:  'lib/Makefile.in' seems to ignore the --datarootdir settin
g
/bin/sh: /usr/src/freeswitch/libs/curl/missing: No such file or directory
configure: WARNING: `missing' script is too old or missing
configure: WARNING: dlfcn.h: present but cannot be compiled
configure: WARNING: dlfcn.h:    check for missing prerequisite headers?
configure: WARNING: dlfcn.h: see the Autoconf documentation
configure: WARNING: dlfcn.h:    section "Present But Cannot Be Compiled"
configure: WARNING: dlfcn.h: proceeding with the preprocessor's result
configure: WARNING: dlfcn.h: in the future, the compiler will take precedence
./configure: line 14588: : supported targets:.* elf: command not found
config.status: WARNING:  'config/autoconf.mk.in' seems to ignore the --datarootdir
setting
./configure: line 2002: /shtool: No such file or directory
configure: WARNING: *** External libs (FLAC, Ogg, Vorbis) disabled. ***
configure: WARNING: Touching files in directory tests/.
configure: WARNING: ** STUN support disabled **
./configure: line 11508: srcdir: command not found
config.status: WARNING:  'apr-config.in' seems to ignore the --datarootdir setting
rm: cannot remove `libtoolT': No such file or directory
crypto/cipher/aes_icm.c:323: warning: âaes_icm_advanceâ defined but not used
crypto/math/math.c:635: warning: âv128_left_shift2â defined but not used
config.status: WARNING:  'apr-config.in' seems to ignore the --datarootdir setting
rm: cannot remove `libtoolT': No such file or directory
host2str.c: In function âldns_key2buffer_strâ:
host2str.c:1473: warning: unused variable âiâ
net.c: In function âldns_sock_waitâ:
net.c:292: warning: unused variable âxâ
tif_dirinfo.c:195: warning: missing initializer
tif_dirinfo.c:195: warning: (near initialization for âtiffFields[138].field_subfiel
dsâ)
tif_jpeg.c: In function âJPEGDecodeRawâ:
tif_jpeg.c:1360: warning: comparison between signed and unsigned integer expression
s
t4_tx.c:307: warning: âbest_colour_resolutionâ defined but not used
t43.c:131: warning: ât43_create_headerâ defined but not used
testcpuid.c:89: warning: no previous prototype for âhas_MMXâ
testcpuid.c:113: warning: no previous prototype for âhas_SIMDâ
testcpuid.c:137: warning: no previous prototype for âhas_SIMD2â
testcpuid.c:161: warning: no previous prototype for âhas_3DNowâ
multipart mismatch with Recursive multipart ()
cc1: warnings being treated as errors
tport_type_ws.c: In function âtport_recv_stream_wsâ:
tport_type_ws.c:231: error: format â%ldâ expects type âlong intâ, but argument 11 h
as type âssize_tâ
make[9]: *** [tport_type_ws.lo] Error 1
make[8]: *** [all] Error 2
make[8]: *** No rule to make target `tport/libtport.la', needed by `libsofia-sip-ua
.la'.  Stop.
make[7]: *** [all-recursive] Error 1
make[6]: *** [all-recursive] Error 1
make[5]: *** [all] Error 2
make[4]: *** [/usr/src/freeswitch/libs/sofia-sip/libsofia-sip-ua/libsofia-sip-ua.la
] Error 2
make[3]: *** [mod_sofia-all] Error 1
make[2]: *** [all-recursive] Error 1
make[1]: *** [all-recursive] Error 1
make: *** [all] Error 2
mv: cannot stat `/usr/local/freeswitch/conf/autoload_configs': No such file or dire
ctory
[email protected]:~ $  lsmod | grep snd
[email protected]:~ $
I just installed on VM 2 days ago and it was fine. I have no spare actual hardware laying around.
 

wardmundy

Nerd Uno
Joined
Oct 12, 2007
Messages
15,245
Reaction score
2,670
Microsoft and Google run neck in neck in trying to out-proprietary each other. It's probably an understatement to suggest that Skype and Google Voice are not for those that actually need something to work consistently. :puke:

There is a PIAF-Green-FreeSwitch-Skype VM that works for me most of the time with VirtualBox, but you still have to run the skype-install script once you load the VM. But it's worth a try.

Tutorial available here.
 

gpuser

Member
Joined
Aug 19, 2013
Messages
37
Reaction score
12
Reran, and here is what the console errors are (more attached in error.txt). Keep in mind, this is not a VM installation. I did pipe the install out to a txt file, if needed for trouble-shooting, but the errors at the bottom appear to be an issue.

Edit: Added the install.log

[/code]
Please delete /usr/src/freeswitch and pull stable version 1.2 from git

You could also replace the current line in the script with the below one and run again. Goodluck!
git clone -b v1.2.stable git://git.freeswitch.org/freeswitch.git
 

gpuser

Member
Joined
Aug 19, 2013
Messages
37
Reaction score
12
I just wish to make a suggestion if I may. Towards the end of your tutorial, it says to add a custom extension with SIP/[email protected]:5070. Unfortunately using this method means the call won't be showing up in FOP2. So I changed mine to
SIP/skype_trunk_name/skype_id_to_call and this works like a normal call.

ie SIP/Skype/echo123

Also it is better to edit the codec pref in freeswitch.xml to make [email protected] the first entry and in FreePBX trunk peer details add

disallow=all
allow=slin16&silk8&ulaw
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
There is a PIAF-Green-FreeSwitch-Skype VM that works for me most of the time with VirtualBox, but you still have to run the skype-install script once you load the VM. But it's worth a try.

Tutorial available here.
Worked like a charm. I'm thinking the install script without the VM is what is lacking, like it's missing a setting inside of Freeswitch. I'll did around a bit more, but I almost had it working - inbound calls only on a 32bit install. I'll keep pecking. I have way to many play servers....

Question though. Isn't there a way to take the VB 64 bit green and restore a 64 bit machine? I ask as I restored my system to this along with the Skype entries and bingo, works like a champ...
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
Trimline2 Finally, I got real machine to test on. I did got error but I did delete /usr/src/freeswitch and try again and everything all fine.

It's old AMD X2 3800 machine with PIAF 2.0.6.4.4 32Bit.
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
gpuser I'm wondering what codec on your skype client side. I'm getting G.729 on skype.
Skype (G729) -> FreeSwitch (L16) -> Asterisk (L16).
 

Trimline2

Guru
Joined
May 23, 2013
Messages
525
Reaction score
95
Location
Orlando, FL
Trimline2 Finally, I got real machine to test on. I did got error but I did delete /usr/src/freeswitch and try again and everything all fine.

It's old AMD X2 3800 machine with PIAF 2.0.6.4.4 32Bit.
I actually got it on a 32 bit machine, how, I don't know. I probably did the same as you but was poking around so much on a test box, I didn't take notes (make sure to update yours). :)

By the way, there is a wonderful tutorial on how to move a system from Oracle's Virtual Box to a physical machine using Clonezilla. I tried it and it worked famously. Here's the link in case someone wants to tinker even more: http://www.ehow.com/how_12141234_boot-clonezilla-live-virtualbox.html
 

gpuser

Member
Joined
Aug 19, 2013
Messages
37
Reaction score
12
gpuser I'm wondering what codec on your skype client side. I'm getting G.729 on skype.
Skype (G729) -> FreeSwitch (L16) -> Asterisk (L16).
I think we have a problem here by using a very old static version of Skype for this set up. Skype is very good at selecting an appropriate codec depending upon a range of factors including jitter in the packet stream. You can decide which codec to use by changing config on the caller side.

http://timesinker.blogspot.com.au/2009/05/skype-codec-selection.html

Disabling G729 will see PCMU (G711u) is used as the next preference. However SILK or any other codecs are not accepeted (call is dropped), I think because of older skype client.

I do hope someone here will be successful in integrating a newer skype client (static or dynamic) with freeswitch and give us a heads up on the procedure. Interestingly freeswitch skypopen wiki page already mentions Skype version 4.0 but is unsupported whatever that means!

http://wiki.freeswitch.org/wiki/Mod_skypopen_Skype_Endpoint_and_Trunk
 

sukasem

Guru
Joined
Sep 13, 2008
Messages
143
Reaction score
26
Skype 4 don't support OSS. So, you need to enable sound back on and this assumed you have Alsa and Pulseaudio installed on your machine which is normally do on PIAF. I tested it on VM 32 bit.
 

Members online

PIAF 5 - Powered by 3CX

Forum statistics

Threads
22,455
Messages
138,065
Members
14,620
Latest member
Brads#Bell