diff --git a/Freeswitch.2008.express.sln b/Freeswitch.2008.express.sln index 7d2907e377..5d298734c8 100644 --- a/Freeswitch.2008.express.sln +++ b/Freeswitch.2008.express.sln @@ -603,7 +603,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_say_ru", "src\mod\say\m {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypiax", "src\mod\endpoints\mod_skypiax\mod_skypiax.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypopen", "src\mod\endpoints\mod_skypopen\mod_skypopen.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" ProjectSection(ProjectDependencies) = postProject {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection diff --git a/Freeswitch.2008.sln b/Freeswitch.2008.sln index cbef010a36..31d1d3623a 100644 --- a/Freeswitch.2008.sln +++ b/Freeswitch.2008.sln @@ -956,7 +956,7 @@ Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skel", "src\mod\applica {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypiax", "src\mod\endpoints\mod_skypiax\mod_skypiax.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" +Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "mod_skypopen", "src\mod\endpoints\mod_skypopen\mod_skypopen.2008.vcproj", "{C6E78A4C-DB1E-47F4-9B63-4DC27D86343F}" ProjectSection(ProjectDependencies) = postProject {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} = {202D7A4E-760D-4D0E-AFA1-D7459CED30FF} EndProjectSection diff --git a/configure.in b/configure.in index 4a1fd42e96..416d21cb93 100644 --- a/configure.in +++ b/configure.in @@ -865,7 +865,7 @@ AC_CONFIG_FILES([Makefile src/mod/applications/mod_t38gateway/Makefile src/mod/endpoints/mod_portaudio/Makefile src/mod/endpoints/mod_skinny/Makefile - src/mod/endpoints/mod_skypiax/Makefile + src/mod/endpoints/mod_skypopen/Makefile src/mod/endpoints/mod_sofia/Makefile src/mod/formats/mod_portaudio_stream/Makefile src/mod/asr_tts/mod_unimrcp/Makefile diff --git a/src/mod/endpoints/mod_skypiax/Makefile.am b/src/mod/endpoints/mod_skypiax/Makefile.am deleted file mode 100644 index b068add211..0000000000 --- a/src/mod/endpoints/mod_skypiax/Makefile.am +++ /dev/null @@ -1,7 +0,0 @@ -include $(top_srcdir)/build/modmake.rulesam -MODNAME=mod_skypiax -mod_LTLIBRARIES = mod_skypiax.la -mod_skypiax_la_SOURCES = mod_skypiax.c skypiax_protocol.c -mod_skypiax_la_CFLAGS = $(AM_CFLAGS) -DSKYPIAX_SVN_VERSION=\"`cat $(switch_builddir)/.version`\" -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff -mod_skypiax_la_LIBADD = $(switch_builddir)/libfreeswitch.la -mod_skypiax_la_LDFLAGS = -L../../../../libs/spandsp/src -avoid-version -module -no-undefined -shared -lX11 -lspandsp diff --git a/src/mod/endpoints/mod_skypiax/asterisk/skypiax_protocol.c b/src/mod/endpoints/mod_skypiax/asterisk/skypiax_protocol.c deleted file mode 120000 index 85619eb428..0000000000 --- a/src/mod/endpoints/mod_skypiax/asterisk/skypiax_protocol.c +++ /dev/null @@ -1 +0,0 @@ -../skypiax_protocol.c \ No newline at end of file diff --git a/src/mod/endpoints/mod_skypiax/configs/copy b/src/mod/endpoints/mod_skypiax/configs/copy deleted file mode 100644 index f004a26ae3..0000000000 --- a/src/mod/endpoints/mod_skypiax/configs/copy +++ /dev/null @@ -1,39 +0,0 @@ -cp -a skypiax101/* skypiax102/ -cp -a skypiax101/* skypiax103/ -cp -a skypiax101/* skypiax104/ -cp -a skypiax101/* skypiax105/ -cp -a skypiax101/* skypiax106/ -cp -a skypiax101/* skypiax107/ -cp -a skypiax101/* skypiax108/ -cp -a skypiax101/* skypiax109/ -cp -a skypiax101/* skypiax110/ -cp -a skypiax101/* skypiax111/ -cp -a skypiax101/* skypiax112/ -cp -a skypiax101/* skypiax113/ -cp -a skypiax101/* skypiax114/ -cp -a skypiax101/* skypiax115/ -cp -a skypiax101/* skypiax116/ -cp -a skypiax101/* skypiax117/ -cp -a skypiax101/* skypiax118/ -cp -a skypiax101/* skypiax119/ -cp -a skypiax101/* skypiax120/ -cp -a skypiax101/* skypiax121/ -cp -a skypiax101/* skypiax122/ -cp -a skypiax101/* skypiax123/ -cp -a skypiax101/* skypiax124/ -cp -a skypiax101/* skypiax125/ -cp -a skypiax101/* skypiax126/ -cp -a skypiax101/* skypiax127/ -cp -a skypiax101/* skypiax128/ -cp -a skypiax101/* skypiax129/ -cp -a skypiax101/* skypiax130/ -cp -a skypiax101/* skypiax131/ -cp -a skypiax101/* skypiax132/ -cp -a skypiax101/* skypiax133/ -cp -a skypiax101/* skypiax134/ -cp -a skypiax101/* skypiax135/ -cp -a skypiax101/* skypiax136/ -cp -a skypiax101/* skypiax137/ -cp -a skypiax101/* skypiax138/ -cp -a skypiax101/* skypiax139/ -cp -a skypiax101/* skypiax140/ diff --git a/src/mod/endpoints/mod_skypiax/configs/create b/src/mod/endpoints/mod_skypiax/configs/create deleted file mode 100644 index 84a8af1563..0000000000 --- a/src/mod/endpoints/mod_skypiax/configs/create +++ /dev/null @@ -1,40 +0,0 @@ -mkdir skypiax101 -mkdir skypiax102 -mkdir skypiax103 -mkdir skypiax104 -mkdir skypiax105 -mkdir skypiax106 -mkdir skypiax107 -mkdir skypiax108 -mkdir skypiax109 -mkdir skypiax110 -mkdir skypiax111 -mkdir skypiax112 -mkdir skypiax113 -mkdir skypiax114 -mkdir skypiax115 -mkdir skypiax116 -mkdir skypiax117 -mkdir skypiax118 -mkdir skypiax119 -mkdir skypiax120 -mkdir skypiax121 -mkdir skypiax122 -mkdir skypiax123 -mkdir skypiax124 -mkdir skypiax125 -mkdir skypiax126 -mkdir skypiax127 -mkdir skypiax128 -mkdir skypiax129 -mkdir skypiax130 -mkdir skypiax131 -mkdir skypiax132 -mkdir skypiax133 -mkdir skypiax134 -mkdir skypiax135 -mkdir skypiax136 -mkdir skypiax137 -mkdir skypiax138 -mkdir skypiax139 -mkdir skypiax140 diff --git a/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/README b/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/README deleted file mode 100644 index 0b939bc3ca..0000000000 --- a/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/README +++ /dev/null @@ -1,6 +0,0 @@ -# execute both of the files, they give you 10 interfaces each (look for the "exit 0" line) -# then use the skypiax.conf here to manage the 20 interfaces - -sh ./multi.sh -sh ./multi2.sh - diff --git a/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/multi.sh b/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/multi.sh deleted file mode 100755 index 6411744291..0000000000 --- a/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/multi.sh +++ /dev/null @@ -1,145 +0,0 @@ -# remember to add here the removing of all the installed snd-* modules, so you're sure only the snd-dummy driver will be around -rmmod snd_hda_intel -rmmod snd-dummy - -# if you DO NOT USE the custom ALSA device we provide, you need three "standard" dummy soundcard for 20 Skype client instances, because each "standard" dummy soundcard can handle a max of 8 Skype instances -# the enable= module parameter tells how many cards to start. For each additional card, add a comma and a 1 -# manually configure the first 8 Skype client instances to use the hw:Dummy_0, the next 8 instances to use hw:Dummy_1, etc for all three devices (Play, Capture, Ring) -modprobe snd-dummy # enable=1,1,1 -sleep 3 - -#start the fake X server on a given port - /usr/bin/Xvfb :101 -ac & -sleep 3 - -# start a Skype client instance that will connect to the X server above, and will login to the Skype network using the 'username password' you send to it on stdin. Here xxxx would be the password and skypiax1 the username -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:101 /usr/bin/skype --dbpath=/root/multi/skypiax101 --pipelogin &" - - -sleep 7 - - - /usr/bin/Xvfb :102 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:102 /usr/bin/skype --dbpath=/root/multi/skypiax102 --pipelogin &" - -sleep 7 - - -################################################################# -# Following X server Skype client instances are commented out -################################################################# - /usr/bin/Xvfb :103 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:103 /usr/bin/skype --dbpath=/root/multi/skypiax103 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :104 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:104 /usr/bin/skype --dbpath=/root/multi/skypiax104 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :105 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:105 /usr/bin/skype --dbpath=/root/multi/skypiax105 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :106 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:106 /usr/bin/skype --dbpath=/root/multi/skypiax106 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :107 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:107 /usr/bin/skype --dbpath=/root/multi/skypiax107 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :108 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:108 /usr/bin/skype --dbpath=/root/multi/skypiax108 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :109 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:109 /usr/bin/skype --dbpath=/root/multi/skypiax109 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :110 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:110 /usr/bin/skype --dbpath=/root/multi/skypiax110 --pipelogin &" - -sleep 7 - -exit 0 - - /usr/bin/Xvfb :111 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:111 /usr/bin/skype --dbpath=/root/multi/skypiax111 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :112 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:112 /usr/bin/skype --dbpath=/root/multi/skypiax112 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :113 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:113 /usr/bin/skype --dbpath=/root/multi/skypiax113 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :114 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:114 /usr/bin/skype --dbpath=/root/multi/skypiax114 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :115 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:115 /usr/bin/skype --dbpath=/root/multi/skypiax115 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :116 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:116 /usr/bin/skype --dbpath=/root/multi/skypiax116 --pipelogin &" - -sleep 7 - - /usr/bin/Xvfb :117 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:117 /usr/bin/skype --dbpath=/root/multi/skypiax117 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :118 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:118 /usr/bin/skype --dbpath=/root/multi/skypiax118 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :119 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:119 /usr/bin/skype --dbpath=/root/multi/skypiax119 --pipelogin &" - -sleep 7 - /usr/bin/Xvfb :120 -ac & -sleep 3 - -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:120 /usr/bin/skype --dbpath=/root/multi/skypiax120 --pipelogin &" - -sleep 7 - diff --git a/src/mod/endpoints/mod_skypiax/configs/startskype.bat b/src/mod/endpoints/mod_skypiax/configs/startskype.bat deleted file mode 100644 index 40042fb698..0000000000 --- a/src/mod/endpoints/mod_skypiax/configs/startskype.bat +++ /dev/null @@ -1,52 +0,0 @@ -echo off -REM -REM you MUST use the new Skype BETA (4.x) for Windows, older versions (3.x) cannot be started this way -REM -REM you have to adjust PATH to where the Skype executable is -set PATH=%PATH%;C:\Program Files\Skype\Phone\ - -echo %PATH% - -REM start a Skype client instance that will login to the Skype network using the "username password" you give to it. Here xxx would be the password and skypiax1 the username -start Skype.exe /secondary /username:skypiax1 /password:xxx -call wait 7 -start Skype.exe /secondary /username:skypiax2 /password:xxx -call wait 7 -REM -REM Following Skype client instances are commented out -REM -REM start Skype.exe /secondary /username:skypiax3 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax4 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax5 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax6 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax7 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax8 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax9 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax10 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax11 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax12 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax13 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax14 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax15 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax16 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax17 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax18 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax19 /password:xxx -REM call wait 7 -REM start Skype.exe /secondary /username:skypiax20 /password:xxx diff --git a/src/mod/endpoints/mod_skypiax/configs/windows-service/startskype.cmd b/src/mod/endpoints/mod_skypiax/configs/windows-service/startskype.cmd deleted file mode 100644 index 4cf1025b57..0000000000 --- a/src/mod/endpoints/mod_skypiax/configs/windows-service/startskype.cmd +++ /dev/null @@ -1,61 +0,0 @@ -echo off - -REM -REM you MUST use the new Skype BETA (4.x) for Windows, older versions (3.x) cannot be started this way -REM -REM you have to adjust PATH to where the Skype executable is -set PATH=%PATH%;C:\Program Files\Skype\Phone\ - -REM echo %PATH% - -REM start a Skype client instance that will login to the Skype network using the "username password" you give to it. -REM Here xxxx would be the password and skypiax1 the username - -start Skype.exe /secondary /username:skypiax20 /password:xxxx -call C:\wait.cmd 20 - -start Skype.exe /secondary /username:skypiax19 /password:xxxx -call C:\wait.cmd 5 - -REM -REM Following Skype client instances are commented out -REM - -start Skype.exe /secondary /username:skypiax18 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax17 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax16 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax15 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax14 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax13 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax12 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax11 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax10 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax9 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax8 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax7 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax6 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax5 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax4 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax3 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax2 /password:xxxx -call C:\wait.cmd 5 -start Skype.exe /secondary /username:skypiax1 /password:xxxx -call C:\wait.cmd 120 -NET start AICCU2 -pause diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/Makefile.am b/src/mod/endpoints/mod_skypopen/Makefile.am similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/Makefile.am rename to src/mod/endpoints/mod_skypopen/Makefile.am diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/README b/src/mod/endpoints/mod_skypopen/README similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/README rename to src/mod/endpoints/mod_skypopen/README diff --git a/src/mod/endpoints/mod_skypiax/alsa/alsa-driver-1.0.20-dummy.c b/src/mod/endpoints/mod_skypopen/alsa/alsa-driver-1.0.20-dummy.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/alsa/alsa-driver-1.0.20-dummy.c rename to src/mod/endpoints/mod_skypopen/alsa/alsa-driver-1.0.20-dummy.c diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/alsa/dummy.c b/src/mod/endpoints/mod_skypopen/alsa/dummy.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/alsa/dummy.c rename to src/mod/endpoints/mod_skypopen/alsa/dummy.c diff --git a/src/mod/endpoints/mod_skypiax/asterisk/Makefile b/src/mod/endpoints/mod_skypopen/asterisk/Makefile similarity index 100% rename from src/mod/endpoints/mod_skypiax/asterisk/Makefile rename to src/mod/endpoints/mod_skypopen/asterisk/Makefile diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/README b/src/mod/endpoints/mod_skypopen/asterisk/README similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/README rename to src/mod/endpoints/mod_skypopen/asterisk/README diff --git a/src/mod/endpoints/mod_skypiax/asterisk/chan_skypiax.c b/src/mod/endpoints/mod_skypopen/asterisk/chan_skypiax.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/asterisk/chan_skypiax.c rename to src/mod/endpoints/mod_skypopen/asterisk/chan_skypiax.c diff --git a/src/mod/endpoints/mod_skypiax/asterisk/cyg_no_pthread_kill.c b/src/mod/endpoints/mod_skypopen/asterisk/cyg_no_pthread_kill.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/asterisk/cyg_no_pthread_kill.c rename to src/mod/endpoints/mod_skypopen/asterisk/cyg_no_pthread_kill.c diff --git a/src/mod/endpoints/mod_skypiax/asterisk/skypiax.conf b/src/mod/endpoints/mod_skypopen/asterisk/skypiax.conf similarity index 100% rename from src/mod/endpoints/mod_skypiax/asterisk/skypiax.conf rename to src/mod/endpoints/mod_skypopen/asterisk/skypiax.conf diff --git a/src/mod/endpoints/mod_skypiax/asterisk/skypiax.h b/src/mod/endpoints/mod_skypopen/asterisk/skypiax.h similarity index 100% rename from src/mod/endpoints/mod_skypiax/asterisk/skypiax.h rename to src/mod/endpoints/mod_skypopen/asterisk/skypiax.h diff --git a/src/mod/endpoints/mod_skypiax/configs/README.skypiax_auth b/src/mod/endpoints/mod_skypopen/configs/README.skypiax_auth similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/README.skypiax_auth rename to src/mod/endpoints/mod_skypopen/configs/README.skypiax_auth diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/README.skypopen_auth b/src/mod/endpoints/mod_skypopen/configs/README.skypopen_auth similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/README.skypopen_auth rename to src/mod/endpoints/mod_skypopen/configs/README.skypopen_auth diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/client.c b/src/mod/endpoints/mod_skypopen/configs/client.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/client.c rename to src/mod/endpoints/mod_skypopen/configs/client.c diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/copy b/src/mod/endpoints/mod_skypopen/configs/copy similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/copy rename to src/mod/endpoints/mod_skypopen/configs/copy diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/create b/src/mod/endpoints/mod_skypopen/configs/create similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/create rename to src/mod/endpoints/mod_skypopen/configs/create diff --git a/src/mod/endpoints/mod_skypiax/configs/default.xml b/src/mod/endpoints/mod_skypopen/configs/default.xml similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/default.xml rename to src/mod/endpoints/mod_skypopen/configs/default.xml diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/multiple-instance-same-skype-username/README b/src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/README similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/multiple-instance-same-skype-username/README rename to src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/README diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh b/src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh old mode 100644 new mode 100755 similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh rename to src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh diff --git a/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/multi2.sh b/src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/multi2.sh similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/multi2.sh rename to src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/multi2.sh diff --git a/src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/skypiax.conf.xml b/src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/skypiax.conf.xml similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/multiple-instance-same-skype-username/skypiax.conf.xml rename to src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/skypiax.conf.xml diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml b/src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml rename to src/mod/endpoints/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml diff --git a/src/mod/endpoints/mod_skypiax/configs/skypiax.X.conf b/src/mod/endpoints/mod_skypopen/configs/skypiax.X.conf similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/skypiax.X.conf rename to src/mod/endpoints/mod_skypopen/configs/skypiax.X.conf diff --git a/src/mod/endpoints/mod_skypiax/configs/skypiax.conf.xml b/src/mod/endpoints/mod_skypopen/configs/skypiax.conf.xml similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/skypiax.conf.xml rename to src/mod/endpoints/mod_skypopen/configs/skypiax.conf.xml diff --git a/src/mod/endpoints/mod_skypiax/configs/skypiax_auth.c b/src/mod/endpoints/mod_skypopen/configs/skypiax_auth.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/skypiax_auth.c rename to src/mod/endpoints/mod_skypopen/configs/skypiax_auth.c diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/skypopen.conf.xml b/src/mod/endpoints/mod_skypopen/configs/skypopen.conf.xml similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/skypopen.conf.xml rename to src/mod/endpoints/mod_skypopen/configs/skypopen.conf.xml diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/skypopen_auth.c b/src/mod/endpoints/mod_skypopen/configs/skypopen_auth.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/skypopen_auth.c rename to src/mod/endpoints/mod_skypopen/configs/skypopen_auth.c diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/startskype.bat b/src/mod/endpoints/mod_skypopen/configs/startskype.bat similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/startskype.bat rename to src/mod/endpoints/mod_skypopen/configs/startskype.bat diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/startskype.sh b/src/mod/endpoints/mod_skypopen/configs/startskype.sh similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/startskype.sh rename to src/mod/endpoints/mod_skypopen/configs/startskype.sh diff --git a/src/mod/endpoints/mod_skypiax/configs/wait.bat b/src/mod/endpoints/mod_skypopen/configs/wait.bat similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/wait.bat rename to src/mod/endpoints/mod_skypopen/configs/wait.bat diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/windows-service/startskype.cmd b/src/mod/endpoints/mod_skypopen/configs/windows-service/startskype.cmd similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/windows-service/startskype.cmd rename to src/mod/endpoints/mod_skypopen/configs/windows-service/startskype.cmd diff --git a/src/mod/endpoints/mod_skypiax/configs/windows-service/wait.cmd b/src/mod/endpoints/mod_skypopen/configs/windows-service/wait.cmd similarity index 100% rename from src/mod/endpoints/mod_skypiax/configs/windows-service/wait.cmd rename to src/mod/endpoints/mod_skypopen/configs/windows-service/wait.cmd diff --git a/src/mod/endpoints/mod_skypiax/kernel/README-linux-2.6.24.7 b/src/mod/endpoints/mod_skypopen/kernel/README-linux-2.6.24.7 similarity index 100% rename from src/mod/endpoints/mod_skypiax/kernel/README-linux-2.6.24.7 rename to src/mod/endpoints/mod_skypopen/kernel/README-linux-2.6.24.7 diff --git a/src/mod/endpoints/mod_skypiax/kernel/config-linux-2.6.24.7-skypiax08D01 b/src/mod/endpoints/mod_skypopen/kernel/config-linux-2.6.24.7-skypiax08D01 similarity index 100% rename from src/mod/endpoints/mod_skypiax/kernel/config-linux-2.6.24.7-skypiax08D01 rename to src/mod/endpoints/mod_skypopen/kernel/config-linux-2.6.24.7-skypiax08D01 diff --git a/src/mod/endpoints/mod_skypiax/kernel/dummy.c.skypiax b/src/mod/endpoints/mod_skypopen/kernel/dummy.c.skypiax similarity index 100% rename from src/mod/endpoints/mod_skypiax/kernel/dummy.c.skypiax rename to src/mod/endpoints/mod_skypopen/kernel/dummy.c.skypiax diff --git a/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj b/src/mod/endpoints/mod_skypopen/mod_skypopen.2008.vcproj similarity index 90% rename from src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj rename to src/mod/endpoints/mod_skypopen/mod_skypopen.2008.vcproj index 58a630b971..585123b4a2 100644 --- a/src/mod/endpoints/mod_skypiax/mod_skypiax.2008.vcproj +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen.2008.vcproj @@ -2,9 +2,9 @@ @@ -149,15 +149,15 @@ diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/mod_skypopen.c b/src/mod/endpoints/mod_skypopen/mod_skypopen.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/mod_skypopen.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen.c diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/Makefile.am b/src/mod/endpoints/mod_skypopen/mod_skypopen/Makefile.am new file mode 100644 index 0000000000..466a09b7b8 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/Makefile.am @@ -0,0 +1,7 @@ +include $(top_srcdir)/build/modmake.rulesam +MODNAME=mod_skypopen +mod_LTLIBRARIES = mod_skypopen.la +mod_skypopen_la_SOURCES = mod_skypopen.c skypopen_protocol.c +mod_skypopen_la_CFLAGS = $(AM_CFLAGS) -DSKYPOPEN_SVN_VERSION=\"`cat $(switch_builddir)/.version`\" -I../../../../libs/spandsp/src -I../../../..//libs/tiff-3.8.2/libtiff +mod_skypopen_la_LIBADD = $(switch_builddir)/libfreeswitch.la +mod_skypopen_la_LDFLAGS = -L../../../../libs/spandsp/src -avoid-version -module -no-undefined -shared -lX11 -lspandsp diff --git a/src/mod/endpoints/mod_skypiax/README b/src/mod/endpoints/mod_skypopen/mod_skypopen/README similarity index 84% rename from src/mod/endpoints/mod_skypiax/README rename to src/mod/endpoints/mod_skypopen/mod_skypopen/README index 70322fa8a7..ca71d53087 100644 --- a/src/mod/endpoints/mod_skypiax/README +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/README @@ -1,4 +1,4 @@ -Skypiax, Skype Endpoint and Trunk +Skypopen, Skype Endpoint and Trunk All documentation on compiling, using, configuring, tricks and tweaks, possible problems at: diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/alsa/alsa-driver-1.0.20-dummy.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/alsa/alsa-driver-1.0.20-dummy.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/alsa/alsa-driver-1.0.20-dummy.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/alsa/alsa-driver-1.0.20-dummy.c diff --git a/src/mod/endpoints/mod_skypiax/alsa/dummy.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/alsa/dummy.c similarity index 98% rename from src/mod/endpoints/mod_skypiax/alsa/dummy.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/alsa/dummy.c index e974f49949..69a2d4fa08 100644 --- a/src/mod/endpoints/mod_skypiax/alsa/dummy.c +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/alsa/dummy.c @@ -155,7 +155,7 @@ static inline void snd_card_dummy_pcm_timer_start(struct snd_dummy_pcm *dpcm) } } if (!found) { - printk("skypiax: start, NOT found?\n"); + printk("skypopen: start, NOT found?\n"); } } @@ -384,7 +384,7 @@ static struct snd_dummy_pcm *new_pcm_stream(struct snd_pcm_substream *substream) spin_unlock_bh(&giovalock); if (!found) { - printk("skypiax giovaindex=%d NOT found????\n", giovaindex); + printk("skypopen giovaindex=%d NOT found????\n", giovaindex); } return dpcm; } @@ -747,7 +747,7 @@ static int __init alsa_card_dummy_init(void) giovatimer.function = snd_card_dummy_pcm_timer_function; giovatimer.expires = 1 + jiffies; add_timer(&giovatimer); - printk("snd-dummy skypiax driver version: 3, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ); + printk("snd-dummy skypopen driver version: 3, %s:%d working on a machine with %dHZ kernel\n", __FILE__, __LINE__, HZ); spin_unlock_bh(&giovalock); } diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/Makefile b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/Makefile similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/Makefile rename to src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/Makefile diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/README b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/README new file mode 100644 index 0000000000..a3d352e0c6 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/README @@ -0,0 +1 @@ +Skypopen for asterisk does not work yet. diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/chan_skypiax.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/chan_skypiax.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/chan_skypiax.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/chan_skypiax.c diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/cyg_no_pthread_kill.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/cyg_no_pthread_kill.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/cyg_no_pthread_kill.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/cyg_no_pthread_kill.c diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/skypiax.conf b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/skypiax.conf similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/skypiax.conf rename to src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/skypiax.conf diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/skypiax.h b/src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/skypiax.h similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/asterisk/skypiax.h rename to src/mod/endpoints/mod_skypopen/mod_skypopen/asterisk/skypiax.h diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/README.skypopen_auth b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/README.skypopen_auth new file mode 100644 index 0000000000..c59122e952 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/README.skypopen_auth @@ -0,0 +1,57 @@ +####################################### +HOW TO USE SKYPOPEN_AUTH +####################################### + +You will use skypopen_auth only at the setup moment, to force the Skype client to ask you to authorize "skypopen" to connect to it. + +Then you copy the .Skype configuration directory of the user that has launched Skype (eg: /home/maruzz/.Skype if you are maruzz) on the home directory of the user that will start Skype on the server (eg: root). + +Compile skypopen_auth: +$ gcc -Wall -ggdb skypopen_auth.c -o skypopen_auth -lX11 + +Then: + +1) on a Linux desktop machine, rmmod all the snd* modules +2) on the desktop machine, modprobe snd-dummy +3) on the desktop machine, logout from your autologin username if any, launch the Skype client and login as the username you'll use on server +4) on the desktop machine, set the desktop client to use the "hw:dummy" audio device, to not update, to not make "events", etc etc... Make and receive a couple of test calls. Please note that you (and the remote party) will hear nothing (you're using the snd-dummy "fake" audio driver), that's ok. +3) on the desktop machine, when satisfied of the Skype client setup, use skypopen_auth (that simulates FS-skypopen connecting to the Skype client). The Skype client will ask you to be authorized to let "skypopen" connect. +4) Give the authorization and check the "not ask me again" option. +5) Close (Quit) the Skype client from the tray icon, so it saves its config. +6) Then, relaunch the Skype client and use skypopen_auth again, just to be sure it now succeed. +7) Close (Quit) the Skype client from the tray icon, so it saves its config. + +*** Do the steps 1-7 for all Skype usernames you will want to use on the server (eg: one Skype username per channel) + +When finished with all the Skype usernames: +Copy or targzip the .Skype directory and all its content on the home directory of the server user that will launch the Skype client(s). + +############################ +first time you use skypopen_auth +############################ +$ ./skypopen_auth +Skype instance found with id #27263062 +RECEIVED==> ERROR 68 +RECEIVED==> OK + +############################ +Give the auth to the Skype client, and tell him not to ask again +Then Ctrl-C to exit from skypopen_auth +############################ + + +Close (Quit) the Skype client from the tray icon, so it saves its config. +Then, relaunch the Skype client + +############################ +you use skypopen_auth again +############################ +$ ./skypopen_auth +Skype instance found with id #27263062 +RECEIVED==> OK +RECEIVED==> PROTOCOL 6 +RECEIVED==> CONNSTATUS ONLINE +RECEIVED==> CURRENTUSERHANDLE gmaruzz3 +RECEIVED==> USERSTATUS INVISIBLE + + diff --git a/src/mod/endpoints/mod_skypiax/configs/client.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/client.c similarity index 79% rename from src/mod/endpoints/mod_skypiax/configs/client.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/configs/client.c index f722c5d71c..87c4c6c422 100644 --- a/src/mod/endpoints/mod_skypiax/configs/client.c +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/client.c @@ -18,7 +18,7 @@ USAGE: client [Xserver instance] Display *disp = NULL; -struct SkypiaxHandles { +struct SkypopenHandles { Window skype_win; Display *disp; Window win; @@ -51,7 +51,7 @@ static int X11_errors_untrap(void) return (xerror != BadValue) && (xerror != BadWindow); } -int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *message_P) +int skypopen_send_message(struct SkypopenHandles *SkypopenHandles, const char *message_P) { Window w_P; @@ -59,9 +59,9 @@ int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *mess Window handle_P; int ok; - w_P = SkypiaxHandles->skype_win; - disp = SkypiaxHandles->disp; - handle_P = SkypiaxHandles->win; + w_P = SkypopenHandles->skype_win; + disp = SkypopenHandles->disp; + handle_P = SkypopenHandles->win; Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); Atom atom2 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE", False); @@ -96,9 +96,9 @@ int skypiax_send_message(struct SkypiaxHandles *SkypiaxHandles, const char *mess return 1; } -int skypiax_present(struct SkypiaxHandles *SkypiaxHandles) +int skypopen_present(struct SkypopenHandles *SkypopenHandles) { - Atom skype_inst = XInternAtom(SkypiaxHandles->disp, "_SKYPE_INSTANCE", True); + Atom skype_inst = XInternAtom(SkypopenHandles->disp, "_SKYPE_INSTANCE", True); Atom type_ret; int format_ret; @@ -109,23 +109,23 @@ int skypiax_present(struct SkypiaxHandles *SkypiaxHandles) X11_errors_trap(); status = - XGetWindowProperty(SkypiaxHandles->disp, DefaultRootWindow(SkypiaxHandles->disp), + XGetWindowProperty(SkypopenHandles->disp, DefaultRootWindow(SkypopenHandles->disp), skype_inst, 0, 1, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop); X11_errors_untrap(); /* sanity check */ if (status != Success || format_ret != 32 || nitems_ret != 1) { - SkypiaxHandles->skype_win = (Window) - 1; + SkypopenHandles->skype_win = (Window) - 1; printf("Skype instance not found on display '%s'\n", dispname); return 0; } - SkypiaxHandles->skype_win = *(const unsigned long *) prop & 0xffffffff; - //printf("Skype instance found on display '%s', with id #%d\n", dispname, (unsigned int) SkypiaxHandles->skype_win); + SkypopenHandles->skype_win = *(const unsigned long *) prop & 0xffffffff; + //printf("Skype instance found on display '%s', with id #%d\n", dispname, (unsigned int) SkypopenHandles->skype_win); return 1; } -void skypiax_clean_disp(void *data) +void skypopen_clean_disp(void *data) { int *dispptr; @@ -200,7 +200,7 @@ void *threadfunc(void *parm) int main(int argc, char *argv[]) { - struct SkypiaxHandles SkypiaxHandles; + struct SkypopenHandles SkypopenHandles; char buf[512]; //Display *disp = NULL; Window root = -1; @@ -231,30 +231,30 @@ int main(int argc, char *argv[]) int xfd; xfd = XConnectionNumber(disp); - SkypiaxHandles.disp = disp; + SkypopenHandles.disp = disp; - if (skypiax_present(&SkypiaxHandles)) { + if (skypopen_present(&SkypopenHandles)) { root = DefaultRootWindow(disp); win = XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, BlackPixel(disp, DefaultScreen(disp)), BlackPixel(disp, DefaultScreen(disp))); - SkypiaxHandles.win = win; + SkypopenHandles.win = win; - snprintf(buf, 512, "NAME skypiax"); + snprintf(buf, 512, "NAME skypopen"); - if (!skypiax_send_message(&SkypiaxHandles, buf)) { - printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n"); + if (!skypopen_send_message(&SkypopenHandles, buf)) { + printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypopen_auth again\n"); return -1; } snprintf(buf, 512, "PROTOCOL 7"); - if (!skypiax_send_message(&SkypiaxHandles, buf)) { - printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n"); + if (!skypopen_send_message(&SkypopenHandles, buf)) { + printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypopen_auth again\n"); return -1; } snprintf(buf, 512, "#ciapalino PING"); - if (!skypiax_send_message(&SkypiaxHandles, buf)) { - printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n"); + if (!skypopen_send_message(&SkypopenHandles, buf)) { + printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypopen_auth again\n"); return -1; } @@ -283,13 +283,13 @@ int main(int argc, char *argv[]) system("/bin/nc -l -p 15557 0/tmp/back2 &"); system("/bin/nc -l -p 15556 0/tmp/back1 &"); } - if (!skypiax_send_message(&SkypiaxHandles, s)) { - printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypiax_auth again\n"); + if (!skypopen_send_message(&SkypopenHandles, s)) { + printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypopen_auth again\n"); return -1; } } } else { - printf("Skype client not found on display '%s'. Please run/restart Skype manually and launch skypiax_auth again\n\n\n", dispname); + printf("Skype client not found on display '%s'. Please run/restart Skype manually and launch skypopen_auth again\n\n\n", dispname); return -1; } return 0; diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/copy b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/copy new file mode 100644 index 0000000000..59400bf1ff --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/copy @@ -0,0 +1,39 @@ +cp -a skypopen101/* skypopen102/ +cp -a skypopen101/* skypopen103/ +cp -a skypopen101/* skypopen104/ +cp -a skypopen101/* skypopen105/ +cp -a skypopen101/* skypopen106/ +cp -a skypopen101/* skypopen107/ +cp -a skypopen101/* skypopen108/ +cp -a skypopen101/* skypopen109/ +cp -a skypopen101/* skypopen110/ +cp -a skypopen101/* skypopen111/ +cp -a skypopen101/* skypopen112/ +cp -a skypopen101/* skypopen113/ +cp -a skypopen101/* skypopen114/ +cp -a skypopen101/* skypopen115/ +cp -a skypopen101/* skypopen116/ +cp -a skypopen101/* skypopen117/ +cp -a skypopen101/* skypopen118/ +cp -a skypopen101/* skypopen119/ +cp -a skypopen101/* skypopen120/ +cp -a skypopen101/* skypopen121/ +cp -a skypopen101/* skypopen122/ +cp -a skypopen101/* skypopen123/ +cp -a skypopen101/* skypopen124/ +cp -a skypopen101/* skypopen125/ +cp -a skypopen101/* skypopen126/ +cp -a skypopen101/* skypopen127/ +cp -a skypopen101/* skypopen128/ +cp -a skypopen101/* skypopen129/ +cp -a skypopen101/* skypopen130/ +cp -a skypopen101/* skypopen131/ +cp -a skypopen101/* skypopen132/ +cp -a skypopen101/* skypopen133/ +cp -a skypopen101/* skypopen134/ +cp -a skypopen101/* skypopen135/ +cp -a skypopen101/* skypopen136/ +cp -a skypopen101/* skypopen137/ +cp -a skypopen101/* skypopen138/ +cp -a skypopen101/* skypopen139/ +cp -a skypopen101/* skypopen140/ diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/create b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/create new file mode 100644 index 0000000000..fd2c9e0229 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/create @@ -0,0 +1,40 @@ +mkdir skypopen101 +mkdir skypopen102 +mkdir skypopen103 +mkdir skypopen104 +mkdir skypopen105 +mkdir skypopen106 +mkdir skypopen107 +mkdir skypopen108 +mkdir skypopen109 +mkdir skypopen110 +mkdir skypopen111 +mkdir skypopen112 +mkdir skypopen113 +mkdir skypopen114 +mkdir skypopen115 +mkdir skypopen116 +mkdir skypopen117 +mkdir skypopen118 +mkdir skypopen119 +mkdir skypopen120 +mkdir skypopen121 +mkdir skypopen122 +mkdir skypopen123 +mkdir skypopen124 +mkdir skypopen125 +mkdir skypopen126 +mkdir skypopen127 +mkdir skypopen128 +mkdir skypopen129 +mkdir skypopen130 +mkdir skypopen131 +mkdir skypopen132 +mkdir skypopen133 +mkdir skypopen134 +mkdir skypopen135 +mkdir skypopen136 +mkdir skypopen137 +mkdir skypopen138 +mkdir skypopen139 +mkdir skypopen140 diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/README b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/README new file mode 100644 index 0000000000..3de4125e12 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/README @@ -0,0 +1,4 @@ +# just execute the file + +sh ./multi.sh + diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh new file mode 100644 index 0000000000..792e330a44 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/multi.sh @@ -0,0 +1,152 @@ +#!/bin/bash +# remember to add here the removing of all the installed snd-* modules, so you're sure only the snd-dummy driver will be around +rmmod snd_hda_intel +rmmod snd-dummy # enable=1,1,1 + +# you need three dummy soundcard for 20 Skype client instances, because each dummy soundcard can handle a max of 8 Skype instances +# the enable= module parameter tells how many cards to start. For each additional card, add a comma and a 1 +# manually configure the first 8 Skype client instances to use the hw:Dummy_0, the next 8 instances to use hw:Dummy_1, etc for all three devices (Play, Capture, Ring) +modprobe snd-dummy +#modprobe snd-aloop enable=1,1,1 +sleep 3 + +#start the fake X server on a given port + /usr/bin/Xvfb :101 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +# start a Skype client instance that will connect to the X server above, and will login to the Skype network using the 'username password' you send to it on stdin. Here passwd5 would be the password and user5 the username +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:101 /usr/bin/skype --dbpath=/root/multi/skypopen101 --pipelogin &" + + +sleep 7 + + + /usr/bin/Xvfb :102 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:102 /usr/bin/skype --dbpath=/root/multi/skypopen102 --pipelogin &" + +sleep 7 + +exit 0 + +################################################################# +# Following X server and Skype client instances are commented out +################################################################# + /usr/bin/Xvfb :103 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:103 /usr/bin/skype --dbpath=/root/multi/skypopen103 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :104 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:104 /usr/bin/skype --dbpath=/root/multi/skypopen104 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :105 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:105 /usr/bin/skype --dbpath=/root/multi/skypopen105 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :106 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:106 /usr/bin/skype --dbpath=/root/multi/skypopen106 --pipelogin &" + + +sleep 7 + /usr/bin/Xvfb :107 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:107 /usr/bin/skype --dbpath=/root/multi/skypopen107 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :108 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:108 /usr/bin/skype --dbpath=/root/multi/skypopen108 --pipelogin &" + +sleep 7 + + + /usr/bin/Xvfb :109 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:109 /usr/bin/skype --dbpath=/root/multi/skypopen109 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :110 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:110 /usr/bin/skype --dbpath=/root/multi/skypopen110 --pipelogin &" + +sleep 7 + + + /usr/bin/Xvfb :111 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:111 /usr/bin/skype --dbpath=/root/multi/skypopen111 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :112 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:112 /usr/bin/skype --dbpath=/root/multi/skypopen112 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :113 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:113 /usr/bin/skype --dbpath=/root/multi/skypopen113 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :114 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:114 /usr/bin/skype --dbpath=/root/multi/skypopen114 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :115 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:115 /usr/bin/skype --dbpath=/root/multi/skypopen115 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :116 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:116 /usr/bin/skype --dbpath=/root/multi/skypopen116 --pipelogin &" + +sleep 7 + + + /usr/bin/Xvfb :117 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:117 /usr/bin/skype --dbpath=/root/multi/skypopen117 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :118 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:118 /usr/bin/skype --dbpath=/root/multi/skypopen118 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :119 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:119 /usr/bin/skype --dbpath=/root/multi/skypopen119 --pipelogin &" + +sleep 7 + /usr/bin/Xvfb :120 -screen 0 800x600x16 -nolisten tcp -ac & +sleep 3 + +su root -c "/bin/echo 'user5 passwd5'| DISPLAY=:120 /usr/bin/skype --dbpath=/root/multi/skypopen120 --pipelogin &" + +sleep 7 + +exit 0 diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml new file mode 100644 index 0000000000..037a26255b --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/multiple-instance-same-skype-username/skypopen.conf.xml @@ -0,0 +1,31 @@ + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/skypopen.conf.xml b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/skypopen.conf.xml new file mode 100644 index 0000000000..f4e1c0ec5a --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/skypopen.conf.xml @@ -0,0 +1,34 @@ + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/skypopen_auth.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/skypopen_auth.c new file mode 100644 index 0000000000..f886834fe0 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/skypopen_auth.c @@ -0,0 +1,219 @@ +//gcc -Wall -ggdb skypopen_auth.c -o skypopen_auth -lX11 +#include +#include +#include +#include +#include + +struct SkypopenHandles { + Window skype_win; + Display *disp; + Window win; + int api_connected; + int fdesc[2]; +}; + +XErrorHandler old_handler = 0; +int xerror = 0; +char *dispname; + +int X11_errors_handler(Display * dpy, XErrorEvent * err) +{ + (void) dpy; + + xerror = err->error_code; + printf("\n\nReceived error code %d from X Server on display '%s'\n\n", xerror, dispname); + return 0; /* ignore the error */ +} + +static void X11_errors_trap(void) +{ + xerror = 0; + old_handler = XSetErrorHandler(X11_errors_handler); +} + +static int X11_errors_untrap(void) +{ + XSetErrorHandler(old_handler); + return (xerror != BadValue) && (xerror != BadWindow); +} + +int skypopen_send_message(struct SkypopenHandles *SkypopenHandles, const char *message_P) +{ + + Window w_P; + Display *disp; + Window handle_P; + int ok; + + w_P = SkypopenHandles->skype_win; + disp = SkypopenHandles->disp; + handle_P = SkypopenHandles->win; + + Atom atom1 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); + Atom atom2 = XInternAtom(disp, "SKYPECONTROLAPI_MESSAGE", False); + unsigned int pos = 0; + unsigned int len = strlen(message_P); + XEvent e; + + memset(&e, 0, sizeof(e)); + e.xclient.type = ClientMessage; + e.xclient.message_type = atom1; /* leading message */ + e.xclient.display = disp; + e.xclient.window = handle_P; + e.xclient.format = 8; + + X11_errors_trap(); + do { + unsigned int i; + for (i = 0; i < 20 && i + pos <= len; ++i) + e.xclient.data.b[i] = message_P[i + pos]; + XSendEvent(disp, w_P, False, 0, &e); + + e.xclient.message_type = atom2; /* following messages */ + pos += i; + } while (pos <= len); + + XSync(disp, False); + ok = X11_errors_untrap(); + + if (!ok) + printf("Sending message failed with status %d\n", xerror); + + return 1; +} + +int skypopen_present(struct SkypopenHandles *SkypopenHandles) +{ + Atom skype_inst = XInternAtom(SkypopenHandles->disp, "_SKYPE_INSTANCE", True); + + Atom type_ret; + int format_ret; + unsigned long nitems_ret; + unsigned long bytes_after_ret; + unsigned char *prop; + int status; + + X11_errors_trap(); + status = + XGetWindowProperty(SkypopenHandles->disp, DefaultRootWindow(SkypopenHandles->disp), + skype_inst, 0, 1, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop); + + X11_errors_untrap(); + /* sanity check */ + if (status != Success || format_ret != 32 || nitems_ret != 1) { + SkypopenHandles->skype_win = (Window) - 1; + printf("Skype instance not found on display '%s'\n", dispname); + return 0; + } + + SkypopenHandles->skype_win = *(const unsigned long *) prop & 0xffffffff; + printf("Skype instance found on display '%s', with id #%d\n", dispname, (unsigned int) SkypopenHandles->skype_win); + return 1; +} + +void skypopen_clean_disp(void *data) +{ + + int *dispptr; + int disp; + + dispptr = data; + disp = *dispptr; + + if (disp) { + close(disp); + } else { + } + usleep(1000); +} + +int main(int argc, char *argv[]) +{ + + struct SkypopenHandles SkypopenHandles; + char buf[512]; + Display *disp = NULL; + Window root = -1; + Window win = -1; + + if (argc == 2) + dispname = argv[1]; + else + dispname = ":0.0"; + + disp = XOpenDisplay(dispname); + if (!disp) { + printf("Cannot open X Display '%s', exiting\n", dispname); + return -1; + } + + int xfd; + xfd = XConnectionNumber(disp); + + SkypopenHandles.disp = disp; + + if (skypopen_present(&SkypopenHandles)) { + root = DefaultRootWindow(disp); + win = XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, BlackPixel(disp, DefaultScreen(disp)), BlackPixel(disp, DefaultScreen(disp))); + + SkypopenHandles.win = win; + + snprintf(buf, 512, "NAME skypopen"); + + if (!skypopen_send_message(&SkypopenHandles, buf)) { + printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypopen_auth again\n"); + return -1; + } + + snprintf(buf, 512, "PROTOCOL 6"); + if (!skypopen_send_message(&SkypopenHandles, buf)) { + printf("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch skypopen_auth again\n"); + return -1; + } + + /* perform an events loop */ + XEvent an_event; + char buf[21]; /* can't be longer */ + char buffer[17000]; + char *b; + int i; + + b = buffer; + + while (1) { + XNextEvent(disp, &an_event); + switch (an_event.type) { + case ClientMessage: + + if (an_event.xclient.format != 8) + break; + + for (i = 0; i < 20 && an_event.xclient.data.b[i] != '\0'; ++i) + buf[i] = an_event.xclient.data.b[i]; + + buf[i] = '\0'; + + strcat(buffer, buf); + + if (i < 20) { /* last fragment */ + unsigned int howmany; + + howmany = strlen(b) + 1; + + printf("RECEIVED==> %s\n", b); + memset(buffer, '\0', 17000); + } + + break; + default: + break; + } + } + } else { + printf("Skype client not found on display '%s'. Please run/restart Skype manually and launch skypopen_auth again\n\n\n", dispname); + return -1; + } + return 0; + +} diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/startskype.bat b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/startskype.bat new file mode 100644 index 0000000000..5624b02af4 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/startskype.bat @@ -0,0 +1,52 @@ +echo off +REM +REM you MUST use the new Skype (4.x) for Windows, older versions (3.x) cannot be started this way +REM +REM you have to adjust PATH to where the Skype executable is +set PATH=%PATH%;C:\Program Files\Skype\Phone\ + +echo %PATH% + +REM start a Skype client instance that will login to the Skype network using the "username password" you give to it. Here xxx would be the password and user1 the username +start Skype.exe /secondary /username:user1 /password:xxx +call wait 7 +start Skype.exe /secondary /username:user2 /password:xxx +call wait 7 +REM +REM Following Skype client instances are commented out +REM +REM start Skype.exe /secondary /username:user3 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user4 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user5 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user6 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user7 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user8 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user9 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user10 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user11 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user12 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user13 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user14 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user15 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user16 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user17 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user18 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user19 /password:xxx +REM call wait 7 +REM start Skype.exe /secondary /username:user20 /password:xxx diff --git a/src/mod/endpoints/mod_skypiax/configs/startskype.sh b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/startskype.sh similarity index 55% rename from src/mod/endpoints/mod_skypiax/configs/startskype.sh rename to src/mod/endpoints/mod_skypopen/mod_skypopen/configs/startskype.sh index 3717714013..8e030ec2f3 100755 --- a/src/mod/endpoints/mod_skypiax/configs/startskype.sh +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/startskype.sh @@ -12,8 +12,8 @@ sleep 3 /usr/bin/Xvfb :101 -ac & sleep 3 -# start a Skype client instance that will connect to the X server above, and will login to the Skype network using the 'username password' you send to it on stdin. Here xxxx would be the password and skypiax1 the username -su root -c "/bin/echo 'skypiax1 xxxx'| DISPLAY=:101 /usr/bin/skype --pipelogin &" +# start a Skype client instance that will connect to the X server above, and will login to the Skype network using the 'username password' you send to it on stdin. Here xxxx would be the password and user1 the username +su root -c "/bin/echo 'user1 xxxx'| DISPLAY=:101 /usr/bin/skype --pipelogin &" sleep 7 @@ -22,7 +22,7 @@ sleep 7 /usr/bin/Xvfb :102 -ac & sleep 3 -su root -c "/bin/echo 'skypiax2 xxxx'| DISPLAY=:102 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user2 xxxx'| DISPLAY=:102 /usr/bin/skype --pipelogin &" sleep 7 @@ -35,109 +35,109 @@ exit 0 /usr/bin/Xvfb :103 -ac & sleep 3 -su root -c "/bin/echo 'skypiax3 xxxx'| DISPLAY=:103 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user3 xxxx'| DISPLAY=:103 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :104 -ac & sleep 3 -su root -c "/bin/echo 'skypiax4 xxxx'| DISPLAY=:104 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user4 xxxx'| DISPLAY=:104 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :105 -ac & sleep 3 -su root -c "/bin/echo 'skypiax5 xxxx'| DISPLAY=:105 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user5 xxxx'| DISPLAY=:105 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :106 -ac & sleep 3 -su root -c "/bin/echo 'skypiax6 xxxx'| DISPLAY=:106 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user6 xxxx'| DISPLAY=:106 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :107 -ac & sleep 3 -su root -c "/bin/echo 'skypiax7 xxxx'| DISPLAY=:107 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user7 xxxx'| DISPLAY=:107 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :108 -ac & sleep 3 -su root -c "/bin/echo 'skypiax8 xxxx'| DISPLAY=:108 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user8 xxxx'| DISPLAY=:108 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :109 -ac & sleep 3 -su root -c "/bin/echo 'skypiax9 xxxx'| DISPLAY=:109 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user9 xxxx'| DISPLAY=:109 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :110 -ac & sleep 3 -su root -c "/bin/echo 'skypiax10 xxxx'| DISPLAY=:110 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user10 xxxx'| DISPLAY=:110 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :111 -ac & sleep 3 -su root -c "/bin/echo 'skypiax11 xxxx'| DISPLAY=:111 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user11 xxxx'| DISPLAY=:111 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :112 -ac & sleep 3 -su root -c "/bin/echo 'skypiax12 xxxx'| DISPLAY=:112 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user12 xxxx'| DISPLAY=:112 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :113 -ac & sleep 3 -su root -c "/bin/echo 'skypiax13 xxxx'| DISPLAY=:113 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user13 xxxx'| DISPLAY=:113 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :114 -ac & sleep 3 -su root -c "/bin/echo 'skypiax14 xxxx'| DISPLAY=:114 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user14 xxxx'| DISPLAY=:114 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :115 -ac & sleep 3 -su root -c "/bin/echo 'skypiax15 xxxx'| DISPLAY=:115 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user15 xxxx'| DISPLAY=:115 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :116 -ac & sleep 3 -su root -c "/bin/echo 'skypiax16 xxxx'| DISPLAY=:116 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user16 xxxx'| DISPLAY=:116 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :117 -ac & sleep 3 -su root -c "/bin/echo 'skypiax17 xxxx'| DISPLAY=:117 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user17 xxxx'| DISPLAY=:117 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :118 -ac & sleep 3 -su root -c "/bin/echo 'skypiax18 xxxx'| DISPLAY=:118 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user18 xxxx'| DISPLAY=:118 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :119 -ac & sleep 3 -su root -c "/bin/echo 'skypiax19 xxxx'| DISPLAY=:119 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user19 xxxx'| DISPLAY=:119 /usr/bin/skype --pipelogin &" sleep 7 /usr/bin/Xvfb :120 -ac & sleep 3 -su root -c "/bin/echo 'skypiax20 xxxx'| DISPLAY=:120 /usr/bin/skype --pipelogin &" +su root -c "/bin/echo 'user20 xxxx'| DISPLAY=:120 /usr/bin/skype --pipelogin &" sleep 7 diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/wait.bat b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/wait.bat similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/wait.bat rename to src/mod/endpoints/mod_skypopen/mod_skypopen/configs/wait.bat diff --git a/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/windows-service/startskype.cmd b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/windows-service/startskype.cmd new file mode 100644 index 0000000000..505a36c4b5 --- /dev/null +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/windows-service/startskype.cmd @@ -0,0 +1,61 @@ +echo off + +REM +REM you MUST use the new Skype (4.x) for Windows, older versions (3.x) cannot be started this way +REM +REM you have to adjust PATH to where the Skype executable is +set PATH=%PATH%;C:\Program Files\Skype\Phone\ + +REM echo %PATH% + +REM start a Skype client instance that will login to the Skype network using the "username password" you give to it. +REM Here xxxx would be the password and user20 the username + +start Skype.exe /secondary /username:user20 /password:xxxx +call C:\wait.cmd 20 + +start Skype.exe /secondary /username:user19 /password:xxxx +call C:\wait.cmd 5 + +REM +REM Following Skype client instances are commented out +REM + +REM start Skype.exe /secondary /username:user18 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user17 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user16 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user15 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user14 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user13 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user12 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user11 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user10 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user9 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user8 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user7 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user6 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user5 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user4 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user3 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user2 /password:xxxx +REM call C:\wait.cmd 5 +REM start Skype.exe /secondary /username:user1 /password:xxxx +call C:\wait.cmd 120 +NET start AICCU2 +pause diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/configs/windows-service/wait.cmd b/src/mod/endpoints/mod_skypopen/mod_skypopen/configs/windows-service/wait.cmd similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/configs/windows-service/wait.cmd rename to src/mod/endpoints/mod_skypopen/mod_skypopen/configs/windows-service/wait.cmd diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/mod_skypopen.2008.vcproj b/src/mod/endpoints/mod_skypopen/mod_skypopen/mod_skypopen.2008.vcproj similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/mod_skypopen.2008.vcproj rename to src/mod/endpoints/mod_skypopen/mod_skypopen/mod_skypopen.2008.vcproj diff --git a/src/mod/endpoints/mod_skypiax/mod_skypiax.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/mod_skypopen.c similarity index 62% rename from src/mod/endpoints/mod_skypiax/mod_skypiax.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/mod_skypopen.c index afa055435a..e7584a1812 100644 --- a/src/mod/endpoints/mod_skypiax/mod_skypiax.c +++ b/src/mod/endpoints/mod_skypopen/mod_skypopen/mod_skypopen.c @@ -21,7 +21,7 @@ * Portions created by the Initial Developer are Copyright (C) * the Initial Developer. All Rights Reserved. * - * This module (mod_skypiax) has been contributed by: + * This module (mod_skypopen) has been contributed by: * * Giovanni Maruzzelli (gmaruzz@gmail.com) * @@ -30,11 +30,11 @@ * * * - * mod_skypiax.c -- Skype compatible Endpoint Module + * mod_skypopen.c -- Skype compatible Endpoint Module * */ -#include "skypiax.h" +#include "skypopen.h" #define MDL_CHAT_PROTO "skype" #ifdef WIN32 @@ -82,22 +82,22 @@ int gettimeofday(struct timeval *tv, struct sk_timezone *tz) /***************/ #endif /* WIN32 */ -SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load); -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown); -SWITCH_MODULE_DEFINITION(mod_skypiax, mod_skypiax_load, mod_skypiax_shutdown, NULL); +SWITCH_MODULE_LOAD_FUNCTION(mod_skypopen_load); +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown); +SWITCH_MODULE_DEFINITION(mod_skypopen, mod_skypopen_load, mod_skypopen_shutdown, NULL); SWITCH_STANDARD_API(sk_function); /* BEGIN: Changes here */ #define SK_SYNTAX "list [full] || console || skype_API_msg || remove < skypeusername | #interface_name | #interface_id > || reload" /* END: Changes heres */ -SWITCH_STANDARD_API(skypiax_function); -#define SKYPIAX_SYNTAX "interface_name skype_API_msg" +SWITCH_STANDARD_API(skypopen_function); +#define SKYPOPEN_SYNTAX "interface_name skype_API_msg" -SWITCH_STANDARD_API(skypiax_chat_function); -#define SKYPIAX_CHAT_SYNTAX "interface_name remote_skypename TEXT" +SWITCH_STANDARD_API(skypopen_chat_function); +#define SKYPOPEN_CHAT_SYNTAX "interface_name remote_skypename TEXT" #define FULL_RELOAD 0 #define SOFT_RELOAD 1 -char *interface_status[] = { /* should match SKYPIAX_STATE_xxx in skypiax.h */ +char *interface_status[] = { /* should match SKYPOPEN_STATE_xxx in skypopen.h */ "IDLE", "DOWN", "RING", @@ -111,7 +111,7 @@ char *interface_status[] = { /* should match SKYPIAX_STATE_xxx in skypiax.h */ "HANG_RQ", "PREANSW" }; -char *skype_callflow[] = { /* should match CALLFLOW_XXX in skypiax.h */ +char *skype_callflow[] = { /* should match CALLFLOW_XXX in skypopen.h */ "CALL_IDLE", "CALL_DOWN", "INCOMING_RNG", @@ -154,14 +154,14 @@ static struct { int calls; int real_interfaces; int next_interface; - private_t SKYPIAX_INTERFACES[SKYPIAX_MAX_INTERFACES]; + private_t SKYPOPEN_INTERFACES[SKYPOPEN_MAX_INTERFACES]; switch_mutex_t *mutex; private_t *sk_console; int start_port; } globals; -switch_endpoint_interface_t *skypiax_endpoint_interface; -switch_memory_pool_t *skypiax_module_pool = NULL; +switch_endpoint_interface_t *skypopen_endpoint_interface; +switch_memory_pool_t *skypopen_module_pool = NULL; int running = 0; SWITCH_DECLARE_GLOBAL_STRING_FUNC(set_global_context, globals.context); @@ -190,23 +190,23 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi static switch_status_t channel_read_frame(switch_core_session_t *session, switch_frame_t **frame, switch_io_flag_t flags, int stream_id); static switch_status_t channel_write_frame(switch_core_session_t *session, switch_frame_t *frame, switch_io_flag_t flags, int stream_id); static switch_status_t channel_kill_channel(switch_core_session_t *session, int sig); -static switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *session); +static switch_status_t skypopen_tech_init(private_t * tech_pvt, switch_core_session_t *session); -static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int codec_ms) +static switch_status_t skypopen_codec(private_t * tech_pvt, int sample_rate, int codec_ms) { switch_core_session_t *session = NULL; if (switch_core_codec_init (&tech_pvt->read_codec, "L16", NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { - ERRORA("Can't load codec?\n", SKYPIAX_P_LOG); + ERRORA("Can't load codec?\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } if (switch_core_codec_init (&tech_pvt->write_codec, "L16", NULL, sample_rate, codec_ms, 1, SWITCH_CODEC_FLAG_ENCODE | SWITCH_CODEC_FLAG_DECODE, NULL, NULL) != SWITCH_STATUS_SUCCESS) { - ERRORA("Can't load codec?\n", SKYPIAX_P_LOG); + ERRORA("Can't load codec?\n", SKYPOPEN_P_LOG); switch_core_codec_destroy(&tech_pvt->read_codec); return SWITCH_STATUS_FALSE; } @@ -221,7 +221,7 @@ static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int switch_core_session_set_write_codec(session, &tech_pvt->write_codec); switch_core_session_rwunlock(session); } else { - ERRORA("no session\n", SKYPIAX_P_LOG); + ERRORA("no session\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } @@ -229,7 +229,7 @@ static switch_status_t skypiax_codec(private_t * tech_pvt, int sample_rate, int } -switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *session) +switch_status_t skypopen_tech_init(private_t * tech_pvt, switch_core_session_t *session) { switch_assert(tech_pvt != NULL); @@ -241,11 +241,11 @@ switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *s switch_core_session_set_private(session, tech_pvt); switch_copy_string(tech_pvt->session_uuid_str, switch_core_session_get_uuid(session), sizeof(tech_pvt->session_uuid_str)); if (!strlen(tech_pvt->session_uuid_str)) { - ERRORA("no tech_pvt->session_uuid_str\n", SKYPIAX_P_LOG); + ERRORA("no tech_pvt->session_uuid_str\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } - if (skypiax_codec(tech_pvt, SAMPLERATE_SKYPIAX, 20) != SWITCH_STATUS_SUCCESS) { - ERRORA("skypiax_codec FAILED\n", SKYPIAX_P_LOG); + if (skypopen_codec(tech_pvt, SAMPLERATE_SKYPOPEN, 20) != SWITCH_STATUS_SUCCESS) { + ERRORA("skypopen_codec FAILED\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } @@ -253,7 +253,7 @@ switch_status_t skypiax_tech_init(private_t * tech_pvt, switch_core_session_t *s dtmf_rx_parms(&tech_pvt->dtmf_state, 0, 10, 10, -99); - DEBUGA_SKYPE("skypiax_tech_init SUCCESS\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("skypopen_tech_init SUCCESS\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_SUCCESS; } @@ -269,13 +269,13 @@ static switch_status_t interface_exists(char *the_interface) /* take a number as interface id */ if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { - if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) { + if (strlen(globals.SKYPOPEN_INTERFACES[interface_id].name)) { return SWITCH_STATUS_SUCCESS; } } else { /* interface name */ - for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) { + for (interface_id = 0; interface_id < SKYPOPEN_MAX_INTERFACES; interface_id++) { + if (strcmp(globals.SKYPOPEN_INTERFACES[interface_id].name, the_interface) == 0) { return SWITCH_STATUS_SUCCESS; break; } @@ -284,9 +284,9 @@ static switch_status_t interface_exists(char *the_interface) } else { /* look by skype_user */ - for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].skype_user)) { - if (strcmp(globals.SKYPIAX_INTERFACES[i].skype_user, the_interface) == 0) { + for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].skype_user)) { + if (strcmp(globals.SKYPOPEN_INTERFACES[i].skype_user, the_interface) == 0) { return SWITCH_STATUS_SUCCESS; } } @@ -311,66 +311,66 @@ static switch_status_t remove_interface(char *the_interface) if (interface_id > 0 || (interface_id == 0 && strcmp(the_interface, "0") == 0)) { /* take a number as interface id */ - tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id]; + tech_pvt = &globals.SKYPOPEN_INTERFACES[interface_id]; } else { - for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].name, the_interface) == 0) { - tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id]; + for (interface_id = 0; interface_id < SKYPOPEN_MAX_INTERFACES; interface_id++) { + if (strcmp(globals.SKYPOPEN_INTERFACES[interface_id].name, the_interface) == 0) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[interface_id]; break; } } } } else { /* remove by skype_user */ - for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) { - if (strcmp(globals.SKYPIAX_INTERFACES[interface_id].skype_user, the_interface) == 0) { - tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id]; + for (interface_id = 0; interface_id < SKYPOPEN_MAX_INTERFACES; interface_id++) { + if (strcmp(globals.SKYPOPEN_INTERFACES[interface_id].skype_user, the_interface) == 0) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[interface_id]; break; } } } if (!tech_pvt) { - DEBUGA_SKYPE("interface '%s' does not exist\n", SKYPIAX_P_LOG, the_interface); + DEBUGA_SKYPE("interface '%s' does not exist\n", SKYPOPEN_P_LOG, the_interface); goto end; } - if (strlen(globals.SKYPIAX_INTERFACES[interface_id].session_uuid_str)) { - DEBUGA_SKYPE("interface '%s' is busy\n", SKYPIAX_P_LOG, the_interface); + if (strlen(globals.SKYPOPEN_INTERFACES[interface_id].session_uuid_str)) { + DEBUGA_SKYPE("interface '%s' is busy\n", SKYPOPEN_P_LOG, the_interface); goto end; } - globals.SKYPIAX_INTERFACES[interface_id].running = 0; + globals.SKYPOPEN_INTERFACES[interface_id].running = 0; - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) { + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) { #ifdef WIN32 - skypiax_signaling_write(tech_pvt, "DIE"); + skypopen_signaling_write(tech_pvt, "DIE"); switch_sleep(10000); - switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die + switch_file_write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die #else /* WIN32 */ - howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", howmany); + howmany = write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", howmany); #endif /* WIN32 */ } - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) { + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread) { #ifdef WIN32 - if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypiax_api_thread_func die - DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", SKYPIAX_P_LOG, GetLastError()); - globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread = NULL; + if (SendMessage(tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypopen_api_thread_func die + DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", SKYPOPEN_P_LOG, GetLastError()); + globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread = NULL; } #else - if (tech_pvt->running && tech_pvt->SkypiaxHandles.disp) { + if (tech_pvt->running && tech_pvt->SkypopenHandles.disp) { XEvent e; - Atom atom1 = XInternAtom(tech_pvt->SkypiaxHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); + Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; e.xclient.message_type = atom1; /* leading message */ - e.xclient.display = tech_pvt->SkypiaxHandles.disp; - e.xclient.window = tech_pvt->SkypiaxHandles.skype_win; + e.xclient.display = tech_pvt->SkypopenHandles.disp; + e.xclient.window = tech_pvt->SkypopenHandles.skype_win; e.xclient.format = 8; - XSendEvent(tech_pvt->SkypiaxHandles.disp, tech_pvt->SkypiaxHandles.win, False, 0, &e); - XSync(tech_pvt->SkypiaxHandles.disp, False); + XSendEvent(tech_pvt->SkypopenHandles.disp, tech_pvt->SkypopenHandles.win, False, 0, &e); + XSync(tech_pvt->SkypopenHandles.disp, False); } #endif } @@ -380,27 +380,27 @@ static switch_status_t remove_interface(char *the_interface) switch_yield(50000); } - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) { - switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread); + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) { + switch_thread_join(&status, globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread); } - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) { - switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread); + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread) { + switch_thread_join(&status, globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread); } switch_mutex_lock(globals.mutex); - if (globals.sk_console == &globals.SKYPIAX_INTERFACES[interface_id]) { - DEBUGA_SKYPE("interface '%s' no more console\n", SKYPIAX_P_LOG, the_interface); + if (globals.sk_console == &globals.SKYPOPEN_INTERFACES[interface_id]) { + DEBUGA_SKYPE("interface '%s' no more console\n", SKYPOPEN_P_LOG, the_interface); globals.sk_console = NULL; } else { - DEBUGA_SKYPE("interface '%s' STILL console\n", SKYPIAX_P_LOG, the_interface); + DEBUGA_SKYPE("interface '%s' STILL console\n", SKYPOPEN_P_LOG, the_interface); } - memset(&globals.SKYPIAX_INTERFACES[interface_id], '\0', sizeof(private_t)); + memset(&globals.SKYPOPEN_INTERFACES[interface_id], '\0', sizeof(private_t)); globals.real_interfaces--; switch_mutex_unlock(globals.mutex); - DEBUGA_SKYPE("interface '%s' deleted successfully\n", SKYPIAX_P_LOG, the_interface); - globals.SKYPIAX_INTERFACES[interface_id].running = 1; + DEBUGA_SKYPE("interface '%s' deleted successfully\n", SKYPOPEN_P_LOG, the_interface); + globals.SKYPOPEN_INTERFACES[interface_id].running = 1; end: return SWITCH_STATUS_SUCCESS; } @@ -433,7 +433,7 @@ static switch_status_t channel_on_init(switch_core_session_t *session) globals.calls++; switch_mutex_unlock(globals.mutex); - DEBUGA_SKYPE("%s CHANNEL INIT %s\n", SKYPIAX_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); + DEBUGA_SKYPE("%s CHANNEL INIT %s\n", SKYPOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); return SWITCH_STATUS_SUCCESS; } @@ -446,7 +446,7 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session) if (tech_pvt) { - DEBUGA_SKYPE("%s CHANNEL DESTROY %s\n", SKYPIAX_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); + DEBUGA_SKYPE("%s CHANNEL DESTROY %s\n", SKYPOPEN_P_LOG, tech_pvt->name, switch_core_session_get_uuid(session)); if (switch_core_codec_ready(&tech_pvt->read_codec)) { switch_core_codec_destroy(&tech_pvt->read_codec); @@ -472,13 +472,13 @@ static switch_status_t channel_on_destroy(switch_core_session_t *session) } *tech_pvt->session_uuid_str = '\0'; - tech_pvt->interface_state = SKYPIAX_STATE_IDLE; + tech_pvt->interface_state = SKYPOPEN_STATE_IDLE; if (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED) { tech_pvt->skype_callflow = CALLFLOW_CALL_IDLE; } switch_core_session_set_private(session, NULL); } else { - DEBUGA_SKYPE("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(session)); + DEBUGA_SKYPE("!!!!!!NO tech_pvt!!!! CHANNEL DESTROY %s\n", SKYPOPEN_P_LOG, switch_core_session_get_uuid(session)); } return SWITCH_STATUS_SUCCESS; @@ -509,12 +509,12 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) switch_clear_flag(tech_pvt, TFLAG_IO); switch_clear_flag(tech_pvt, TFLAG_VOICE); - tech_pvt->interface_state = SKYPIAX_STATE_HANGUP_REQUESTED; + tech_pvt->interface_state = SKYPOPEN_STATE_HANGUP_REQUESTED; if (strlen(tech_pvt->skype_call_id)) { - DEBUGA_SKYPE("hanging up skype call: %s\n", SKYPIAX_P_LOG, tech_pvt->skype_call_id); + DEBUGA_SKYPE("hanging up skype call: %s\n", SKYPOPEN_P_LOG, tech_pvt->skype_call_id); sprintf(msg_to_skype, "ALTER CALL %s HANGUP", tech_pvt->skype_call_id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } if (tech_pvt->tcp_cli_thread) { @@ -523,14 +523,14 @@ static switch_status_t channel_on_hangup(switch_core_session_t *session) if (tech_pvt->tcp_srv_thread) { switch_thread_join(&status, tech_pvt->tcp_srv_thread); } - DEBUGA_SKYPE("%s CHANNEL HANGUP\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL HANGUP\n", SKYPOPEN_P_LOG, tech_pvt->name); switch_mutex_lock(globals.mutex); globals.calls--; if (globals.calls < 0) { globals.calls = 0; } - tech_pvt->interface_state = SKYPIAX_STATE_IDLE; + tech_pvt->interface_state = SKYPOPEN_STATE_IDLE; if (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED) { tech_pvt->skype_callflow = CALLFLOW_CALL_IDLE; } @@ -550,7 +550,7 @@ static switch_status_t channel_on_routing(switch_core_session_t *session) tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); - DEBUGA_SKYPE("%s CHANNEL ROUTING\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL ROUTING\n", SKYPOPEN_P_LOG, tech_pvt->name); return SWITCH_STATUS_SUCCESS; } @@ -567,7 +567,7 @@ static switch_status_t channel_on_execute(switch_core_session_t *session) tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); - DEBUGA_SKYPE("%s CHANNEL EXECUTE\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL EXECUTE\n", SKYPOPEN_P_LOG, tech_pvt->name); return SWITCH_STATUS_SUCCESS; } @@ -583,19 +583,19 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); - DEBUGA_SKYPE("%s CHANNEL KILL_CHANNEL\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL KILL_CHANNEL\n", SKYPOPEN_P_LOG, tech_pvt->name); switch (sig) { case SWITCH_SIG_KILL: switch_mutex_lock(tech_pvt->flag_mutex); - DEBUGA_SKYPE("%s CHANNEL got SWITCH_SIG_KILL\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + DEBUGA_SKYPE("%s CHANNEL got SWITCH_SIG_KILL\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); if (tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD) { - DEBUGA_SKYPE("FYI %s CHANNEL in CALLFLOW_STATUS_REMOTEHOLD got SWITCH_SIG_KILL\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + DEBUGA_SKYPE("FYI %s CHANNEL in CALLFLOW_STATUS_REMOTEHOLD got SWITCH_SIG_KILL\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); } if (switch_channel_get_state(channel) == CS_NEW) { - ERRORA("FYI %s CHANNEL in CS_NEW state got SWITCH_SIG_KILL\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + ERRORA("FYI %s CHANNEL in CS_NEW state got SWITCH_SIG_KILL\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); } if (switch_channel_get_state(channel) != CS_NEW && switch_channel_get_state(channel) < CS_EXECUTE) { - ERRORA("FYI %s CHANNEL in %d state got SWITCH_SIG_KILL\n", SKYPIAX_P_LOG, switch_channel_get_name(channel), switch_channel_get_state(channel)); + ERRORA("FYI %s CHANNEL in %d state got SWITCH_SIG_KILL\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel), switch_channel_get_state(channel)); } switch_clear_flag(tech_pvt, TFLAG_IO); switch_clear_flag(tech_pvt, TFLAG_VOICE); @@ -603,7 +603,7 @@ static switch_status_t channel_kill_channel(switch_core_session_t *session, int switch_mutex_unlock(tech_pvt->flag_mutex); break; case SWITCH_SIG_BREAK: - DEBUGA_SKYPE("%s CHANNEL got SWITCH_SIG_BREAK\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + DEBUGA_SKYPE("%s CHANNEL got SWITCH_SIG_BREAK\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); switch_mutex_lock(tech_pvt->flag_mutex); switch_set_flag(tech_pvt, TFLAG_BREAK); switch_mutex_unlock(tech_pvt->flag_mutex); @@ -620,7 +620,7 @@ static switch_status_t channel_on_consume_media(switch_core_session_t *session) tech_pvt = switch_core_session_get_private(session); - DEBUGA_SKYPE("%s CHANNEL CONSUME_MEDIA\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL CONSUME_MEDIA\n", SKYPOPEN_P_LOG, tech_pvt->name); return SWITCH_STATUS_SUCCESS; } @@ -629,7 +629,7 @@ static switch_status_t channel_on_exchange_media(switch_core_session_t *session) { private_t *tech_pvt = NULL; tech_pvt = switch_core_session_get_private(session); - DEBUGA_SKYPE("%s CHANNEL EXCHANGE_MEDIA\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL EXCHANGE_MEDIA\n", SKYPOPEN_P_LOG, tech_pvt->name); return SWITCH_STATUS_SUCCESS; } @@ -637,7 +637,7 @@ static switch_status_t channel_on_soft_execute(switch_core_session_t *session) { private_t *tech_pvt = NULL; tech_pvt = switch_core_session_get_private(session); - DEBUGA_SKYPE("%s CHANNEL SOFT_EXECUTE\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("%s CHANNEL SOFT_EXECUTE\n", SKYPOPEN_P_LOG, tech_pvt->name); return SWITCH_STATUS_SUCCESS; } @@ -646,10 +646,10 @@ static switch_status_t channel_send_dtmf(switch_core_session_t *session, const s private_t *tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); - DEBUGA_SKYPE("%s CHANNEL SEND_DTMF\n", SKYPIAX_P_LOG, tech_pvt->name); - DEBUGA_SKYPE("DTMF: %c\n", SKYPIAX_P_LOG, dtmf->digit); + DEBUGA_SKYPE("%s CHANNEL SEND_DTMF\n", SKYPOPEN_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("DTMF: %c\n", SKYPOPEN_P_LOG, dtmf->digit); - skypiax_senddigit(tech_pvt, dtmf->digit); + skypopen_senddigit(tech_pvt, dtmf->digit); return SWITCH_STATUS_SUCCESS; } @@ -675,14 +675,14 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch switch_assert(tech_pvt != NULL); if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { - ERRORA("channel not ready \n", SKYPIAX_P_LOG); + ERRORA("channel not ready \n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } if (!tech_pvt->read_buffer) { int32_t max_len = 640 * 10; - switch_buffer_create(skypiax_module_pool, &tech_pvt->read_buffer, max_len); + switch_buffer_create(skypopen_module_pool, &tech_pvt->read_buffer, max_len); switch_assert(tech_pvt->read_buffer); switch_buffer_zero(tech_pvt->read_buffer); tech_pvt->begin_to_read = 1; @@ -699,10 +699,10 @@ static switch_status_t channel_read_frame(switch_core_session_t *session, switch read: - if (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN + if (tech_pvt && tech_pvt->interface_state != SKYPOPEN_STATE_DOWN && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA - || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { + || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) { switch_mutex_lock(tech_pvt->mutex_audio_srv); if (switch_buffer_inuse(tech_pvt->read_buffer)) { bytes_read = switch_buffer_read(tech_pvt->read_buffer, tech_pvt->read_frame.data, 640); @@ -716,7 +716,7 @@ read: try++; if(try < 5) goto read; - DEBUGA_SKYPE("skypiax_audio_read Silence\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("skypopen_audio_read Silence\n", SKYPOPEN_P_LOG); memset(tech_pvt->read_frame.data, 255, SAMPLES_PER_FRAME * sizeof(short)); tech_pvt->read_frame.datalen = 640; @@ -730,19 +730,19 @@ read: while (switch_test_flag(tech_pvt, TFLAG_IO)) { if (switch_test_flag(tech_pvt, TFLAG_BREAK)) { switch_clear_flag(tech_pvt, TFLAG_BREAK); - DEBUGA_SKYPE("CHANNEL READ FRAME goto CNG\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("CHANNEL READ FRAME goto CNG\n", SKYPOPEN_P_LOG); goto cng; } if (!switch_test_flag(tech_pvt, TFLAG_IO)) { - DEBUGA_SKYPE("CHANNEL READ FRAME not IO\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("CHANNEL READ FRAME not IO\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } if (switch_test_flag(tech_pvt, TFLAG_IO) && switch_test_flag(tech_pvt, TFLAG_VOICE)) { switch_clear_flag(tech_pvt, TFLAG_VOICE); if (!tech_pvt->read_frame.datalen) { - DEBUGA_SKYPE("CHANNEL READ CONTINUE\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("CHANNEL READ CONTINUE\n", SKYPOPEN_P_LOG); continue; } *frame = &tech_pvt->read_frame; @@ -777,7 +777,7 @@ read: switch_channel_queue_dtmf(channel, &dtmf); p++; } - NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPIAX_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, + NOTICA("DTMF DETECTED: [%s] new_dtmf_timestamp: %u, delta_t: %u\n", SKYPOPEN_P_LOG, digit_str, (unsigned int) new_dtmf_timestamp, (unsigned int) (new_dtmf_timestamp - tech_pvt->old_dtmf_timestamp)); tech_pvt->old_dtmf_timestamp = new_dtmf_timestamp; } @@ -790,11 +790,11 @@ read: #endif return SWITCH_STATUS_SUCCESS; } - DEBUGA_SKYPE("CHANNEL READ no TFLAG_IO\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("CHANNEL READ no TFLAG_IO\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } - DEBUGA_SKYPE("CHANNEL READ FALSE\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("CHANNEL READ FALSE\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; cng: @@ -820,7 +820,7 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc switch_assert(tech_pvt != NULL); if (!switch_channel_ready(channel) || !switch_test_flag(tech_pvt, TFLAG_IO)) { - ERRORA("channel not ready \n", SKYPIAX_P_LOG); + ERRORA("channel not ready \n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } #if SWITCH_BYTE_ORDER == __BIG_ENDIAN @@ -831,13 +831,13 @@ static switch_status_t channel_write_frame(switch_core_session_t *session, switc if (!tech_pvt->write_buffer) { int32_t max_len = 640 * 3; - switch_buffer_create(skypiax_module_pool, &tech_pvt->write_buffer, max_len); + switch_buffer_create(skypopen_module_pool, &tech_pvt->write_buffer, max_len); switch_assert(tech_pvt->write_buffer); } switch_mutex_lock(tech_pvt->mutex_audio_cli); if (switch_buffer_freespace(tech_pvt->write_buffer) < frame->datalen) { - DEBUGA_SKYPE("NO SPACE WRITE: %d\n", SKYPIAX_P_LOG, frame->datalen); + DEBUGA_SKYPE("NO SPACE WRITE: %d\n", SKYPOPEN_P_LOG, frame->datalen); //switch_buffer_toss(tech_pvt->write_buffer, frame->datalen); switch_buffer_zero(tech_pvt->write_buffer); } @@ -860,7 +860,7 @@ static switch_status_t channel_answer_channel(switch_core_session_t *session) tech_pvt = switch_core_session_get_private(session); switch_assert(tech_pvt != NULL); - DEBUGA_SKYPE("ANSWERED! \n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("ANSWERED! \n", SKYPOPEN_P_LOG); return SWITCH_STATUS_SUCCESS; } @@ -880,7 +880,7 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s switch (msg->message_id) { case SWITCH_MESSAGE_INDICATE_ANSWER: { - DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_ANSWER\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_ANSWER\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); channel_answer_channel(session); @@ -901,13 +901,13 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s } switch_mutex_unlock(tech_pvt->mutex_audio_cli); } - DEBUGA_SKYPE("Synching audio\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Synching audio\n", SKYPOPEN_P_LOG); } break; case SWITCH_MESSAGE_INDICATE_AUDIO_SYNC: - DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_AUDIO_SYNC\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); if(tech_pvt->read_buffer){ switch_mutex_lock(tech_pvt->mutex_audio_srv); @@ -926,10 +926,10 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s } switch_mutex_unlock(tech_pvt->mutex_audio_cli); } - DEBUGA_SKYPE("Synching audio\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Synching audio\n", SKYPOPEN_P_LOG); break; case SWITCH_MESSAGE_INDICATE_BRIDGE: - DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_BRIDGE\n", SKYPIAX_P_LOG, switch_channel_get_name(channel)); + DEBUGA_SKYPE("%s CHANNEL got SWITCH_MESSAGE_INDICATE_BRIDGE\n", SKYPOPEN_P_LOG, switch_channel_get_name(channel)); if(tech_pvt->read_buffer){ switch_mutex_lock(tech_pvt->mutex_audio_srv); @@ -948,13 +948,13 @@ static switch_status_t channel_receive_message(switch_core_session_t *session, s } switch_mutex_unlock(tech_pvt->mutex_audio_cli); } - DEBUGA_SKYPE("Synching audio\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Synching audio\n", SKYPOPEN_P_LOG); break; default: { - DEBUGA_SKYPE("MSG_ID=%d\n", SKYPIAX_P_LOG, msg->message_id); + DEBUGA_SKYPE("MSG_ID=%d\n", SKYPOPEN_P_LOG, msg->message_id); } break; } @@ -972,12 +972,12 @@ static switch_status_t channel_receive_event(switch_core_session_t *session, swi body = ""; } - WARNINGA("event: |||%s|||\n", SKYPIAX_P_LOG, body); + WARNINGA("event: |||%s|||\n", SKYPOPEN_P_LOG, body); return SWITCH_STATUS_SUCCESS; } -switch_state_handler_table_t skypiax_state_handlers = { +switch_state_handler_table_t skypopen_state_handlers = { /*.on_init */ channel_on_init, /*.on_routing */ channel_on_routing, /*.on_execute */ channel_on_execute, @@ -992,7 +992,7 @@ switch_state_handler_table_t skypiax_state_handlers = { /*.on_destroy */ channel_on_destroy }; -switch_io_routines_t skypiax_io_routines = { +switch_io_routines_t skypopen_io_routines = { /*.outgoing_channel */ channel_outgoing_channel, /*.read_frame */ channel_read_frame, /*.write_frame */ channel_write_frame, @@ -1009,14 +1009,14 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi switch_call_cause_t *cancel_cause) { private_t *tech_pvt = NULL; - if ((*new_session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) { + if ((*new_session = switch_core_session_request(skypopen_endpoint_interface, SWITCH_CALL_DIRECTION_OUTBOUND, pool)) != 0) { switch_channel_t *channel = NULL; switch_caller_profile_t *caller_profile; char *rdest; int found = 0; char interface_name[256]; - DEBUGA_SKYPE("1 SESSION_REQUEST %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(*new_session)); + DEBUGA_SKYPE("1 SESSION_REQUEST %s\n", SKYPOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); switch_core_session_add_stream(*new_session, NULL); @@ -1031,28 +1031,28 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi switch_mutex_lock(globals.mutex); if (strncmp("ANY", interface_name, strlen(interface_name)) == 0 || strncmp("RR", interface_name, strlen(interface_name)) == 0) { /* Find the first idle interface using Round Robin */ - DEBUGA_SKYPE("Finding one available skype interface RR\n", SKYPIAX_P_LOG); - tech_pvt = find_available_skypiax_interface_rr(NULL); + DEBUGA_SKYPE("Finding one available skype interface RR\n", SKYPOPEN_P_LOG); + tech_pvt = find_available_skypopen_interface_rr(NULL); if (tech_pvt) found = 1; } - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.SKYPIAX_INTERFACES[i].name) - && (strncmp(globals.SKYPIAX_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) { - if (strlen(globals.SKYPIAX_INTERFACES[i].session_uuid_str)) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name) + && (strncmp(globals.SKYPOPEN_INTERFACES[i].name, interface_name, strlen(interface_name)) == 0)) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].session_uuid_str)) { DEBUGA_SKYPE - ("globals.SKYPIAX_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n", - SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name, globals.SKYPIAX_INTERFACES[i].session_uuid_str); - DEBUGA_SKYPE("1 SESSION_DESTROY %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(*new_session)); + ("globals.SKYPOPEN_INTERFACES[%d].name=|||%s||| session_uuid_str=|||%s||| is BUSY\n", + SKYPOPEN_P_LOG, i, globals.SKYPOPEN_INTERFACES[i].name, globals.SKYPOPEN_INTERFACES[i].session_uuid_str); + DEBUGA_SKYPE("1 SESSION_DESTROY %s\n", SKYPOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); switch_core_session_destroy(new_session); switch_mutex_unlock(globals.mutex); return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; } - DEBUGA_SKYPE("globals.SKYPIAX_INTERFACES[%d].name=|||%s|||?\n", SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name); - tech_pvt = &globals.SKYPIAX_INTERFACES[i]; + DEBUGA_SKYPE("globals.SKYPOPEN_INTERFACES[%d].name=|||%s|||?\n", SKYPOPEN_P_LOG, i, globals.SKYPOPEN_INTERFACES[i].name); + tech_pvt = &globals.SKYPOPEN_INTERFACES[i]; found = 1; break; } @@ -1060,14 +1060,14 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi } } else { - ERRORA("Doh! no destination number?\n", SKYPIAX_P_LOG); + ERRORA("Doh! no destination number?\n", SKYPOPEN_P_LOG); switch_core_session_destroy(new_session); return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } if (!found) { - DEBUGA_SKYPE("Doh! no available interface for |||%s|||?\n", SKYPIAX_P_LOG, interface_name); - DEBUGA_SKYPE("2 SESSION_DESTROY %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(*new_session)); + DEBUGA_SKYPE("Doh! no available interface for |||%s|||?\n", SKYPOPEN_P_LOG, interface_name); + DEBUGA_SKYPE("2 SESSION_DESTROY %s\n", SKYPOPEN_P_LOG, switch_core_session_get_uuid(*new_session)); switch_core_session_destroy(new_session); switch_mutex_unlock(globals.mutex); return SWITCH_CAUSE_NORMAL_CIRCUIT_CONGESTION; @@ -1075,14 +1075,14 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi channel = switch_core_session_get_channel(*new_session); if (!channel) { - ERRORA("Doh! no channel?\n", SKYPIAX_P_LOG); + ERRORA("Doh! no channel?\n", SKYPOPEN_P_LOG); switch_core_session_destroy(new_session); switch_mutex_unlock(globals.mutex); return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } switch_channel_set_variable(channel, "waste", "false"); - if (skypiax_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG); + if (skypopen_tech_init(tech_pvt, *new_session) != SWITCH_STATUS_SUCCESS) { + ERRORA("Doh! no tech_init?\n", SKYPOPEN_P_LOG); switch_core_session_destroy(new_session); switch_mutex_unlock(globals.mutex); return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; @@ -1093,11 +1093,11 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi char name[128]; if (strncmp("ANY", outbound_profile->destination_number, 3) == 0) { - snprintf(name, sizeof(name), "skypiax/ANY/%s%s", tech_pvt->name, outbound_profile->destination_number + 3); + snprintf(name, sizeof(name), "skypopen/ANY/%s%s", tech_pvt->name, outbound_profile->destination_number + 3); } else if (strncmp("RR", outbound_profile->destination_number, 2) == 0) { - snprintf(name, sizeof(name), "skypiax/RR/%s%s", tech_pvt->name, outbound_profile->destination_number + 2); + snprintf(name, sizeof(name), "skypopen/RR/%s%s", tech_pvt->name, outbound_profile->destination_number + 2); } else { - snprintf(name, sizeof(name), "skypiax/%s", outbound_profile->destination_number); + snprintf(name, sizeof(name), "skypopen/%s", outbound_profile->destination_number); } switch_channel_set_name(channel, name); @@ -1105,7 +1105,7 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi switch_channel_set_caller_profile(channel, caller_profile); tech_pvt->caller_profile = caller_profile; } else { - ERRORA("Doh! no caller profile\n", SKYPIAX_P_LOG); + ERRORA("Doh! no caller profile\n", SKYPOPEN_P_LOG); switch_core_session_destroy(new_session); switch_mutex_unlock(globals.mutex); return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; @@ -1123,20 +1123,20 @@ static switch_call_cause_t channel_outgoing_channel(switch_core_session_t *sessi switch_channel_set_flag(channel, CF_OUTBOUND); switch_set_flag(tech_pvt, TFLAG_OUTBOUND); switch_channel_set_state(channel, CS_INIT); - skypiax_call(tech_pvt, rdest, 30); + skypopen_call(tech_pvt, rdest, 30); switch_mutex_unlock(globals.mutex); return SWITCH_CAUSE_SUCCESS; } - ERRORA("Doh! no new_session\n", SKYPIAX_P_LOG); + ERRORA("Doh! no new_session\n", SKYPOPEN_P_LOG); return SWITCH_CAUSE_DESTINATION_OUT_OF_ORDER; } /*! - * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the skypiax_signaling_read function + * \brief This thread runs during a call, and monitor the interface for signaling, like hangup, caller id, etc most of signaling is handled inside the skypopen_signaling_read function * */ -static void *SWITCH_THREAD_FUNC skypiax_signaling_thread_func(switch_thread_t * thread, void *obj) +static void *SWITCH_THREAD_FUNC skypopen_signaling_thread_func(switch_thread_t * thread, void *obj) { private_t *tech_pvt = obj; int res; @@ -1145,17 +1145,17 @@ static void *SWITCH_THREAD_FUNC skypiax_signaling_thread_func(switch_thread_t * if (!tech_pvt) return NULL; - DEBUGA_SKYPE("In skypiax_signaling_thread_func: started, p=%p\n", SKYPIAX_P_LOG, (void *) tech_pvt); + DEBUGA_SKYPE("In skypopen_signaling_thread_func: started, p=%p\n", SKYPOPEN_P_LOG, (void *) tech_pvt); while (forever) { if (!(running && tech_pvt->running)) break; - res = skypiax_signaling_read(tech_pvt); + res = skypopen_signaling_read(tech_pvt); if (res == CALLFLOW_INCOMING_HANGUP || tech_pvt->skype_callflow == CALLFLOW_INCOMING_HANGUP) { switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; - DEBUGA_SKYPE("skype call ended\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("skype call ended\n", SKYPOPEN_P_LOG); if (tech_pvt) { session = switch_core_session_locate(tech_pvt->session_uuid_str); @@ -1168,14 +1168,14 @@ static void *SWITCH_THREAD_FUNC skypiax_signaling_thread_func(switch_thread_t * } switch_channel_hangup(channel, SWITCH_CAUSE_NORMAL_CLEARING); } else { - ERRORA("no channel?\n", SKYPIAX_P_LOG); + ERRORA("no channel?\n", SKYPOPEN_P_LOG); } switch_core_session_rwunlock(session); } else { - DEBUGA_SKYPE("no session\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("no session\n", SKYPOPEN_P_LOG); } switch_mutex_lock(globals.mutex); - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; *tech_pvt->session_uuid_str = '\0'; *tech_pvt->skype_call_id = '\0'; *tech_pvt->initial_skype_user = '\0'; @@ -1184,26 +1184,26 @@ static void *SWITCH_THREAD_FUNC skypiax_signaling_thread_func(switch_thread_t * switch_sleep(300000); //0.3 sec switch_mutex_lock(globals.mutex); tech_pvt->skype_callflow = CALLFLOW_CALL_IDLE; - tech_pvt->interface_state = SKYPIAX_STATE_IDLE; + tech_pvt->interface_state = SKYPOPEN_STATE_IDLE; switch_mutex_unlock(globals.mutex); } else { - ERRORA("no tech_pvt?\n", SKYPIAX_P_LOG); + ERRORA("no tech_pvt?\n", SKYPOPEN_P_LOG); } } } - DEBUGA_SKYPE("EXITING\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("EXITING\n", SKYPOPEN_P_LOG); return NULL; } static switch_status_t load_config(int reload_type) { - char *cf = "skypiax.conf"; + char *cf = "skypopen.conf"; switch_xml_t cfg, xml, global_settings, param, interfaces, myinterface; private_t *tech_pvt = NULL; - switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, skypiax_module_pool); + switch_mutex_init(&globals.mutex, SWITCH_MUTEX_NESTED, skypopen_module_pool); if (!(xml = switch_xml_open_cfg(cf, &cfg, NULL))) { - ERRORA("open of %s failed\n", SKYPIAX_P_LOG, cf); + ERRORA("open of %s failed\n", SKYPOPEN_P_LOG, cf); running = 0; switch_xml_free(xml); return SWITCH_STATUS_TERM; @@ -1217,29 +1217,29 @@ static switch_status_t load_config(int reload_type) if (!strcasecmp(var, "debug")) { globals.debug = atoi(val); - DEBUGA_SKYPE("globals.debug=%d\n", SKYPIAX_P_LOG, globals.debug); + DEBUGA_SKYPE("globals.debug=%d\n", SKYPOPEN_P_LOG, globals.debug); } else if (!strcmp(var, "context")) { set_global_context(val); - DEBUGA_SKYPE("globals.context=%s\n", SKYPIAX_P_LOG, globals.context); + DEBUGA_SKYPE("globals.context=%s\n", SKYPOPEN_P_LOG, globals.context); } else if (!strcmp(var, "dialplan")) { set_global_dialplan(val); - DEBUGA_SKYPE("globals.dialplan=%s\n", SKYPIAX_P_LOG, globals.dialplan); + DEBUGA_SKYPE("globals.dialplan=%s\n", SKYPOPEN_P_LOG, globals.dialplan); } else if (!strcmp(var, "destination")) { set_global_destination(val); - DEBUGA_SKYPE("globals.destination=%s\n", SKYPIAX_P_LOG, globals.destination); + DEBUGA_SKYPE("globals.destination=%s\n", SKYPOPEN_P_LOG, globals.destination); } else if (!strcmp(var, "skype_user")) { set_global_skype_user(val); - DEBUGA_SKYPE("globals.skype_user=%s\n", SKYPIAX_P_LOG, globals.skype_user); + DEBUGA_SKYPE("globals.skype_user=%s\n", SKYPOPEN_P_LOG, globals.skype_user); } else if (!strcmp(var, "report_incoming_chatmessages")) { set_global_report_incoming_chatmessages(val); - DEBUGA_SKYPE("globals.report_incoming_chatmessages=%s\n", SKYPIAX_P_LOG, globals.report_incoming_chatmessages); + DEBUGA_SKYPE("globals.report_incoming_chatmessages=%s\n", SKYPOPEN_P_LOG, globals.report_incoming_chatmessages); } else if (!strcmp(var, "silent_mode")) { set_global_silent_mode(val); - DEBUGA_SKYPE("globals.silent_mode=%s\n", SKYPIAX_P_LOG, globals.silent_mode); + DEBUGA_SKYPE("globals.silent_mode=%s\n", SKYPOPEN_P_LOG, globals.silent_mode); } else if (!strcmp(var, "write_silence_when_idle")) { set_global_write_silence_when_idle(val); - DEBUGA_SKYPE("globals.write_silence_when_idle=%s\n", SKYPIAX_P_LOG, globals.write_silence_when_idle); + DEBUGA_SKYPE("globals.write_silence_when_idle=%s\n", SKYPOPEN_P_LOG, globals.write_silence_when_idle); } } @@ -1303,7 +1303,7 @@ static switch_status_t load_config(int reload_type) } if (!skype_user) { - ERRORA("interface missing REQUIRED param 'skype_user'\n", SKYPIAX_P_LOG); + ERRORA("interface missing REQUIRED param 'skype_user'\n", SKYPOPEN_P_LOG); continue; } @@ -1317,151 +1317,151 @@ static switch_status_t load_config(int reload_type) } #ifndef WIN32 if (!X11_display) { - ERRORA("interface missing REQUIRED param 'X11_display'\n", SKYPIAX_P_LOG); + ERRORA("interface missing REQUIRED param 'X11_display'\n", SKYPOPEN_P_LOG); continue; } #endif if (!id) { - ERRORA("interface missing REQUIRED param 'id'\n", SKYPIAX_P_LOG); + ERRORA("interface missing REQUIRED param 'id'\n", SKYPOPEN_P_LOG); continue; } if (switch_is_number(id)) { interface_id = atoi(id); - DEBUGA_SKYPE("interface_id=%d\n", SKYPIAX_P_LOG, interface_id); + DEBUGA_SKYPE("interface_id=%d\n", SKYPOPEN_P_LOG, interface_id); } else { - ERRORA("interface param 'id' MUST be a number, now id='%s'\n", SKYPIAX_P_LOG, id); + ERRORA("interface param 'id' MUST be a number, now id='%s'\n", SKYPOPEN_P_LOG, id); continue; } if (!name) { - WARNINGA("interface missing param 'name', not nice, but works\n", SKYPIAX_P_LOG); + WARNINGA("interface missing param 'name', not nice, but works\n", SKYPOPEN_P_LOG); } if (name) { - DEBUGA_SKYPE("name=%s\n", SKYPIAX_P_LOG, name); + DEBUGA_SKYPE("name=%s\n", SKYPOPEN_P_LOG, name); } #ifndef WIN32 if (!XInitThreads()) { - ERRORA("Not initialized XInitThreads!\n", SKYPIAX_P_LOG); + ERRORA("Not initialized XInitThreads!\n", SKYPOPEN_P_LOG); } else { - DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Initialized XInitThreads!\n", SKYPOPEN_P_LOG); } switch_sleep(1000); #endif /* WIN32 */ - if (interface_id && interface_id < SKYPIAX_MAX_INTERFACES) { + if (interface_id && interface_id < SKYPOPEN_MAX_INTERFACES) { private_t newconf; - switch_threadattr_t *skypiax_api_thread_attr = NULL; - switch_threadattr_t *skypiax_signaling_thread_attr = NULL; + switch_threadattr_t *skypopen_api_thread_attr = NULL; + switch_threadattr_t *skypopen_signaling_thread_attr = NULL; memset(&newconf, '\0', sizeof(newconf)); - globals.SKYPIAX_INTERFACES[interface_id] = newconf; - globals.SKYPIAX_INTERFACES[interface_id].running = 1; + globals.SKYPOPEN_INTERFACES[interface_id] = newconf; + globals.SKYPOPEN_INTERFACES[interface_id].running = 1; - tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id]; + tech_pvt = &globals.SKYPOPEN_INTERFACES[interface_id]; - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].interface_id, id); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].interface_id, id); if (name) { - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, name); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].name, name); } else { - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].name, "N/A"); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].name, "N/A"); } - DEBUGA_SKYPE("CONFIGURING interface_id=%d\n", SKYPIAX_P_LOG, interface_id); + DEBUGA_SKYPE("CONFIGURING interface_id=%d\n", SKYPOPEN_P_LOG, interface_id); - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].context, context); - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].dialplan, dialplan); - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].destination, destination); - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].X11_display, X11_display); - switch_set_string(globals.SKYPIAX_INTERFACES[interface_id].skype_user, skype_user); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].context, context); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].dialplan, dialplan); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].destination, destination); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].X11_display, X11_display); + switch_set_string(globals.SKYPOPEN_INTERFACES[interface_id].skype_user, skype_user); if (!strcmp(report_incoming_chatmessages, "true") || !strcmp(report_incoming_chatmessages, "1")) { - globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages = 1; + globals.SKYPOPEN_INTERFACES[interface_id].report_incoming_chatmessages = 1; } else { - globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages = 0; //redundant, just in case + globals.SKYPOPEN_INTERFACES[interface_id].report_incoming_chatmessages = 0; //redundant, just in case } if (!strcmp(silent_mode, "true") || !strcmp(silent_mode, "1")) { - globals.SKYPIAX_INTERFACES[interface_id].silent_mode = 1; + globals.SKYPOPEN_INTERFACES[interface_id].silent_mode = 1; } else { - globals.SKYPIAX_INTERFACES[interface_id].silent_mode = 0; //redundant, just in case + globals.SKYPOPEN_INTERFACES[interface_id].silent_mode = 0; //redundant, just in case } if (!strcmp(write_silence_when_idle, "true") || !strcmp(write_silence_when_idle, "1")) { - globals.SKYPIAX_INTERFACES[interface_id].write_silence_when_idle = 1; + globals.SKYPOPEN_INTERFACES[interface_id].write_silence_when_idle = 1; } else { - globals.SKYPIAX_INTERFACES[interface_id].write_silence_when_idle = 0; //redundant, just in case + globals.SKYPOPEN_INTERFACES[interface_id].write_silence_when_idle = 0; //redundant, just in case } - DEBUGA_SKYPE("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].name=%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].name); + DEBUGA_SKYPE("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].name=%s\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].name); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].context=%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].context); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].context=%s\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].context); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].dialplan=%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].dialplan); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].dialplan=%s\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].dialplan); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].destination=%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].destination); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].destination=%s\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].destination); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].X11_display=%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].X11_display); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].X11_display=%s\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].X11_display); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].skype_user=%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].skype_user=%s\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages=%d\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].report_incoming_chatmessages); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].report_incoming_chatmessages=%d\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].report_incoming_chatmessages); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].silent_mode=%d\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].silent_mode); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].silent_mode=%d\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].silent_mode); DEBUGA_SKYPE - ("interface_id=%d globals.SKYPIAX_INTERFACES[interface_id].write_silence_when_idle=%d\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].write_silence_when_idle); + ("interface_id=%d globals.SKYPOPEN_INTERFACES[interface_id].write_silence_when_idle=%d\n", + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].write_silence_when_idle); - WARNINGA("STARTING interface_id=%d\n", SKYPIAX_P_LOG, interface_id); + WARNINGA("STARTING interface_id=%d\n", SKYPOPEN_P_LOG, interface_id); - switch_threadattr_create(&skypiax_api_thread_attr, skypiax_module_pool); - switch_threadattr_detach_set(skypiax_api_thread_attr, 0); - switch_threadattr_stacksize_set(skypiax_api_thread_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread, - skypiax_api_thread_attr, skypiax_do_skypeapi_thread, &globals.SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); + switch_threadattr_create(&skypopen_api_thread_attr, skypopen_module_pool); + switch_threadattr_detach_set(skypopen_api_thread_attr, 0); + switch_threadattr_stacksize_set(skypopen_api_thread_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread, + skypopen_api_thread_attr, skypopen_do_skypeapi_thread, &globals.SKYPOPEN_INTERFACES[interface_id], skypopen_module_pool); switch_sleep(100000); - switch_threadattr_create(&skypiax_signaling_thread_attr, skypiax_module_pool); - switch_threadattr_detach_set(skypiax_signaling_thread_attr, 0); - switch_threadattr_stacksize_set(skypiax_signaling_thread_attr, SWITCH_THREAD_STACKSIZE); - switch_thread_create(&globals.SKYPIAX_INTERFACES[interface_id]. - skypiax_signaling_thread, skypiax_signaling_thread_attr, - skypiax_signaling_thread_func, &globals.SKYPIAX_INTERFACES[interface_id], skypiax_module_pool); + switch_threadattr_create(&skypopen_signaling_thread_attr, skypopen_module_pool); + switch_threadattr_detach_set(skypopen_signaling_thread_attr, 0); + switch_threadattr_stacksize_set(skypopen_signaling_thread_attr, SWITCH_THREAD_STACKSIZE); + switch_thread_create(&globals.SKYPOPEN_INTERFACES[interface_id]. + skypopen_signaling_thread, skypopen_signaling_thread_attr, + skypopen_signaling_thread_func, &globals.SKYPOPEN_INTERFACES[interface_id], skypopen_module_pool); switch_sleep(100000); - skypiax_audio_init(&globals.SKYPIAX_INTERFACES[interface_id]); - switch_mutex_init(&globals.SKYPIAX_INTERFACES[interface_id].mutex_audio_srv, SWITCH_MUTEX_NESTED, skypiax_module_pool); - switch_mutex_init(&globals.SKYPIAX_INTERFACES[interface_id].mutex_audio_cli, SWITCH_MUTEX_NESTED, skypiax_module_pool); + skypopen_audio_init(&globals.SKYPOPEN_INTERFACES[interface_id]); + switch_mutex_init(&globals.SKYPOPEN_INTERFACES[interface_id].mutex_audio_srv, SWITCH_MUTEX_NESTED, skypopen_module_pool); + switch_mutex_init(&globals.SKYPOPEN_INTERFACES[interface_id].mutex_audio_cli, SWITCH_MUTEX_NESTED, skypopen_module_pool); NOTICA ("WAITING roughly 10 seconds to find a running Skype client and connect to its SKYPE API for interface_id=%d\n", - SKYPIAX_P_LOG, interface_id); + SKYPOPEN_P_LOG, interface_id); i = 0; - while (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.api_connected == 0 && running && i < 200) { // 10 seconds! thanks Jeff Lenk + while (globals.SKYPOPEN_INTERFACES[interface_id].SkypopenHandles.api_connected == 0 && running && i < 200) { // 10 seconds! thanks Jeff Lenk switch_sleep(50000); i++; } - if (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.api_connected) { + if (globals.SKYPOPEN_INTERFACES[interface_id].SkypopenHandles.api_connected) { NOTICA ("Found a running Skype client, connected to its SKYPE API for interface_id=%d, waiting 60 seconds for CURRENTUSERHANDLE==%s\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user); + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user); } else { ERRORA - ("Failed to connect to a SKYPE API for interface_id=%d, no SKYPE client running, please (re)start Skype client. Skypiax exiting\n", - SKYPIAX_P_LOG, interface_id); + ("Failed to connect to a SKYPE API for interface_id=%d, no SKYPE client running, please (re)start Skype client. Skypopen exiting\n", + SKYPOPEN_P_LOG, interface_id); running = 0; switch_mutex_unlock(globals.mutex); switch_xml_free(xml); @@ -1469,37 +1469,37 @@ static switch_status_t load_config(int reload_type) } i = 0; - while (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.currentuserhandle == 0 && running && i < 1200) { // 60 seconds! thanks Jeff Lenk + while (globals.SKYPOPEN_INTERFACES[interface_id].SkypopenHandles.currentuserhandle == 0 && running && i < 1200) { // 60 seconds! thanks Jeff Lenk switch_sleep(50000); i++; } - if (globals.SKYPIAX_INTERFACES[interface_id].SkypiaxHandles.currentuserhandle) { + if (globals.SKYPOPEN_INTERFACES[interface_id].SkypopenHandles.currentuserhandle) { WARNINGA ("Interface_id=%d is now STARTED, the Skype client to which we are connected gave us the correct CURRENTUSERHANDLE (%s)\n", - SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user); + SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user); - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "PROTOCOL 7"); + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "PROTOCOL 7"); switch_sleep(10000); - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET AUTOAWAY OFF"); + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET AUTOAWAY OFF"); switch_sleep(10000); - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET WINDOWSTATE HIDDEN"); + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET WINDOWSTATE HIDDEN"); switch_sleep(10000); - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET USERSTATUS ONLINE"); + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET USERSTATUS ONLINE"); switch_sleep(10000); - if (globals.SKYPIAX_INTERFACES[interface_id].silent_mode) { - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET SILENT_MODE ON"); + if (globals.SKYPOPEN_INTERFACES[interface_id].silent_mode) { + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON"); switch_sleep(10000); - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET SILENT_MODE OFF"); + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE OFF"); switch_sleep(10000); - skypiax_signaling_write(&globals.SKYPIAX_INTERFACES[interface_id], "SET SILENT_MODE ON"); + skypopen_signaling_write(&globals.SKYPOPEN_INTERFACES[interface_id], "SET SILENT_MODE ON"); switch_sleep(10000); } } else { ERRORA - ("The Skype client to which we are connected FAILED to gave us CURRENTUSERHANDLE=%s, interface_id=%d FAILED to start. No Skype client logged in as '%s' has been found. Please (re)launch a Skype client logged in as '%s'. Skypiax exiting now\n", - SKYPIAX_P_LOG, globals.SKYPIAX_INTERFACES[interface_id].skype_user, - interface_id, globals.SKYPIAX_INTERFACES[interface_id].skype_user, globals.SKYPIAX_INTERFACES[interface_id].skype_user); + ("The Skype client to which we are connected FAILED to gave us CURRENTUSERHANDLE=%s, interface_id=%d FAILED to start. No Skype client logged in as '%s' has been found. Please (re)launch a Skype client logged in as '%s'. Skypopen exiting now\n", + SKYPOPEN_P_LOG, globals.SKYPOPEN_INTERFACES[interface_id].skype_user, + interface_id, globals.SKYPOPEN_INTERFACES[interface_id].skype_user, globals.SKYPOPEN_INTERFACES[interface_id].skype_user); running = 0; switch_mutex_unlock(globals.mutex); switch_xml_free(xml); @@ -1507,30 +1507,30 @@ static switch_status_t load_config(int reload_type) } } else { - ERRORA("interface id %d is higher than SKYPIAX_MAX_INTERFACES (%d)\n", SKYPIAX_P_LOG, interface_id, SKYPIAX_MAX_INTERFACES); + ERRORA("interface id %d is higher than SKYPOPEN_MAX_INTERFACES (%d)\n", SKYPOPEN_P_LOG, interface_id, SKYPOPEN_MAX_INTERFACES); continue; } } - for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { + for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) { /* How many real intterfaces */ globals.real_interfaces = i + 1; - tech_pvt = &globals.SKYPIAX_INTERFACES[i]; + tech_pvt = &globals.SKYPOPEN_INTERFACES[i]; - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].interface_id=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].interface_id); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].name=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].name); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].context=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].context); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].dialplan=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].dialplan); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].destination=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].destination); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].X11_display=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].X11_display); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].skype_user=%s\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].skype_user); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].report_incoming_chatmessages=%d\n", SKYPIAX_P_LOG, i, i, - globals.SKYPIAX_INTERFACES[i].report_incoming_chatmessages); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].silent_mode=%d\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].silent_mode); - DEBUGA_SKYPE("i=%d globals.SKYPIAX_INTERFACES[%d].write_silence_when_idle=%d\n", SKYPIAX_P_LOG, i, i, globals.SKYPIAX_INTERFACES[i].write_silence_when_idle); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].interface_id=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].interface_id); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].name=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].name); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].context=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].context); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].dialplan=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].dialplan); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].destination=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].destination); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].X11_display=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].X11_display); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].skype_user=%s\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].skype_user); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].report_incoming_chatmessages=%d\n", SKYPOPEN_P_LOG, i, i, + globals.SKYPOPEN_INTERFACES[i].report_incoming_chatmessages); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].silent_mode=%d\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].silent_mode); + DEBUGA_SKYPE("i=%d globals.SKYPOPEN_INTERFACES[%d].write_silence_when_idle=%d\n", SKYPOPEN_P_LOG, i, i, globals.SKYPOPEN_INTERFACES[i].write_silence_when_idle); } } } @@ -1550,16 +1550,16 @@ static switch_status_t chat_send(const char *proto, const char *from, const char switch_assert(proto != NULL); - DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPIAX_P_LOG, proto, from, to, subject, body, type, + DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, type, hint ? hint : "NULL"); if (!to || !strlen(to)) { - ERRORA("Missing To: header.\n", SKYPIAX_P_LOG); + ERRORA("Missing To: header.\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_SUCCESS; } if ((!from && !hint) || (!strlen(from) && !strlen(hint))) { - ERRORA("Missing From: AND Hint: headers.\n", SKYPIAX_P_LOG); + ERRORA("Missing From: AND Hint: headers.\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_SUCCESS; } @@ -1577,39 +1577,39 @@ static switch_status_t chat_send(const char *proto, const char *from, const char *host++ = '\0'; } - DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPIAX_P_LOG, proto, from, to, subject, body, type, + DEBUGA_SKYPE("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=%s, hint=%s)\n", SKYPOPEN_P_LOG, proto, from, to, subject, body, type, hint ? hint : "NULL"); if (hint && strlen(hint)) { //in hint we receive the interface name to use - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].name) - && (strncmp(globals.SKYPIAX_INTERFACES[i].name, hint, strlen(hint)) == 0)) { - tech_pvt = &globals.SKYPIAX_INTERFACES[i]; - DEBUGA_SKYPE("Using interface: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name); + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name) + && (strncmp(globals.SKYPOPEN_INTERFACES[i].name, hint, strlen(hint)) == 0)) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[i]; + DEBUGA_SKYPE("Using interface: globals.SKYPOPEN_INTERFACES[%d].name=|||%s|||\n", SKYPOPEN_P_LOG, i, globals.SKYPOPEN_INTERFACES[i].name); found = 1; break; } } } else { //we have no a predefined interface name to use (hint is NULL), so let's choose an interface from the username (from) - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].name) - && (strncmp(globals.SKYPIAX_INTERFACES[i].skype_user, from, strlen(from)) == 0)) { - tech_pvt = &globals.SKYPIAX_INTERFACES[i]; - DEBUGA_SKYPE("Using interface: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", SKYPIAX_P_LOG, i, globals.SKYPIAX_INTERFACES[i].name); + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name) + && (strncmp(globals.SKYPOPEN_INTERFACES[i].skype_user, from, strlen(from)) == 0)) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[i]; + DEBUGA_SKYPE("Using interface: globals.SKYPOPEN_INTERFACES[%d].name=|||%s|||\n", SKYPOPEN_P_LOG, i, globals.SKYPOPEN_INTERFACES[i].name); found = 1; break; } } } if (!found) { - ERRORA("ERROR: A Skypiax interface with name='%s' or one with skypeuser='%s' was not found\n", SKYPIAX_P_LOG, hint ? hint : "NULL", + ERRORA("ERROR: A Skypopen interface with name='%s' or one with skypeuser='%s' was not found\n", SKYPOPEN_P_LOG, hint ? hint : "NULL", from ? from : "NULL"); goto end; } else { snprintf(skype_msg, sizeof(skype_msg), "CHAT CREATE %s", to); - skypiax_signaling_write(tech_pvt, skype_msg); + skypopen_signaling_write(tech_pvt, skype_msg); switch_sleep(1000); } @@ -1619,7 +1619,7 @@ static switch_status_t chat_send(const char *proto, const char *from, const char for (i = 0; i < MAX_CHATS; i++) { if (!strcmp(tech_pvt->chats[i].dialog_partner, to)) { snprintf(skype_msg, sizeof(skype_msg), "CHATMESSAGE %s %s", tech_pvt->chats[i].chatname, body); - skypiax_signaling_write(tech_pvt, skype_msg); + skypopen_signaling_write(tech_pvt, skype_msg); found = 1; break; } @@ -1628,7 +1628,7 @@ static switch_status_t chat_send(const char *proto, const char *from, const char break; } if (tried > 1000) { - ERRORA("No chat with dialog_partner='%s' was found\n", SKYPIAX_P_LOG, to); + ERRORA("No chat with dialog_partner='%s' was found\n", SKYPOPEN_P_LOG, to); break; } switch_sleep(1000); @@ -1642,12 +1642,12 @@ static switch_status_t chat_send(const char *proto, const char *from, const char } -SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) +SWITCH_MODULE_LOAD_FUNCTION(mod_skypopen_load) { switch_api_interface_t *commands_api_interface; switch_chat_interface_t *chat_interface; - skypiax_module_pool = pool; + skypopen_module_pool = pool; memset(&globals, '\0', sizeof(globals)); running = 1; @@ -1663,16 +1663,16 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) } *module_interface = switch_loadable_module_create_module_interface(pool, modname); - skypiax_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); - skypiax_endpoint_interface->interface_name = "skypiax"; - skypiax_endpoint_interface->io_routines = &skypiax_io_routines; - skypiax_endpoint_interface->state_handler = &skypiax_state_handlers; + skypopen_endpoint_interface = switch_loadable_module_create_interface(*module_interface, SWITCH_ENDPOINT_INTERFACE); + skypopen_endpoint_interface->interface_name = "skypopen"; + skypopen_endpoint_interface->io_routines = &skypopen_io_routines; + skypopen_endpoint_interface->state_handler = &skypopen_state_handlers; if (running) { - SWITCH_ADD_API(commands_api_interface, "sk", "Skypiax console commands", sk_function, SK_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "skypiax", "Skypiax interface commands", skypiax_function, SKYPIAX_SYNTAX); - SWITCH_ADD_API(commands_api_interface, "skypiax_chat", "Skypiax_chat interface remote_skypename TEXT", skypiax_chat_function, SKYPIAX_CHAT_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "sk", "Skypopen console commands", sk_function, SK_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "skypopen", "Skypopen interface commands", skypopen_function, SKYPOPEN_SYNTAX); + SWITCH_ADD_API(commands_api_interface, "skypopen_chat", "Skypopen_chat interface remote_skypename TEXT", skypopen_chat_function, SKYPOPEN_CHAT_SYNTAX); SWITCH_ADD_CHAT(chat_interface, MDL_CHAT_PROTO, chat_send); @@ -1682,7 +1682,7 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_skypiax_load) return SWITCH_STATUS_FALSE; } -SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) +SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypopen_shutdown) { int x; private_t *tech_pvt = NULL; @@ -1692,41 +1692,41 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) running = 0; - for (interface_id = 0; interface_id < SKYPIAX_MAX_INTERFACES; interface_id++) { - tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id]; + for (interface_id = 0; interface_id < SKYPOPEN_MAX_INTERFACES; interface_id++) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[interface_id]; - if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) { - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) { + if (strlen(globals.SKYPOPEN_INTERFACES[interface_id].name)) { + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) { #ifdef WIN32 - skypiax_signaling_write(tech_pvt, "DIE"); + skypopen_signaling_write(tech_pvt, "DIE"); switch_sleep(10000); - switch_file_write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die + switch_file_write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", &howmany); // let's the controldev_thread die #else /* WIN32 */ - howmany = write(tech_pvt->SkypiaxHandles.fdesc[1], "sciutati", howmany); + howmany = write(tech_pvt->SkypopenHandles.fdesc[1], "sciutati", howmany); #endif /* WIN32 */ } - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) { + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread) { #ifdef WIN32 - if (SendMessage(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypiax_api_thread_func die - DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", SKYPIAX_P_LOG, GetLastError()); - tech_pvt->skypiax_api_thread=NULL; + if (SendMessage(tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle, WM_DESTROY, 0, 0) == FALSE) { // let's the skypopen_api_thread_func die + DEBUGA_SKYPE("got FALSE here, thread probably was already dead. GetLastError returned: %d\n", SKYPOPEN_P_LOG, GetLastError()); + tech_pvt->skypopen_api_thread=NULL; } #else - if (tech_pvt->SkypiaxHandles.disp) { + if (tech_pvt->SkypopenHandles.disp) { XEvent e; - Atom atom1 = XInternAtom(tech_pvt->SkypiaxHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", + Atom atom1 = XInternAtom(tech_pvt->SkypopenHandles.disp, "SKYPECONTROLAPI_MESSAGE_BEGIN", False); memset(&e, 0, sizeof(e)); e.xclient.type = ClientMessage; e.xclient.message_type = atom1; /* leading message */ - e.xclient.display = tech_pvt->SkypiaxHandles.disp; - e.xclient.window = tech_pvt->SkypiaxHandles.skype_win; + e.xclient.display = tech_pvt->SkypopenHandles.disp; + e.xclient.window = tech_pvt->SkypopenHandles.skype_win; e.xclient.format = 8; - XSendEvent(tech_pvt->SkypiaxHandles.disp, tech_pvt->SkypiaxHandles.win, False, 0, &e); - XSync(tech_pvt->SkypiaxHandles.disp, False); + XSendEvent(tech_pvt->SkypopenHandles.disp, tech_pvt->SkypopenHandles.win, False, 0, &e); + XSync(tech_pvt->SkypopenHandles.disp, False); } #endif } @@ -1735,18 +1735,18 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) x--; switch_yield(50000); } - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread) { - switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_signaling_thread); + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread) { + switch_thread_join(&status, globals.SKYPOPEN_INTERFACES[interface_id].skypopen_signaling_thread); } if (status != SWITCH_STATUS_SUCCESS) - DEBUGA_SKYPE("got FALSE here, thread was not joined\n", SKYPIAX_P_LOG); - if (globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread) { - switch_thread_join(&status, globals.SKYPIAX_INTERFACES[interface_id].skypiax_api_thread); + DEBUGA_SKYPE("got FALSE here, thread was not joined\n", SKYPOPEN_P_LOG); + if (globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread) { + switch_thread_join(&status, globals.SKYPOPEN_INTERFACES[interface_id].skypopen_api_thread); } if (status != SWITCH_STATUS_SUCCESS) - DEBUGA_SKYPE("got FALSE here, thread was not joined\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("got FALSE here, thread was not joined\n", SKYPOPEN_P_LOG); #ifndef WIN32 - WARNINGA("SHUTDOWN interface_id=%d\n", SKYPIAX_P_LOG, interface_id); + WARNINGA("SHUTDOWN interface_id=%d\n", SKYPOPEN_P_LOG, interface_id); shutdown(tech_pvt->audiopipe_cli[0], 2); close(tech_pvt->audiopipe_cli[0]); shutdown(tech_pvt->audiopipe_cli[1], 2); @@ -1755,10 +1755,10 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) close(tech_pvt->audiopipe_srv[0]); shutdown(tech_pvt->audiopipe_srv[1], 2); close(tech_pvt->audiopipe_srv[1]); - shutdown(tech_pvt->SkypiaxHandles.fdesc[0], 2); - close(tech_pvt->SkypiaxHandles.fdesc[0]); - shutdown(tech_pvt->SkypiaxHandles.fdesc[1], 2); - close(tech_pvt->SkypiaxHandles.fdesc[1]); + shutdown(tech_pvt->SkypopenHandles.fdesc[0], 2); + close(tech_pvt->SkypopenHandles.fdesc[0]); + shutdown(tech_pvt->SkypopenHandles.fdesc[1], 2); + close(tech_pvt->SkypopenHandles.fdesc[1]); #endif /* WIN32 */ } @@ -1776,19 +1776,19 @@ SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_skypiax_shutdown) return SWITCH_STATUS_SUCCESS; } -void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj) +void *SWITCH_THREAD_FUNC skypopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj) { - return skypiax_do_tcp_srv_thread_func(obj); + return skypopen_do_tcp_srv_thread_func(obj); } -void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, void *obj) +void *SWITCH_THREAD_FUNC skypopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj) { - return skypiax_do_tcp_cli_thread_func(obj); + return skypopen_do_tcp_cli_thread_func(obj); } -void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj) +void *SWITCH_THREAD_FUNC skypopen_do_skypeapi_thread(switch_thread_t * thread, void *obj) { - return skypiax_do_skypeapi_thread_func(obj); + return skypopen_do_skypeapi_thread_func(obj); } int dtmf_received(private_t * tech_pvt, char *value) @@ -1807,21 +1807,21 @@ int dtmf_received(private_t * tech_pvt, char *value) NOTICA ("received DTMF '%c' on channel %s, but we're BRIDGED, so we DO NOT relay it out of band. If you DO want to relay it out of band when bridged too, on top of audio DTMF, set the channel variable 'skype_add_outband_dtmf_also_when_bridged=true' \n", - SKYPIAX_P_LOG, value[0], switch_channel_get_name(channel)); + SKYPOPEN_P_LOG, value[0], switch_channel_get_name(channel)); } else { switch_dtmf_t dtmf = { (char) value[0], switch_core_default_dtmf_duration(0) }; - DEBUGA_SKYPE("received DTMF %c on channel %s\n", SKYPIAX_P_LOG, dtmf.digit, switch_channel_get_name(channel)); + DEBUGA_SKYPE("received DTMF %c on channel %s\n", SKYPOPEN_P_LOG, dtmf.digit, switch_channel_get_name(channel)); switch_mutex_lock(tech_pvt->flag_mutex); switch_channel_queue_dtmf(channel, &dtmf); switch_set_flag(tech_pvt, TFLAG_DTMF); switch_mutex_unlock(tech_pvt->flag_mutex); } } else { - WARNINGA("received %c DTMF, but no channel?\n", SKYPIAX_P_LOG, value[0]); + WARNINGA("received %c DTMF, but no channel?\n", SKYPOPEN_P_LOG, value[0]); } switch_core_session_rwunlock(session); @@ -1835,43 +1835,43 @@ int start_audio_threads(private_t * tech_pvt) tech_pvt->begin_to_write = 0; tech_pvt->begin_to_read = 0; - if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, 320, skypiax_module_pool) != SWITCH_STATUS_SUCCESS) { - ERRORA("setup timer failed\n", SKYPIAX_P_LOG); + if (switch_core_timer_init(&tech_pvt->timer_read, "soft", 20, 320, skypopen_module_pool) != SWITCH_STATUS_SUCCESS) { + ERRORA("setup timer failed\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } switch_core_timer_sync(&tech_pvt->timer_read); - if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, 320, skypiax_module_pool) != SWITCH_STATUS_SUCCESS) { - ERRORA("setup timer failed\n", SKYPIAX_P_LOG); + if (switch_core_timer_init(&tech_pvt->timer_write, "soft", 20, 320, skypopen_module_pool) != SWITCH_STATUS_SUCCESS) { + ERRORA("setup timer failed\n", SKYPOPEN_P_LOG); return SWITCH_STATUS_FALSE; } switch_core_timer_sync(&tech_pvt->timer_write); - switch_threadattr_create(&thd_attr, skypiax_module_pool); + switch_threadattr_create(&thd_attr, skypopen_module_pool); switch_threadattr_detach_set(thd_attr, 0); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - if (switch_thread_create(&tech_pvt->tcp_srv_thread, thd_attr, skypiax_do_tcp_srv_thread, tech_pvt, skypiax_module_pool) == SWITCH_STATUS_SUCCESS) { - DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + if (switch_thread_create(&tech_pvt->tcp_srv_thread, thd_attr, skypopen_do_tcp_srv_thread, tech_pvt, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) { + DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPOPEN_P_LOG); } else { - ERRORA("failed to start tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + ERRORA("failed to start tcp_srv_thread thread.\n", SKYPOPEN_P_LOG); return -1; } - switch_threadattr_create(&thd_attr, skypiax_module_pool); + switch_threadattr_create(&thd_attr, skypopen_module_pool); switch_threadattr_detach_set(thd_attr, 0); switch_threadattr_stacksize_set(thd_attr, SWITCH_THREAD_STACKSIZE); - if (switch_thread_create(&tech_pvt->tcp_cli_thread, thd_attr, skypiax_do_tcp_cli_thread, tech_pvt, skypiax_module_pool) == SWITCH_STATUS_SUCCESS) { - DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); + if (switch_thread_create(&tech_pvt->tcp_cli_thread, thd_attr, skypopen_do_tcp_cli_thread, tech_pvt, skypopen_module_pool) == SWITCH_STATUS_SUCCESS) { + DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPOPEN_P_LOG); } else { - ERRORA("failed to start tcp_cli_thread thread.\n", SKYPIAX_P_LOG); + ERRORA("failed to start tcp_cli_thread thread.\n", SKYPOPEN_P_LOG); return -1; } switch_sleep(100000); if (tech_pvt->tcp_cli_thread == NULL || tech_pvt->tcp_srv_thread == NULL) { - ERRORA("tcp_cli_thread or tcp_srv_thread exited\n", SKYPIAX_P_LOG); + ERRORA("tcp_cli_thread or tcp_srv_thread exited\n", SKYPOPEN_P_LOG); return -1; } @@ -1883,34 +1883,34 @@ int new_inbound_channel(private_t * tech_pvt) switch_core_session_t *session = NULL; switch_channel_t *channel = NULL; - if ((session = switch_core_session_request(skypiax_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) { - DEBUGA_SKYPE("2 SESSION_REQUEST %s\n", SKYPIAX_P_LOG, switch_core_session_get_uuid(session)); + if ((session = switch_core_session_request(skypopen_endpoint_interface, SWITCH_CALL_DIRECTION_INBOUND, NULL)) != 0) { + DEBUGA_SKYPE("2 SESSION_REQUEST %s\n", SKYPOPEN_P_LOG, switch_core_session_get_uuid(session)); switch_core_session_add_stream(session, NULL); channel = switch_core_session_get_channel(session); if (!channel) { - ERRORA("Doh! no channel?\n", SKYPIAX_P_LOG); + ERRORA("Doh! no channel?\n", SKYPOPEN_P_LOG); switch_core_session_destroy(&session); return 0; } switch_channel_set_variable(channel, "waste", "false"); - if (skypiax_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Doh! no tech_init?\n", SKYPIAX_P_LOG); + if (skypopen_tech_init(tech_pvt, session) != SWITCH_STATUS_SUCCESS) { + ERRORA("Doh! no tech_init?\n", SKYPOPEN_P_LOG); switch_core_session_destroy(&session); return 0; } if ((tech_pvt->caller_profile = - switch_caller_profile_new(switch_core_session_get_pool(session), "skypiax", + switch_caller_profile_new(switch_core_session_get_pool(session), "skypopen", tech_pvt->dialplan, tech_pvt->callid_name, - tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_skypiax", tech_pvt->context, tech_pvt->destination)) != 0) { + tech_pvt->callid_number, NULL, NULL, NULL, NULL, "mod_skypopen", tech_pvt->context, tech_pvt->destination)) != 0) { char name[128]; - switch_snprintf(name, sizeof(name), "skypiax/%s", tech_pvt->name); + switch_snprintf(name, sizeof(name), "skypopen/%s", tech_pvt->name); switch_channel_set_name(channel, name); switch_channel_set_caller_profile(channel, tech_pvt->caller_profile); } switch_channel_set_state(channel, CS_INIT); if (switch_core_session_thread_launch(session) != SWITCH_STATUS_SUCCESS) { - ERRORA("Error spawning thread\n", SKYPIAX_P_LOG); + ERRORA("Error spawning thread\n", SKYPOPEN_P_LOG); switch_core_session_destroy(&session); return 0; } @@ -1921,7 +1921,7 @@ int new_inbound_channel(private_t * tech_pvt) switch_channel_set_variable(channel, "initial_skype_user", tech_pvt->initial_skype_user); } - DEBUGA_SKYPE("new_inbound_channel\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("new_inbound_channel\n", SKYPOPEN_P_LOG); return 0; } @@ -1934,20 +1934,20 @@ int remote_party_is_ringing(private_t * tech_pvt) if (!zstr(tech_pvt->session_uuid_str)) { session = switch_core_session_locate(tech_pvt->session_uuid_str); } else { - ERRORA("No session???\n", SKYPIAX_P_LOG); + ERRORA("No session???\n", SKYPOPEN_P_LOG); goto done; } if (session) { channel = switch_core_session_get_channel(session); } else { - ERRORA("No session???\n", SKYPIAX_P_LOG); + ERRORA("No session???\n", SKYPOPEN_P_LOG); goto done; } if (channel) { switch_channel_mark_ring_ready(channel); - DEBUGA_SKYPE("skype_call: REMOTE PARTY RINGING\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("skype_call: REMOTE PARTY RINGING\n", SKYPOPEN_P_LOG); } else { - ERRORA("No channel???\n", SKYPIAX_P_LOG); + ERRORA("No channel???\n", SKYPOPEN_P_LOG); } switch_core_session_rwunlock(session); @@ -1964,21 +1964,21 @@ int remote_party_is_early_media(private_t * tech_pvt) if (!zstr(tech_pvt->session_uuid_str)) { session = switch_core_session_locate(tech_pvt->session_uuid_str); } else { - ERRORA("No session???\n\n\n", SKYPIAX_P_LOG); + ERRORA("No session???\n\n\n", SKYPOPEN_P_LOG); goto done; } if (session) { channel = switch_core_session_get_channel(session); switch_core_session_add_stream(session, NULL); } else { - ERRORA("No session???\n", SKYPIAX_P_LOG); + ERRORA("No session???\n", SKYPOPEN_P_LOG); goto done; } if (channel) { switch_channel_mark_pre_answered(channel); - DEBUGA_SKYPE("skype_call: REMOTE PARTY EARLY MEDIA\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("skype_call: REMOTE PARTY EARLY MEDIA\n", SKYPOPEN_P_LOG); } else { - ERRORA("No channel???\n", SKYPIAX_P_LOG); + ERRORA("No channel???\n", SKYPOPEN_P_LOG); } switch_core_session_rwunlock(session); @@ -1995,30 +1995,30 @@ int outbound_channel_answered(private_t * tech_pvt) if (!zstr(tech_pvt->session_uuid_str)) { session = switch_core_session_locate(tech_pvt->session_uuid_str); } else { - ERRORA("No session???\n", SKYPIAX_P_LOG); + ERRORA("No session???\n", SKYPOPEN_P_LOG); goto done; } if (session) { channel = switch_core_session_get_channel(session); } else { - ERRORA("No channel???\n", SKYPIAX_P_LOG); + ERRORA("No channel???\n", SKYPOPEN_P_LOG); goto done; } if (channel) { switch_channel_mark_answered(channel); } else { - ERRORA("No channel???\n", SKYPIAX_P_LOG); + ERRORA("No channel???\n", SKYPOPEN_P_LOG); } switch_core_session_rwunlock(session); done: - DEBUGA_SKYPE("outbound_channel_answered!\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("outbound_channel_answered!\n", SKYPOPEN_P_LOG); return 0; } -private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling) +private_t *find_available_skypopen_interface_rr(private_t * tech_pvt_calling) { private_t *tech_pvt = NULL; int i; @@ -2029,25 +2029,25 @@ private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling) //XXX no, is just a convention, but you can have it start from 0. I do not, for aestetic reasons :-) //if (globals.next_interface == 0) globals.next_interface = 1; - for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { + for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) { int interface_id; interface_id = globals.next_interface; - globals.next_interface = interface_id + 1 < SKYPIAX_MAX_INTERFACES ? interface_id + 1 : 0; + globals.next_interface = interface_id + 1 < SKYPOPEN_MAX_INTERFACES ? interface_id + 1 : 0; - if (strlen(globals.SKYPIAX_INTERFACES[interface_id].name)) { + if (strlen(globals.SKYPOPEN_INTERFACES[interface_id].name)) { int skype_state = 0; - tech_pvt = &globals.SKYPIAX_INTERFACES[interface_id]; + tech_pvt = &globals.SKYPOPEN_INTERFACES[interface_id]; skype_state = tech_pvt->interface_state; - //DEBUGA_SKYPE("skype interface: %d, name: %s, state: %d\n", SKYPIAX_P_LOG, interface_id, globals.SKYPIAX_INTERFACES[interface_id].name, skype_state); + //DEBUGA_SKYPE("skype interface: %d, name: %s, state: %d\n", SKYPOPEN_P_LOG, interface_id, globals.SKYPOPEN_INTERFACES[interface_id].name, skype_state); if ((tech_pvt_calling ? strcmp(tech_pvt->skype_user, tech_pvt_calling->skype_user) : 1) - && (SKYPIAX_STATE_DOWN == skype_state || 0 == skype_state) && (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED + && (SKYPOPEN_STATE_DOWN == skype_state || 0 == skype_state) && (tech_pvt->skype_callflow == CALLFLOW_STATUS_FINISHED || 0 == tech_pvt->skype_callflow)) { - DEBUGA_SKYPE("returning as available skype interface name: %s, state: %d callflow: %d\n", SKYPIAX_P_LOG, tech_pvt->name, skype_state, + DEBUGA_SKYPE("returning as available skype interface name: %s, state: %d callflow: %d\n", SKYPOPEN_P_LOG, tech_pvt->name, skype_state, tech_pvt->skype_callflow); if (tech_pvt_calling == NULL) { - tech_pvt->interface_state = SKYPIAX_STATE_SELECTED; + tech_pvt->interface_state = SKYPOPEN_STATE_SELECTED; } switch_mutex_unlock(globals.mutex); @@ -2090,24 +2090,24 @@ SWITCH_STANDARD_API(sk_function) stream->write_function(stream, "F ID\t Name \tIB (F/T) OB (F/T)\tState\tCallFlw\t\tUUID\n"); stream->write_function(stream, "= ====\t ======== \t======= =======\t======\t============\t======\n"); - for (i = 0; i < SKYPIAX_MAX_INTERFACES; i++) { + for (i = 0; i < SKYPOPEN_MAX_INTERFACES; i++) { next_flag_char = i == globals.next_interface ? '*' : ' '; - ib += globals.SKYPIAX_INTERFACES[i].ib_calls; - ib_failed += globals.SKYPIAX_INTERFACES[i].ib_failed_calls; - ob += globals.SKYPIAX_INTERFACES[i].ob_calls; - ob_failed += globals.SKYPIAX_INTERFACES[i].ob_failed_calls; + ib += globals.SKYPOPEN_INTERFACES[i].ib_calls; + ib_failed += globals.SKYPOPEN_INTERFACES[i].ib_failed_calls; + ob += globals.SKYPOPEN_INTERFACES[i].ob_calls; + ob_failed += globals.SKYPOPEN_INTERFACES[i].ob_failed_calls; - if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) { stream->write_function(stream, "%c %d\t[%s]\t%3u/%u\t%6u/%u\t%s\t%s\t%s\n", next_flag_char, - i, globals.SKYPIAX_INTERFACES[i].name, - globals.SKYPIAX_INTERFACES[i].ib_failed_calls, - globals.SKYPIAX_INTERFACES[i].ib_calls, - globals.SKYPIAX_INTERFACES[i].ob_failed_calls, - globals.SKYPIAX_INTERFACES[i].ob_calls, - interface_status[globals.SKYPIAX_INTERFACES[i].interface_state], - skype_callflow[globals.SKYPIAX_INTERFACES[i].skype_callflow], globals.SKYPIAX_INTERFACES[i].session_uuid_str); + i, globals.SKYPOPEN_INTERFACES[i].name, + globals.SKYPOPEN_INTERFACES[i].ib_failed_calls, + globals.SKYPOPEN_INTERFACES[i].ib_calls, + globals.SKYPOPEN_INTERFACES[i].ob_failed_calls, + globals.SKYPOPEN_INTERFACES[i].ob_calls, + interface_status[globals.SKYPOPEN_INTERFACES[i].interface_state], + skype_callflow[globals.SKYPOPEN_INTERFACES[i].skype_callflow], globals.SKYPOPEN_INTERFACES[i].session_uuid_str); } else if (argc > 1 && !strcasecmp(argv[1], "full")) { stream->write_function(stream, "%c\t%d\n", next_flag_char, i); } @@ -2121,13 +2121,13 @@ SWITCH_STANDARD_API(sk_function) int found = 0; if (argc == 2) { - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.SKYPIAX_INTERFACES[i].name) - && (strncmp(globals.SKYPIAX_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) { - globals.sk_console = &globals.SKYPIAX_INTERFACES[i]; + if (strlen(globals.SKYPOPEN_INTERFACES[i].name) + && (strncmp(globals.SKYPOPEN_INTERFACES[i].name, argv[1], strlen(argv[1])) == 0)) { + globals.sk_console = &globals.SKYPOPEN_INTERFACES[i]; stream->write_function(stream, - "sk console is now: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPIAX_INTERFACES[i].name); + "sk console is now: globals.SKYPOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPOPEN_INTERFACES[i].name); stream->write_function(stream, "sk console is: |||%s|||\n", globals.sk_console->name); found = 1; break; @@ -2135,7 +2135,7 @@ SWITCH_STANDARD_API(sk_function) } if (!found) - stream->write_function(stream, "ERROR: A Skypiax interface with name='%s' was not found\n", argv[1]); + stream->write_function(stream, "ERROR: A Skypopen interface with name='%s' was not found\n", argv[1]); } else { stream->write_function(stream, "-ERR Usage: sk console interface_name\n"); @@ -2166,7 +2166,7 @@ SWITCH_STANDARD_API(sk_function) } else { if (globals.sk_console) - skypiax_signaling_write(globals.sk_console, (char *) cmd); + skypopen_signaling_write(globals.sk_console, (char *) cmd); else stream->write_function(stream, "sk console is NOT yet assigned\n"); } @@ -2176,7 +2176,7 @@ SWITCH_STANDARD_API(sk_function) return SWITCH_STATUS_SUCCESS; } -SWITCH_STANDARD_API(skypiax_function) +SWITCH_STANDARD_API(skypopen_function) { char *mycmd = NULL, *argv[10] = { 0 }; int argc = 0; @@ -2187,12 +2187,12 @@ SWITCH_STANDARD_API(skypiax_function) } if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX); + stream->write_function(stream, "ERROR, usage: %s", SKYPOPEN_SYNTAX); goto end; } if (argc < 2) { - stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX); + stream->write_function(stream, "ERROR, usage: %s", SKYPOPEN_SYNTAX); goto end; } @@ -2200,27 +2200,27 @@ SWITCH_STANDARD_API(skypiax_function) int i; int found = 0; - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.SKYPIAX_INTERFACES[i].name) - && (strncmp(globals.SKYPIAX_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.SKYPIAX_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPIAX_INTERFACES[i].name); + if (strlen(globals.SKYPOPEN_INTERFACES[i].name) + && (strncmp(globals.SKYPOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[i]; + stream->write_function(stream, "Using interface: globals.SKYPOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPOPEN_INTERFACES[i].name); found = 1; break; } } if (!found) { - stream->write_function(stream, "ERROR: A Skypiax interface with name='%s' was not found\n", argv[0]); + stream->write_function(stream, "ERROR: A Skypopen interface with name='%s' was not found\n", argv[0]); switch_safe_free(mycmd); return SWITCH_STATUS_SUCCESS; } else { - skypiax_signaling_write(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]); + skypopen_signaling_write(tech_pvt, (char *) &cmd[strlen(argv[0]) + 1]); } } else { - stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_SYNTAX); + stream->write_function(stream, "ERROR, usage: %s", SKYPOPEN_SYNTAX); } end: switch_safe_free(mycmd); @@ -2228,7 +2228,7 @@ SWITCH_STANDARD_API(skypiax_function) return SWITCH_STATUS_SUCCESS; } -int skypiax_answer(private_t * tech_pvt, char *id, char *value) +int skypopen_answer(private_t * tech_pvt, char *id, char *value) { char msg_to_skype[1024]; int i; @@ -2239,21 +2239,21 @@ int skypiax_answer(private_t * tech_pvt, char *id, char *value) switch_mutex_lock(globals.mutex); gettimeofday(&timenow, NULL); - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) { - giovatech = &globals.SKYPIAX_INTERFACES[i]; - if (strlen(giovatech->skype_call_id) && (giovatech->interface_state != SKYPIAX_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 1000000)) { //XXX 1.5sec - can have a max of 1 call coming from the same skypename to the same skypename each 1.5 seconds + giovatech = &globals.SKYPOPEN_INTERFACES[i]; + if (strlen(giovatech->skype_call_id) && (giovatech->interface_state != SKYPOPEN_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 1000000)) { //XXX 1.5sec - can have a max of 1 call coming from the same skypename to the same skypename each 1.5 seconds found = 1; DEBUGA_SKYPE - ("FOUND (name=%s, giovatech->interface_state=%d != SKYPIAX_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->callid_number=%s == value=%s)\n", - SKYPIAX_P_LOG, giovatech->name, giovatech->interface_state, + ("FOUND (name=%s, giovatech->interface_state=%d != SKYPOPEN_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->callid_number=%s == value=%s)\n", + SKYPOPEN_P_LOG, giovatech->name, giovatech->interface_state, giovatech->skype_user, tech_pvt->skype_user, giovatech->callid_number, value) - if (tech_pvt->interface_state == SKYPIAX_STATE_PRERING) { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; - } else if (tech_pvt->interface_state != 0 && tech_pvt->interface_state != SKYPIAX_STATE_DOWN) { - WARNINGA("Why an interface_state %d HERE?\n", SKYPIAX_P_LOG, tech_pvt->interface_state); - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + if (tech_pvt->interface_state == SKYPOPEN_STATE_PRERING) { + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; + } else if (tech_pvt->interface_state != 0 && tech_pvt->interface_state != SKYPOPEN_STATE_DOWN) { + WARNINGA("Why an interface_state %d HERE?\n", SKYPOPEN_P_LOG, tech_pvt->interface_state); + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; } break; @@ -2265,7 +2265,7 @@ int skypiax_answer(private_t * tech_pvt, char *id, char *value) switch_mutex_unlock(globals.mutex); return 0; } - DEBUGA_SKYPE("NOT FOUND\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("NOT FOUND\n", SKYPOPEN_P_LOG); if (tech_pvt && tech_pvt->skype_call_id && !strlen(tech_pvt->skype_call_id)) { /* we are not inside an active call */ @@ -2273,12 +2273,12 @@ int skypiax_answer(private_t * tech_pvt, char *id, char *value) tech_pvt->ib_calls++; sprintf(msg_to_skype, "GET CALL %s PARTNER_DISPNAME", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); switch_sleep(10000); - tech_pvt->interface_state = SKYPIAX_STATE_PREANSWER; + tech_pvt->interface_state = SKYPOPEN_STATE_PREANSWER; sprintf(msg_to_skype, "ALTER CALL %s ANSWER", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - DEBUGA_SKYPE("We answered a Skype RING on skype_call %s\n", SKYPIAX_P_LOG, id); + skypopen_signaling_write(tech_pvt, msg_to_skype); + DEBUGA_SKYPE("We answered a Skype RING on skype_call %s\n", SKYPOPEN_P_LOG, id); gettimeofday(&tech_pvt->answer_time, NULL); switch_copy_string(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); @@ -2286,19 +2286,19 @@ int skypiax_answer(private_t * tech_pvt, char *id, char *value) DEBUGA_SKYPE ("NEW! name: %s, state: %d, value=%s, tech_pvt->callid_number=%s, tech_pvt->skype_user=%s\n", - SKYPIAX_P_LOG, tech_pvt->name, tech_pvt->interface_state, value, tech_pvt->callid_number, tech_pvt->skype_user); + SKYPOPEN_P_LOG, tech_pvt->name, tech_pvt->interface_state, value, tech_pvt->callid_number, tech_pvt->skype_user); } else if (!tech_pvt || !tech_pvt->skype_call_id) { - ERRORA("No Call ID?\n", SKYPIAX_P_LOG); + ERRORA("No Call ID?\n", SKYPOPEN_P_LOG); } else { - DEBUGA_SKYPE("We're in a call now (%s), let's refuse this one (%s)\n", SKYPIAX_P_LOG, tech_pvt->skype_call_id, id); + DEBUGA_SKYPE("We're in a call now (%s), let's refuse this one (%s)\n", SKYPOPEN_P_LOG, tech_pvt->skype_call_id, id); sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } switch_mutex_unlock(globals.mutex); return 0; } -int skypiax_transfer(private_t * tech_pvt, char *id, char *value) +int skypopen_transfer(private_t * tech_pvt, char *id, char *value) { char msg_to_skype[1024]; int i; @@ -2309,15 +2309,15 @@ int skypiax_transfer(private_t * tech_pvt, char *id, char *value) switch_mutex_lock(globals.mutex); gettimeofday(&timenow, NULL); - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) { - giovatech = &globals.SKYPIAX_INTERFACES[i]; - if (strlen(giovatech->skype_call_id) && (giovatech->interface_state != SKYPIAX_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 500000)) { //0.5sec + giovatech = &globals.SKYPOPEN_INTERFACES[i]; + if (strlen(giovatech->skype_call_id) && (giovatech->interface_state != SKYPOPEN_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->callid_number, value)) && ((((timenow.tv_sec - giovatech->answer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->answer_time.tv_usec)) < 500000)) { //0.5sec found = 1; DEBUGA_SKYPE - ("FOUND (name=%s, giovatech->interface_state=%d != SKYPIAX_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->callid_number=%s == value=%s)\n", - SKYPIAX_P_LOG, giovatech->name, giovatech->interface_state, + ("FOUND (name=%s, giovatech->interface_state=%d != SKYPOPEN_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->callid_number=%s == value=%s)\n", + SKYPOPEN_P_LOG, giovatech->name, giovatech->interface_state, giovatech->skype_user, tech_pvt->skype_user, giovatech->callid_number, value) break; } @@ -2328,11 +2328,11 @@ int skypiax_transfer(private_t * tech_pvt, char *id, char *value) switch_mutex_unlock(globals.mutex); return 0; } - DEBUGA_SKYPE("NOT FOUND\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("NOT FOUND\n", SKYPOPEN_P_LOG); if (!tech_pvt || !tech_pvt->skype_call_id || !strlen(tech_pvt->skype_call_id)) { /* we are not inside an active call */ - DEBUGA_SKYPE("We're NO MORE in a call now %s\n", SKYPIAX_P_LOG, (tech_pvt && tech_pvt->skype_call_id) ? tech_pvt->skype_call_id : ""); + DEBUGA_SKYPE("We're NO MORE in a call now %s\n", SKYPOPEN_P_LOG, (tech_pvt && tech_pvt->skype_call_id) ? tech_pvt->skype_call_id : ""); switch_mutex_unlock(globals.mutex); } else { @@ -2344,18 +2344,18 @@ int skypiax_transfer(private_t * tech_pvt, char *id, char *value) <- CALL 288 CAN_TRANSFER test2 TRUE **********************************/ - private_t *available_skypiax_interface = NULL; + private_t *available_skypopen_interface = NULL; gettimeofday(&timenow, NULL); - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { - if (strlen(globals.SKYPIAX_INTERFACES[i].name)) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { + if (strlen(globals.SKYPOPEN_INTERFACES[i].name)) { - giovatech = &globals.SKYPIAX_INTERFACES[i]; - if (strlen(giovatech->skype_transfer_call_id) && (giovatech->interface_state != SKYPIAX_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->transfer_callid_number, value)) && ((((timenow.tv_sec - giovatech->transfer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->transfer_time.tv_usec)) < 1000000)) { //1.0 sec + giovatech = &globals.SKYPOPEN_INTERFACES[i]; + if (strlen(giovatech->skype_transfer_call_id) && (giovatech->interface_state != SKYPOPEN_STATE_DOWN) && (!strcmp(giovatech->skype_user, tech_pvt->skype_user)) && (!strcmp(giovatech->transfer_callid_number, value)) && ((((timenow.tv_sec - giovatech->transfer_time.tv_sec) * 1000000) + (timenow.tv_usec - giovatech->transfer_time.tv_usec)) < 1000000)) { //1.0 sec found = 1; DEBUGA_SKYPE - ("FOUND (name=%s, giovatech->interface_state=%d != SKYPIAX_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->transfer_callid_number=%s == value=%s)\n", - SKYPIAX_P_LOG, giovatech->name, giovatech->interface_state, + ("FOUND (name=%s, giovatech->interface_state=%d != SKYPOPEN_STATE_DOWN) && (giovatech->skype_user=%s == tech_pvt->skype_user=%s) && (giovatech->transfer_callid_number=%s == value=%s)\n", + SKYPOPEN_P_LOG, giovatech->name, giovatech->interface_state, giovatech->skype_user, tech_pvt->skype_user, giovatech->transfer_callid_number, value) break; } @@ -2366,13 +2366,13 @@ int skypiax_transfer(private_t * tech_pvt, char *id, char *value) switch_mutex_unlock(globals.mutex); return 0; } - DEBUGA_SKYPE("NOT FOUND\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("NOT FOUND\n", SKYPOPEN_P_LOG); - available_skypiax_interface = find_available_skypiax_interface_rr(tech_pvt); - if (available_skypiax_interface) { - /* there is a skypiax interface idle, let's transfer the call to it */ + available_skypopen_interface = find_available_skypopen_interface_rr(tech_pvt); + if (available_skypopen_interface) { + /* there is a skypopen interface idle, let's transfer the call to it */ - switch_copy_string(available_skypiax_interface->initial_skype_user, tech_pvt->skype_user, sizeof(tech_pvt->skype_user) - 1); + switch_copy_string(available_skypopen_interface->initial_skype_user, tech_pvt->skype_user, sizeof(tech_pvt->skype_user) - 1); gettimeofday(&tech_pvt->transfer_time, NULL); switch_copy_string(tech_pvt->skype_transfer_call_id, id, sizeof(tech_pvt->skype_transfer_call_id) - 1); @@ -2380,27 +2380,27 @@ int skypiax_transfer(private_t * tech_pvt, char *id, char *value) switch_copy_string(tech_pvt->transfer_callid_number, value, sizeof(tech_pvt->transfer_callid_number) - 1); DEBUGA_SKYPE - ("Let's transfer the skype_call %s to %s interface (with skype_user: %s), because we are already in a skypiax call(%s)\n", - SKYPIAX_P_LOG, tech_pvt->skype_call_id, available_skypiax_interface->name, available_skypiax_interface->skype_user, id); + ("Let's transfer the skype_call %s to %s interface (with skype_user: %s), because we are already in a skypopen call(%s)\n", + SKYPOPEN_P_LOG, tech_pvt->skype_call_id, available_skypopen_interface->name, available_skypopen_interface->skype_user, id); - sprintf(msg_to_skype, "ALTER CALL %s TRANSFER %s", id, available_skypiax_interface->skype_user); - skypiax_signaling_write(tech_pvt, msg_to_skype); - if (tech_pvt->interface_state == SKYPIAX_STATE_SELECTED) { - tech_pvt->interface_state = SKYPIAX_STATE_IDLE; //we marked it SKYPIAX_STATE_SELECTED just in case it has to make an outbound call + sprintf(msg_to_skype, "ALTER CALL %s TRANSFER %s", id, available_skypopen_interface->skype_user); + skypopen_signaling_write(tech_pvt, msg_to_skype); + if (tech_pvt->interface_state == SKYPOPEN_STATE_SELECTED) { + tech_pvt->interface_state = SKYPOPEN_STATE_IDLE; //we marked it SKYPOPEN_STATE_SELECTED just in case it has to make an outbound call } } else { - /* no skypiax interfaces idle, do nothing */ + /* no skypopen interfaces idle, do nothing */ DEBUGA_SKYPE - ("Not answering the skype_call %s, because we are already in a skypiax call(%s) and not transferring, because no other skypiax interfaces are available\n", - SKYPIAX_P_LOG, id, tech_pvt->skype_call_id); + ("Not answering the skype_call %s, because we are already in a skypopen call(%s) and not transferring, because no other skypopen interfaces are available\n", + SKYPOPEN_P_LOG, id, tech_pvt->skype_call_id); sprintf(msg_to_skype, "ALTER CALL %s END HANGUP", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } switch_sleep(10000); DEBUGA_SKYPE - ("We have NOT answered a Skype RING from skype_call %s, because we are already in a skypiax call (%s)\n", - SKYPIAX_P_LOG, id, tech_pvt->skype_call_id); + ("We have NOT answered a Skype RING from skype_call %s, because we are already in a skypopen call (%s)\n", + SKYPOPEN_P_LOG, id, tech_pvt->skype_call_id); switch_mutex_unlock(globals.mutex); } @@ -2413,10 +2413,10 @@ int incoming_chatmessage(private_t * tech_pvt, int which) switch_core_session_t *session = NULL; int event_sent_to_esl = 0; - DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPIAX_P_LOG, tech_pvt->name); + DEBUGA_SKYPE("received CHATMESSAGE on interface %s\n", SKYPOPEN_P_LOG, tech_pvt->name); if (!tech_pvt->report_incoming_chatmessages) { - DEBUGA_SKYPE("I will not generate an Event, report_incoming_chatmessages is %d\n", SKYPIAX_P_LOG, tech_pvt->report_incoming_chatmessages); + DEBUGA_SKYPE("I will not generate an Event, report_incoming_chatmessages is %d\n", SKYPOPEN_P_LOG, tech_pvt->report_incoming_chatmessages); return 0; } @@ -2445,7 +2445,7 @@ int incoming_chatmessage(private_t * tech_pvt, int which) } } else { - ERRORA("cannot create event on interface %s. WHY?????\n", SKYPIAX_P_LOG, tech_pvt->name); + ERRORA("cannot create event on interface %s. WHY?????\n", SKYPOPEN_P_LOG, tech_pvt->name); } if (!event_sent_to_esl) { @@ -2466,7 +2466,7 @@ int incoming_chatmessage(private_t * tech_pvt, int which) } switch_event_fire(&event); } else { - ERRORA("cannot create event on interface %s. WHY?????\n", SKYPIAX_P_LOG, tech_pvt->name); + ERRORA("cannot create event on interface %s. WHY?????\n", SKYPOPEN_P_LOG, tech_pvt->name); } } @@ -2478,7 +2478,7 @@ int incoming_chatmessage(private_t * tech_pvt, int which) } -SWITCH_STANDARD_API(skypiax_chat_function) +SWITCH_STANDARD_API(skypopen_chat_function) { char *mycmd = NULL, *argv[10] = { 0 }; int argc = 0; @@ -2491,33 +2491,33 @@ SWITCH_STANDARD_API(skypiax_chat_function) } if (!argc) { - stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_CHAT_SYNTAX); + stream->write_function(stream, "ERROR, usage: %s", SKYPOPEN_CHAT_SYNTAX); goto end; } if (argc < 3) { - stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_CHAT_SYNTAX); + stream->write_function(stream, "ERROR, usage: %s", SKYPOPEN_CHAT_SYNTAX); goto end; } if (argv[0]) { - for (i = 0; !found && i < SKYPIAX_MAX_INTERFACES; i++) { + for (i = 0; !found && i < SKYPOPEN_MAX_INTERFACES; i++) { /* we've been asked for a normal interface name, or we have not found idle interfaces to serve as the "ANY" interface */ - if (strlen(globals.SKYPIAX_INTERFACES[i].name) - && (strncmp(globals.SKYPIAX_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { - tech_pvt = &globals.SKYPIAX_INTERFACES[i]; - stream->write_function(stream, "Using interface: globals.SKYPIAX_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPIAX_INTERFACES[i].name); + if (strlen(globals.SKYPOPEN_INTERFACES[i].name) + && (strncmp(globals.SKYPOPEN_INTERFACES[i].name, argv[0], strlen(argv[0])) == 0)) { + tech_pvt = &globals.SKYPOPEN_INTERFACES[i]; + stream->write_function(stream, "Using interface: globals.SKYPOPEN_INTERFACES[%d].name=|||%s|||\n", i, globals.SKYPOPEN_INTERFACES[i].name); found = 1; break; } } if (!found) { - stream->write_function(stream, "ERROR: A Skypiax interface with name='%s' was not found\n", argv[0]); + stream->write_function(stream, "ERROR: A Skypopen interface with name='%s' was not found\n", argv[0]); goto end; } else { - NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", SKYPIAX_P_LOG, MDL_CHAT_PROTO, tech_pvt->skype_user, + NOTICA("chat_send(proto=%s, from=%s, to=%s, subject=%s, body=%s, type=NULL, hint=%s)\n", SKYPOPEN_P_LOG, MDL_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", switch_str_nil((char *) &cmd[strlen(argv[0]) + 1 + strlen(argv[1]) + 1]), tech_pvt->name); chat_send(MDL_CHAT_PROTO, tech_pvt->skype_user, argv[1], "SIMPLE MESSAGE", @@ -2525,7 +2525,7 @@ SWITCH_STANDARD_API(skypiax_chat_function) } } else { - stream->write_function(stream, "ERROR, usage: %s", SKYPIAX_CHAT_SYNTAX); + stream->write_function(stream, "ERROR, usage: %s", SKYPOPEN_CHAT_SYNTAX); goto end; } diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/skypopen.h b/src/mod/endpoints/mod_skypopen/mod_skypopen/skypopen.h similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/skypopen.h rename to src/mod/endpoints/mod_skypopen/mod_skypopen/skypopen.h diff --git a/src/mod/endpoints/mod_skypiax/mod_skypopen/skypopen_protocol.c b/src/mod/endpoints/mod_skypopen/mod_skypopen/skypopen_protocol.c similarity index 100% rename from src/mod/endpoints/mod_skypiax/mod_skypopen/skypopen_protocol.c rename to src/mod/endpoints/mod_skypopen/mod_skypopen/skypopen_protocol.c diff --git a/src/mod/endpoints/mod_skypiax/skypiax.h b/src/mod/endpoints/mod_skypopen/skypopen.h similarity index 66% rename from src/mod/endpoints/mod_skypiax/skypiax.h rename to src/mod/endpoints/mod_skypopen/skypopen.h index b75f43ba82..d1d0c5dd00 100644 --- a/src/mod/endpoints/mod_skypiax/skypiax.h +++ b/src/mod/endpoints/mod_skypopen/skypopen.h @@ -21,7 +21,7 @@ * Portions created by the Initial Developer are Copyright (C) * the Initial Developer. All Rights Reserved. * - * This module (mod_skypiax) has been contributed by: + * This module (mod_skypopen) has been contributed by: * * Giovanni Maruzzelli (gmaruzz@gmail.com) * @@ -29,7 +29,7 @@ * Further Contributors: * * - * mod_skypiax.c -- Skype compatible Endpoint Module + * mod_skypopen.c -- Skype compatible Endpoint Module * */ @@ -57,14 +57,14 @@ #pragma warning(disable:4127) #endif -#define MY_EVENT_INCOMING_CHATMESSAGE "skypiax::incoming_chatmessage" +#define MY_EVENT_INCOMING_CHATMESSAGE "skypopen::incoming_chatmessage" -#define SAMPLERATE_SKYPIAX 16000 -#define SAMPLES_PER_FRAME SAMPLERATE_SKYPIAX/50 +#define SAMPLERATE_SKYPOPEN 16000 +#define SAMPLES_PER_FRAME SAMPLERATE_SKYPOPEN/50 -#ifndef SKYPIAX_SVN_VERSION -#define SKYPIAX_SVN_VERSION SWITCH_VERSION_REVISION -#endif /* SKYPIAX_SVN_VERSION */ +#ifndef SKYPOPEN_SVN_VERSION +#define SKYPOPEN_SVN_VERSION SWITCH_VERSION_REVISION +#endif /* SKYPOPEN_SVN_VERSION */ typedef enum { TFLAG_IO = (1 << 0), @@ -82,36 +82,36 @@ typedef enum { GFLAG_MY_CODEC_PREFS = (1 << 0) } GFLAGS; -#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPIAX_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_SKYPE(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_SKYPE %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_CALL(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_CALL %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define DEBUGA_PBX(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_DEBUG, "rev "SKYPOPEN_SVN_VERSION "[%p|%-7lx][DEBUG_PBX %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define ERRORA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "rev "SKYPOPEN_SVN_VERSION "[%p|%-7lx][ERRORA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define WARNINGA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "rev "SKYPOPEN_SVN_VERSION "[%p|%-7lx][WARNINGA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); +#define NOTICA(...) switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_NOTICE, "rev "SKYPOPEN_SVN_VERSION "[%p|%-7lx][NOTICA %-5d][%-10s][%2d,%2d,%2d] " __VA_ARGS__ ); -#define SKYPIAX_P_LOG NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->skype_callflow : -1 +#define SKYPOPEN_P_LOG NULL, (unsigned long)55, __LINE__, tech_pvt ? tech_pvt->name ? tech_pvt->name : "none" : "none", -1, tech_pvt ? tech_pvt->interface_state : -1, tech_pvt ? tech_pvt->skype_callflow : -1 /*********************************/ -#define SKYPIAX_CAUSE_NORMAL 1 +#define SKYPOPEN_CAUSE_NORMAL 1 /*********************************/ -#define SKYPIAX_FRAME_DTMF 1 +#define SKYPOPEN_FRAME_DTMF 1 /*********************************/ -#define SKYPIAX_CONTROL_RINGING 1 -#define SKYPIAX_CONTROL_ANSWER 2 +#define SKYPOPEN_CONTROL_RINGING 1 +#define SKYPOPEN_CONTROL_ANSWER 2 /*********************************/ -#define SKYPIAX_STATE_IDLE 0 -#define SKYPIAX_STATE_DOWN 1 -#define SKYPIAX_STATE_RING 2 -#define SKYPIAX_STATE_DIALING 3 -#define SKYPIAX_STATE_BUSY 4 -#define SKYPIAX_STATE_UP 5 -#define SKYPIAX_STATE_RINGING 6 -#define SKYPIAX_STATE_PRERING 7 -#define SKYPIAX_STATE_ERROR_DOUBLE_CALL 8 -#define SKYPIAX_STATE_SELECTED 9 -#define SKYPIAX_STATE_HANGUP_REQUESTED 10 -#define SKYPIAX_STATE_PREANSWER 11 +#define SKYPOPEN_STATE_IDLE 0 +#define SKYPOPEN_STATE_DOWN 1 +#define SKYPOPEN_STATE_RING 2 +#define SKYPOPEN_STATE_DIALING 3 +#define SKYPOPEN_STATE_BUSY 4 +#define SKYPOPEN_STATE_UP 5 +#define SKYPOPEN_STATE_RINGING 6 +#define SKYPOPEN_STATE_PRERING 7 +#define SKYPOPEN_STATE_ERROR_DOUBLE_CALL 8 +#define SKYPOPEN_STATE_SELECTED 9 +#define SKYPOPEN_STATE_HANGUP_REQUESTED 10 +#define SKYPOPEN_STATE_PREANSWER 11 /*********************************/ /* call flow from the device */ #define CALLFLOW_CALL_IDLE 0 @@ -144,10 +144,10 @@ typedef enum { /*********************************/ -#define SKYPIAX_MAX_INTERFACES 64 +#define SKYPOPEN_MAX_INTERFACES 64 #ifndef WIN32 -struct SkypiaxHandles { +struct SkypopenHandles { Window skype_win; Display *disp; Window win; @@ -157,7 +157,7 @@ struct SkypiaxHandles { }; #else //WIN32 -struct SkypiaxHandles { +struct SkypopenHandles { HWND win32_hInit_MainWindowHandle; HWND win32_hGlobal_SkypeAPIWindowHandle; HINSTANCE win32_hInit_ProcessHandle; @@ -216,12 +216,12 @@ struct private_object { int tcp_cli_port; int tcp_srv_port; #endif - struct SkypiaxHandles SkypiaxHandles; + struct SkypopenHandles SkypopenHandles; int interface_state; char language[80]; char exten[80]; - int skypiax_sound_rate; + int skypopen_sound_rate; char callid_name[50]; char callid_number[50]; double playback_boost; @@ -238,16 +238,16 @@ struct private_object { #ifdef WIN32 switch_file_t *audiopipe_srv[2]; switch_file_t *audiopipe_cli[2]; - switch_file_t *skypiax_sound_capt_fd; + switch_file_t *skypopen_sound_capt_fd; #else /* WIN32 */ int audiopipe_srv[2]; int audiopipe_cli[2]; - int skypiax_sound_capt_fd; + int skypopen_sound_capt_fd; #endif /* WIN32 */ switch_thread_t *tcp_srv_thread; switch_thread_t *tcp_cli_thread; - switch_thread_t *skypiax_signaling_thread; - switch_thread_t *skypiax_api_thread; + switch_thread_t *skypopen_signaling_thread; + switch_thread_t *skypopen_api_thread; short audiobuf[SAMPLES_PER_FRAME]; int audiobuf_is_loaded; short audiobuf_cli[SAMPLES_PER_FRAME]; @@ -258,7 +258,7 @@ struct private_object { int flag_audio_srv; FILE *phonebook_writing_fp; - int skypiax_dir_entry_extension_prefix; + int skypopen_dir_entry_extension_prefix; char skype_user[256]; char initial_skype_user[256]; char skype_password[256]; @@ -292,47 +292,47 @@ struct private_object { typedef struct private_object private_t; -void *SWITCH_THREAD_FUNC skypiax_api_thread_func(switch_thread_t * thread, void *obj); -int skypiax_audio_read(private_t * tech_pvt); -int skypiax_audio_init(private_t * tech_pvt); -int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype); -int skypiax_signaling_read(private_t * tech_pvt); +void *SWITCH_THREAD_FUNC skypopen_api_thread_func(switch_thread_t * thread, void *obj); +int skypopen_audio_read(private_t * tech_pvt); +int skypopen_audio_init(private_t * tech_pvt); +int skypopen_signaling_write(private_t * tech_pvt, char *msg_to_skype); +int skypopen_signaling_read(private_t * tech_pvt); -int skypiax_call(private_t * tech_pvt, char *idest, int timeout); -int skypiax_senddigit(private_t * tech_pvt, char digit); +int skypopen_call(private_t * tech_pvt, char *idest, int timeout); +int skypopen_senddigit(private_t * tech_pvt, char digit); -void *skypiax_do_tcp_srv_thread_func(void *obj); -void *SWITCH_THREAD_FUNC skypiax_do_tcp_srv_thread(switch_thread_t * thread, void *obj); +void *skypopen_do_tcp_srv_thread_func(void *obj); +void *SWITCH_THREAD_FUNC skypopen_do_tcp_srv_thread(switch_thread_t * thread, void *obj); -void *skypiax_do_tcp_cli_thread_func(void *obj); -void *SWITCH_THREAD_FUNC skypiax_do_tcp_cli_thread(switch_thread_t * thread, void *obj); +void *skypopen_do_tcp_cli_thread_func(void *obj); +void *SWITCH_THREAD_FUNC skypopen_do_tcp_cli_thread(switch_thread_t * thread, void *obj); -void *skypiax_do_skypeapi_thread_func(void *obj); -void *SWITCH_THREAD_FUNC skypiax_do_skypeapi_thread(switch_thread_t * thread, void *obj); +void *skypopen_do_skypeapi_thread_func(void *obj); +void *SWITCH_THREAD_FUNC skypopen_do_skypeapi_thread(switch_thread_t * thread, void *obj); int dtmf_received(private_t * tech_pvt, char *value); int start_audio_threads(private_t * tech_pvt); int new_inbound_channel(private_t * tech_pvt); int outbound_channel_answered(private_t * tech_pvt); -int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype); +int skypopen_signaling_write(private_t * tech_pvt, char *msg_to_skype); #if defined(WIN32) && !defined(__CYGWIN__) -int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany); -int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany); +int skypopen_pipe_read(switch_file_t * pipe, short *buf, int howmany); +int skypopen_pipe_write(switch_file_t * pipe, short *buf, int howmany); /* Visual C do not have strsep ? */ char *strsep(char **stringp, const char *delim); #else -int skypiax_pipe_read(int pipe, short *buf, int howmany); -int skypiax_pipe_write(int pipe, short *buf, int howmany); +int skypopen_pipe_read(int pipe, short *buf, int howmany); +int skypopen_pipe_write(int pipe, short *buf, int howmany); #endif /* WIN32 */ -int skypiax_close_socket(unsigned int fd); -private_t *find_available_skypiax_interface_rr(private_t * tech_pvt_calling); +int skypopen_close_socket(unsigned int fd); +private_t *find_available_skypopen_interface_rr(private_t * tech_pvt_calling); int remote_party_is_ringing(private_t * tech_pvt); int remote_party_is_early_media(private_t * tech_pvt); -int skypiax_answer(private_t * tech_pvt, char *id, char *value); -int skypiax_transfer(private_t * tech_pvt, char *id, char *value); +int skypopen_answer(private_t * tech_pvt, char *id, char *value); +int skypopen_transfer(private_t * tech_pvt, char *id, char *value); #ifndef WIN32 -int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port); +int skypopen_socket_create_and_bind(private_t * tech_pvt, int *which_port); #else -int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port); +int skypopen_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port); #endif //WIN32 int incoming_chatmessage(private_t * tech_pvt, int which); int next_port(void); diff --git a/src/mod/endpoints/mod_skypiax/skypiax_protocol.c b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c similarity index 62% rename from src/mod/endpoints/mod_skypiax/skypiax_protocol.c rename to src/mod/endpoints/mod_skypopen/skypopen_protocol.c index 9c729b5553..3e13b9c825 100644 --- a/src/mod/endpoints/mod_skypiax/skypiax_protocol.c +++ b/src/mod/endpoints/mod_skypopen/skypopen_protocol.c @@ -1,18 +1,18 @@ -#include "skypiax.h" +#include "skypopen.h" #ifdef ASTERISK -#define skypiax_sleep usleep -#define skypiax_strncpy strncpy +#define skypopen_sleep usleep +#define skypopen_strncpy strncpy #define tech_pvt p -extern int skypiax_debug; -extern char *skypiax_console_active; +extern int skypopen_debug; +extern char *skypopen_console_active; #else /* FREESWITCH */ -#define skypiax_sleep switch_sleep -#define skypiax_strncpy switch_copy_string -extern switch_memory_pool_t *skypiax_module_pool; -extern switch_endpoint_interface_t *skypiax_endpoint_interface; +#define skypopen_sleep switch_sleep +#define skypopen_strncpy switch_copy_string +extern switch_memory_pool_t *skypopen_module_pool; +extern switch_endpoint_interface_t *skypopen_endpoint_interface; #endif /* ASTERISK */ -int samplerate_skypiax = SAMPLERATE_SKYPIAX; +int samplerate_skypopen = SAMPLERATE_SKYPOPEN; extern int running; @@ -26,9 +26,9 @@ int xerror = 0; #endif /* WIN32 */ /*************************************/ #ifndef WIN32 -int skypiax_socket_create_and_bind(private_t * tech_pvt, int *which_port) +int skypopen_socket_create_and_bind(private_t * tech_pvt, int *which_port) #else -int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port) +int skypopen_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_port) #endif //WIN32 { int s = -1; @@ -49,7 +49,7 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p my_addr.sin_addr.s_addr = htonl(0x7f000001); /* use the localhost */ if ((s = socket(AF_INET, SOCK_STREAM, 0)) < 0) { - ERRORA("socket Error\n", SKYPIAX_P_LOG); + ERRORA("socket Error\n", SKYPOPEN_P_LOG); return -1; } @@ -63,33 +63,33 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p my_addr.sin_port = htons(start_port); *which_port = start_port; while (bind(s, (struct sockaddr *) &my_addr, sizeof(struct sockaddr)) < 0) { - DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, + DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPOPEN_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port); - DEBUGA_SKYPE("bind errno=%d, error: %s\n", SKYPIAX_P_LOG, errno, strerror(errno)); + DEBUGA_SKYPE("bind errno=%d, error: %s\n", SKYPOPEN_P_LOG, errno, strerror(errno)); start_port++; my_addr.sin_port = htons(start_port); *which_port = start_port; - DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, + DEBUGA_SKYPE("*which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPOPEN_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port); if (start_port > 65000) { - ERRORA("NO MORE PORTS! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, + ERRORA("NO MORE PORTS! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPOPEN_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port); return -1; } } - DEBUGA_SKYPE("Binded! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPIAX_P_LOG, *which_port, tech_pvt->tcp_cli_port, + DEBUGA_SKYPE("Binded! *which_port=%d, tech_pvt->tcp_cli_port=%d, tech_pvt->tcp_srv_port=%d\n", SKYPOPEN_P_LOG, *which_port, tech_pvt->tcp_cli_port, tech_pvt->tcp_srv_port); sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("1 SO_RCVBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("1 SO_RCVBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("1 SO_SNDBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("1 SO_SNDBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); @@ -108,7 +108,7 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("2 SO_RCVBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("2 SO_RCVBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); /* for virtual machines, eg: Linux domU-12-31-39-02-68-28 2.6.18-xenU-ec2-v1.0 #2 SMP Tue Feb 19 10:51:53 EST 2008 i686 athlon i386 GNU/Linux * use: @@ -125,16 +125,16 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("2 SO_SNDBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("2 SO_SNDBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); flag = 0; getsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, &size); - DEBUGA_SKYPE("TCP_NODELAY is %d\n", SKYPIAX_P_LOG, flag); + DEBUGA_SKYPE("TCP_NODELAY is %d\n", SKYPOPEN_P_LOG, flag); flag = 1; setsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, size); flag = 0; getsockopt(s, IPPROTO_TCP, TCP_NODELAY, (char *) &flag, &size); - DEBUGA_SKYPE("TCP_NODELAY is %d\n", SKYPIAX_P_LOG, flag); + DEBUGA_SKYPE("TCP_NODELAY is %d\n", SKYPOPEN_P_LOG, flag); @@ -142,7 +142,7 @@ int skypiax_socket_create_and_bind(private_t * tech_pvt, unsigned short *which_p return s; } -int skypiax_signaling_read(private_t * tech_pvt) +int skypopen_signaling_read(private_t * tech_pvt) { char read_from_pipe[4096]; char message[4096]; @@ -157,7 +157,7 @@ int skypiax_signaling_read(private_t * tech_pvt) memset(message, 0, 4096); memset(message_2, 0, 4096); - howmany = skypiax_pipe_read(tech_pvt->SkypiaxHandles.fdesc[0], (short *) read_from_pipe, sizeof(read_from_pipe)); + howmany = skypopen_pipe_read(tech_pvt->SkypopenHandles.fdesc[0], (short *) read_from_pipe, sizeof(read_from_pipe)); a = 0; for (i = 0; i < howmany; i++) { @@ -167,35 +167,35 @@ int skypiax_signaling_read(private_t * tech_pvt) if (read_from_pipe[i] == '\0') { //if (!strstr(message, "DURATION")) { - DEBUGA_SKYPE("READING: |||%s||| \n", SKYPIAX_P_LOG, message); + DEBUGA_SKYPE("READING: |||%s||| \n", SKYPOPEN_P_LOG, message); //} if (!strcasecmp(message, "SILENT_MODE OFF")) { if (tech_pvt->silent_mode) { - DEBUGA_SKYPE("Resetting SILENT_MODE on skype_call: %s.\n", SKYPIAX_P_LOG, id); - skypiax_signaling_write(tech_pvt, "SET SILENT_MODE ON"); + DEBUGA_SKYPE("Resetting SILENT_MODE on skype_call: %s.\n", SKYPOPEN_P_LOG, id); + skypopen_signaling_write(tech_pvt, "SET SILENT_MODE ON"); switch_sleep(1000); } } if (!strcasecmp(message, "ERROR 68")) { DEBUGA_SKYPE - ("If I don't connect immediately, please give the Skype client authorization to be connected by Skypiax (and to not ask you again)\n", - SKYPIAX_P_LOG); - skypiax_sleep(1000000); - skypiax_signaling_write(tech_pvt, "PROTOCOL 7"); - skypiax_sleep(10000); + ("If I don't connect immediately, please give the Skype client authorization to be connected by Skypopen (and to not ask you again)\n", + SKYPOPEN_P_LOG); + skypopen_sleep(1000000); + skypopen_signaling_write(tech_pvt, "PROTOCOL 7"); + skypopen_sleep(10000); return 0; } if (!strncasecmp(message, "ERROR 92 CALL", 12)) { - ERRORA("Skype got ERROR: |||%s|||, the (skypeout) number we called was not recognized as valid\n", SKYPIAX_P_LOG, message); + ERRORA("Skype got ERROR: |||%s|||, the (skypeout) number we called was not recognized as valid\n", SKYPOPEN_P_LOG, message); tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED; - DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("skype_call now is DOWN\n", SKYPOPEN_P_LOG); tech_pvt->skype_call_id[0] = '\0'; - if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + if (tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) { + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; return CALLFLOW_INCOMING_HANGUP; } else { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; } } @@ -203,96 +203,96 @@ int skypiax_signaling_read(private_t * tech_pvt) if (!strncasecmp(message, "ERROR 96 CALL", 12)) { DEBUGA_SKYPE ("Skype got ERROR: |||%s|||, we are trying to use this interface to make or receive a call, but another call is half-active on this interface. Let's the previous one to continue.\n", - SKYPIAX_P_LOG, message); + SKYPOPEN_P_LOG, message); } else if (!strncasecmp(message, "ERROR 99 CALL", 12)) { - ERRORA("Skype got ERROR: |||%s|||, another call is active on this interface\n\n\n", SKYPIAX_P_LOG, message); - tech_pvt->interface_state = SKYPIAX_STATE_ERROR_DOUBLE_CALL; + ERRORA("Skype got ERROR: |||%s|||, another call is active on this interface\n\n\n", SKYPOPEN_P_LOG, message); + tech_pvt->interface_state = SKYPOPEN_STATE_ERROR_DOUBLE_CALL; } else if (!strncasecmp(message, "ERROR 592 ALTER CALL", 19)) { - ERRORA("Skype got ERROR about TRANSFERRING, no problem: |||%s|||\n", SKYPIAX_P_LOG, message); + ERRORA("Skype got ERROR about TRANSFERRING, no problem: |||%s|||\n", SKYPOPEN_P_LOG, message); } else if (!strncasecmp(message, "ERROR 559 CALL", 13)) { - if (tech_pvt->interface_state == SKYPIAX_STATE_PREANSWER) { - DEBUGA_SKYPE("Skype got ERROR about a failed action (probably TRYING to ANSWER A CALL), let's go down: |||%s|||\n", SKYPIAX_P_LOG, + if (tech_pvt->interface_state == SKYPOPEN_STATE_PREANSWER) { + DEBUGA_SKYPE("Skype got ERROR about a failed action (probably TRYING to ANSWER A CALL), let's go down: |||%s|||\n", SKYPOPEN_P_LOG, message); tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED; - ERRORA("skype_call now is DOWN\n", SKYPIAX_P_LOG); + ERRORA("skype_call now is DOWN\n", SKYPOPEN_P_LOG); tech_pvt->skype_call_id[0] = '\0'; - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; return CALLFLOW_INCOMING_HANGUP; } else { - DEBUGA_SKYPE("Skype got ERROR about a failed action (probably TRYING to HANGUP A CALL), no problem: |||%s|||\n", SKYPIAX_P_LOG, + DEBUGA_SKYPE("Skype got ERROR about a failed action (probably TRYING to HANGUP A CALL), no problem: |||%s|||\n", SKYPOPEN_P_LOG, message); } } else { - ERRORA("Skype got ERROR: |||%s|||\n", SKYPIAX_P_LOG, message); + ERRORA("Skype got ERROR: |||%s|||\n", SKYPOPEN_P_LOG, message); tech_pvt->skype_callflow = CALLFLOW_STATUS_FINISHED; - ERRORA("skype_call now is DOWN\n", SKYPIAX_P_LOG); + ERRORA("skype_call now is DOWN\n", SKYPOPEN_P_LOG); tech_pvt->skype_call_id[0] = '\0'; - if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + if (tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) { + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; return CALLFLOW_INCOMING_HANGUP; } else { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; } } } - skypiax_strncpy(message_2, message, sizeof(message) - 1); + skypopen_strncpy(message_2, message, sizeof(message) - 1); buf = message; stringp = &buf; where = strsep(stringp, " "); if (!where) { - WARNINGA("Skype MSG without spaces: %s\n", SKYPIAX_P_LOG, message); + WARNINGA("Skype MSG without spaces: %s\n", SKYPOPEN_P_LOG, message); } if (!strcasecmp(message, "CURRENTUSERHANDLE")) { - skypiax_strncpy(obj, where, sizeof(obj) - 1); + skypopen_strncpy(obj, where, sizeof(obj) - 1); where = strsep(stringp, " "); - skypiax_strncpy(id, where, sizeof(id) - 1); + skypopen_strncpy(id, where, sizeof(id) - 1); if (!strcasecmp(id, tech_pvt->skype_user)) { - tech_pvt->SkypiaxHandles.currentuserhandle = 1; + tech_pvt->SkypopenHandles.currentuserhandle = 1; DEBUGA_SKYPE ("Skype MSG: message: %s, currentuserhandle: %s, cuh: %s, skype_user: %s!\n", - SKYPIAX_P_LOG, message, obj, id, tech_pvt->skype_user); + SKYPOPEN_P_LOG, message, obj, id, tech_pvt->skype_user); } } if (!strcasecmp(message, "USER")) { - skypiax_strncpy(obj, where, sizeof(obj) - 1); + skypopen_strncpy(obj, where, sizeof(obj) - 1); where = strsep(stringp, " "); - skypiax_strncpy(id, where, sizeof(id) - 1); + skypopen_strncpy(id, where, sizeof(id) - 1); where = strsep(stringp, " "); - skypiax_strncpy(prop, where, sizeof(prop) - 1); + skypopen_strncpy(prop, where, sizeof(prop) - 1); if (!strcasecmp(prop, "RECEIVEDAUTHREQUEST")) { char msg_to_skype[256]; - DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, message, obj, id, prop); + DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s!\n", SKYPOPEN_P_LOG, message, obj, id, prop); //TODO: allow authorization based on config param sprintf(msg_to_skype, "SET USER %s ISAUTHORIZED TRUE", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } } if (!strcasecmp(message, "MESSAGE")) { - skypiax_strncpy(obj, where, sizeof(obj) - 1); + skypopen_strncpy(obj, where, sizeof(obj) - 1); where = strsep(stringp, " "); - skypiax_strncpy(id, where, sizeof(id) - 1); + skypopen_strncpy(id, where, sizeof(id) - 1); where = strsep(stringp, " "); - skypiax_strncpy(prop, where, sizeof(prop) - 1); + skypopen_strncpy(prop, where, sizeof(prop) - 1); if (!strcasecmp(prop, "STATUS")) { where = strsep(stringp, " "); - skypiax_strncpy(value, where, sizeof(value) - 1); + skypopen_strncpy(value, where, sizeof(value) - 1); if (!strcasecmp(value, "RECEIVED")) { char msg_to_skype[256]; - DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s value: %s!\n", SKYPIAX_P_LOG, message, obj, id, prop, value); + DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s value: %s!\n", SKYPOPEN_P_LOG, message, obj, id, prop, value); //TODO: authomatically flag messages as read based on config param sprintf(msg_to_skype, "SET MESSAGE %s SEEN", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } } else if (!strcasecmp(prop, "BODY")) { char msg_to_skype[256]; - DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s!\n", SKYPIAX_P_LOG, message, obj, id, prop); + DEBUGA_SKYPE("Skype MSG: message: %s, obj: %s, id: %s, prop: %s!\n", SKYPOPEN_P_LOG, message, obj, id, prop); //TODO: authomatically flag messages as read based on config param sprintf(msg_to_skype, "SET MESSAGE %s SEEN", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } } if (!strcasecmp(message, "CHAT")) { @@ -300,21 +300,21 @@ int skypiax_signaling_read(private_t * tech_pvt) int i; int found; - skypiax_strncpy(obj, where, sizeof(obj) - 1); + skypopen_strncpy(obj, where, sizeof(obj) - 1); where = strsep(stringp, " "); - skypiax_strncpy(id, where, sizeof(id) - 1); + skypopen_strncpy(id, where, sizeof(id) - 1); where = strsep(stringp, " "); - skypiax_strncpy(prop, where, sizeof(prop) - 1); - skypiax_strncpy(value, *stringp, sizeof(value) - 1); + skypopen_strncpy(prop, where, sizeof(prop) - 1); + skypopen_strncpy(value, *stringp, sizeof(value) - 1); if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "DIALOG")) { - DEBUGA_SKYPE("CHAT %s is DIALOG\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("CHAT %s is DIALOG\n", SKYPOPEN_P_LOG, id); sprintf(msg_to_skype, "GET CHAT %s DIALOG_PARTNER", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } if (!strcasecmp(prop, "DIALOG_PARTNER")) { - DEBUGA_SKYPE("CHAT %s has DIALOG_PARTNER %s\n", SKYPIAX_P_LOG, id, value); + DEBUGA_SKYPE("CHAT %s has DIALOG_PARTNER %s\n", SKYPOPEN_P_LOG, id, value); found = 0; for (i = 0; i < MAX_CHATS; i++) { if (strlen(tech_pvt->chats[i].chatname) == 0 || !strcmp(tech_pvt->chats[i].chatname, id)) { @@ -325,10 +325,10 @@ int skypiax_signaling_read(private_t * tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why we do not have a chats slot free? we have more than %d chats in parallel?\n", SKYPIAX_P_LOG, MAX_CHATS); + DEBUGA_SKYPE("why we do not have a chats slot free? we have more than %d chats in parallel?\n", SKYPOPEN_P_LOG, MAX_CHATS); } - DEBUGA_SKYPE("CHAT %s is in position %d in the chats array, chatname=%s, dialog_partner=%s\n", SKYPIAX_P_LOG, id, i, + DEBUGA_SKYPE("CHAT %s is in position %d in the chats array, chatname=%s, dialog_partner=%s\n", SKYPOPEN_P_LOG, id, i, tech_pvt->chats[i].chatname, tech_pvt->chats[i].dialog_partner); } @@ -340,21 +340,21 @@ int skypiax_signaling_read(private_t * tech_pvt) int i; int found; - skypiax_strncpy(obj, where, sizeof(obj) - 1); + skypopen_strncpy(obj, where, sizeof(obj) - 1); where = strsep(stringp, " "); - skypiax_strncpy(id, where, sizeof(id) - 1); + skypopen_strncpy(id, where, sizeof(id) - 1); where = strsep(stringp, " "); - skypiax_strncpy(prop, where, sizeof(prop) - 1); - skypiax_strncpy(value, *stringp, sizeof(value) - 1); + skypopen_strncpy(prop, where, sizeof(prop) - 1); + skypopen_strncpy(value, *stringp, sizeof(value) - 1); if (!strcasecmp(prop, "STATUS") && !strcasecmp(value, "RECEIVED")) { - DEBUGA_SKYPE("RECEIVED CHATMESSAGE %s, let's see which type it is\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("RECEIVED CHATMESSAGE %s, let's see which type it is\n", SKYPOPEN_P_LOG, id); sprintf(msg_to_skype, "GET CHATMESSAGE %s TYPE", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } if (!strcasecmp(prop, "TYPE") && !strcasecmp(value, "SAID")) { - DEBUGA_SKYPE("CHATMESSAGE %s is of type SAID, let's get the other infos\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("CHATMESSAGE %s is of type SAID, let's get the other infos\n", SKYPOPEN_P_LOG, id); found = 0; for (i = 0; i < MAX_CHATMESSAGES; i++) { if (strlen(tech_pvt->chatmessages[i].id) == 0) { @@ -365,27 +365,27 @@ int skypiax_signaling_read(private_t * tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why we do not have a chatmessages slot free? we have more than %d chatmessages in parallel?\n", SKYPIAX_P_LOG, + DEBUGA_SKYPE("why we do not have a chatmessages slot free? we have more than %d chatmessages in parallel?\n", SKYPOPEN_P_LOG, MAX_CHATMESSAGES); } else { - DEBUGA_SKYPE("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s\n", SKYPIAX_P_LOG, id, i, + DEBUGA_SKYPE("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s\n", SKYPOPEN_P_LOG, id, i, tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id); sprintf(msg_to_skype, "GET CHATMESSAGE %s CHATNAME", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(1000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(1000); sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_HANDLE", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(1000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(1000); sprintf(msg_to_skype, "GET CHATMESSAGE %s FROM_DISPNAME", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(1000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(1000); sprintf(msg_to_skype, "GET CHATMESSAGE %s BODY", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } } if (!strcasecmp(prop, "CHATNAME")) { - DEBUGA_SKYPE("CHATMESSAGE %s belongs to the CHAT %s\n", SKYPIAX_P_LOG, id, value); + DEBUGA_SKYPE("CHATMESSAGE %s belongs to the CHAT %s\n", SKYPOPEN_P_LOG, id, value); found = 0; for (i = 0; i < MAX_CHATMESSAGES; i++) { if (!strcmp(tech_pvt->chatmessages[i].id, id)) { @@ -395,11 +395,11 @@ int skypiax_signaling_read(private_t * tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); } } if (!strcasecmp(prop, "FROM_HANDLE")) { - DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_HANDLE %s\n", SKYPIAX_P_LOG, id, value); + DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_HANDLE %s\n", SKYPOPEN_P_LOG, id, value); found = 0; for (i = 0; i < MAX_CHATMESSAGES; i++) { if (!strcmp(tech_pvt->chatmessages[i].id, id)) { @@ -409,12 +409,12 @@ int skypiax_signaling_read(private_t * tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); } } if (!strcasecmp(prop, "FROM_DISPNAME")) { - DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_DISPNAME %s\n", SKYPIAX_P_LOG, id, value); + DEBUGA_SKYPE("CHATMESSAGE %s was sent by FROM_DISPNAME %s\n", SKYPOPEN_P_LOG, id, value); found = 0; for (i = 0; i < MAX_CHATMESSAGES; i++) { if (!strcmp(tech_pvt->chatmessages[i].id, id)) { @@ -424,12 +424,12 @@ int skypiax_signaling_read(private_t * tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); } } if (!strcasecmp(prop, "BODY")) { - DEBUGA_SKYPE("CHATMESSAGE %s has BODY %s\n", SKYPIAX_P_LOG, id, value); + DEBUGA_SKYPE("CHATMESSAGE %s has BODY %s\n", SKYPOPEN_P_LOG, id, value); found = 0; for (i = 0; i < MAX_CHATMESSAGES; i++) { if (!strcmp(tech_pvt->chatmessages[i].id, id)) { @@ -439,11 +439,11 @@ int skypiax_signaling_read(private_t * tech_pvt) } } if (!found) { - DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("why chatmessage %s was not found in the chatmessages array??\n", SKYPOPEN_P_LOG, id); } else { DEBUGA_SKYPE ("CHATMESSAGE %s is in position %d in the chatmessages array, type=%s, id=%s, chatname=%s, from_handle=%s, from_dispname=%s, body=%s\n", - SKYPIAX_P_LOG, id, i, tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id, tech_pvt->chatmessages[i].chatname, + SKYPOPEN_P_LOG, id, i, tech_pvt->chatmessages[i].type, tech_pvt->chatmessages[i].id, tech_pvt->chatmessages[i].chatname, tech_pvt->chatmessages[i].from_handle, tech_pvt->chatmessages[i].from_dispname, tech_pvt->chatmessages[i].body); if (strcmp(tech_pvt->chatmessages[i].from_handle, tech_pvt->skype_user)) { //if the message was not sent by myself incoming_chatmessage(tech_pvt, i); @@ -456,33 +456,33 @@ int skypiax_signaling_read(private_t * tech_pvt) if (!strcasecmp(message, "CALL")) { - skypiax_strncpy(obj, where, sizeof(obj) - 1); + skypopen_strncpy(obj, where, sizeof(obj) - 1); where = strsep(stringp, " "); - skypiax_strncpy(id, where, sizeof(id) - 1); + skypopen_strncpy(id, where, sizeof(id) - 1); where = strsep(stringp, " "); - skypiax_strncpy(prop, where, sizeof(prop) - 1); + skypopen_strncpy(prop, where, sizeof(prop) - 1); where = strsep(stringp, " "); - skypiax_strncpy(value, where, sizeof(value) - 1); + skypopen_strncpy(value, where, sizeof(value) - 1); where = strsep(stringp, " "); //DEBUGA_SKYPE //("Skype MSG: message: %s, obj: %s, id: %s, prop: %s, value: %s,where: %s!\n", - //SKYPIAX_P_LOG, message, obj, id, prop, value, where ? where : "NULL"); + //SKYPOPEN_P_LOG, message, obj, id, prop, value, where ? where : "NULL"); if (!strcasecmp(prop, "PARTNER_HANDLE")) { - if (tech_pvt->interface_state != SKYPIAX_STATE_SELECTED && (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str))) { + if (tech_pvt->interface_state != SKYPOPEN_STATE_SELECTED && (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str))) { /* we are NOT inside an active call */ - DEBUGA_SKYPE("Call %s TRY ANSWER\n", SKYPIAX_P_LOG, id); - skypiax_answer(tech_pvt, id, value); + DEBUGA_SKYPE("Call %s TRY ANSWER\n", SKYPOPEN_P_LOG, id); + skypopen_answer(tech_pvt, id, value); } else { /* we are inside an active call */ if (!strcasecmp(tech_pvt->skype_call_id, id)) { /* this is the call in which we are calling out */ - DEBUGA_SKYPE("Call %s DO NOTHING\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("Call %s DO NOTHING\n", SKYPOPEN_P_LOG, id); } else { - skypiax_sleep(400000); //0.4 seconds - DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPIAX_P_LOG, id); - skypiax_transfer(tech_pvt, id, value); + skypopen_sleep(400000); //0.4 seconds + DEBUGA_SKYPE("Call %s TRY TRANSFER\n", SKYPOPEN_P_LOG, id); + skypopen_transfer(tech_pvt, id, value); } } } @@ -492,14 +492,14 @@ int skypiax_signaling_read(private_t * tech_pvt) if (!strcasecmp(prop, "CONF_ID") && !strcasecmp(value, "0")) { } if (!strcasecmp(prop, "CONF_ID") && strcasecmp(value, "0")) { - DEBUGA_SKYPE("the skype_call %s is a conference call\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("the skype_call %s is a conference call\n", SKYPOPEN_P_LOG, id); } if (!strcasecmp(prop, "DTMF")) { - DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPIAX_P_LOG, id, value); + DEBUGA_SKYPE("Call %s received a DTMF: %s\n", SKYPOPEN_P_LOG, id, value); dtmf_received(tech_pvt, value); } if (!strcasecmp(prop, "FAILUREREASON")) { - DEBUGA_SKYPE("Skype FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("Skype FAILED on skype_call %s. Let's wait for the FAILED message.\n", SKYPOPEN_P_LOG, id); } if (!strcasecmp(prop, "DURATION")) { /* each 20 seconds, we zero the buffers and sync the timers */ if (!((atoi(value) % 20))) { @@ -520,220 +520,220 @@ int skypiax_signaling_read(private_t * tech_pvt) } switch_mutex_unlock(tech_pvt->mutex_audio_cli); } - DEBUGA_SKYPE("Synching audio on skype_call: %s.\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("Synching audio on skype_call: %s.\n", SKYPOPEN_P_LOG, id); } } if (!strcasecmp(prop, "DURATION") && (!strcasecmp(value, "1"))) { if (strcasecmp(id, tech_pvt->skype_call_id)) { - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - DEBUGA_SKYPE("We called a Skype contact and he answered us on skype_call: %s.\n", SKYPIAX_P_LOG, id); + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + DEBUGA_SKYPE("We called a Skype contact and he answered us on skype_call: %s.\n", SKYPOPEN_P_LOG, id); } } - if (!strcasecmp(prop, "DURATION") && (tech_pvt->interface_state == SKYPIAX_STATE_ERROR_DOUBLE_CALL)) { + if (!strcasecmp(prop, "DURATION") && (tech_pvt->interface_state == SKYPOPEN_STATE_ERROR_DOUBLE_CALL)) { char msg_to_skype[1024]; - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - ERRORA("We are in a double call situation, trying to get out hanging up call id: %s.\n", SKYPIAX_P_LOG, id); + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + ERRORA("We are in a double call situation, trying to get out hanging up call id: %s.\n", SKYPOPEN_P_LOG, id); sprintf(msg_to_skype, "ALTER CALL %s HANGUP", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(10000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(10000); } if (!strcasecmp(prop, "STATUS")) { if (!strcasecmp(value, "RINGING")) { char msg_to_skype[1024]; - if ((tech_pvt->interface_state != SKYPIAX_STATE_SELECTED && tech_pvt->interface_state != SKYPIAX_STATE_DIALING) + if ((tech_pvt->interface_state != SKYPOPEN_STATE_SELECTED && tech_pvt->interface_state != SKYPOPEN_STATE_DIALING) && (!strlen(tech_pvt->skype_call_id) || !strlen(tech_pvt->session_uuid_str))) { /* we are NOT inside an active call */ - DEBUGA_SKYPE("NO ACTIVE calls in this moment, skype_call %s is RINGING, to ask PARTNER_HANDLE\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("NO ACTIVE calls in this moment, skype_call %s is RINGING, to ask PARTNER_HANDLE\n", SKYPOPEN_P_LOG, id); sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(10000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(10000); } else { /* we are inside an active call */ if (!strcasecmp(tech_pvt->skype_call_id, id)) { /* this is the call in which we are calling out */ tech_pvt->skype_callflow = CALLFLOW_STATUS_RINGING; - tech_pvt->interface_state = SKYPIAX_STATE_RINGING; - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", SKYPIAX_P_LOG, id); + tech_pvt->interface_state = SKYPOPEN_STATE_RINGING; + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + DEBUGA_SKYPE("Our remote party in skype_call %s is RINGING\n", SKYPOPEN_P_LOG, id); remote_party_is_ringing(tech_pvt); } else { DEBUGA_SKYPE ("We are in another call, but skype_call %s is RINGING on us, let's ask PARTNER_HANDLE, so maybe we'll TRANSFER\n", - SKYPIAX_P_LOG, id); + SKYPOPEN_P_LOG, id); sprintf(msg_to_skype, "GET CALL %s PARTNER_HANDLE", id); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(10000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(10000); } } } else if (!strcasecmp(value, "EARLYMEDIA")) { char msg_to_skype[1024]; tech_pvt->skype_callflow = CALLFLOW_STATUS_EARLYMEDIA; - tech_pvt->interface_state = SKYPIAX_STATE_DIALING; - DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", SKYPIAX_P_LOG, id); + tech_pvt->interface_state = SKYPOPEN_STATE_DIALING; + DEBUGA_SKYPE("Our remote party in skype_call %s is EARLYMEDIA\n", SKYPOPEN_P_LOG, id); if (tech_pvt->tcp_cli_thread == NULL) { - DEBUGA_SKYPE("START start_audio_threads\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("START start_audio_threads\n", SKYPOPEN_P_LOG); if (start_audio_threads(tech_pvt)) { - ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG); + ERRORA("start_audio_threads FAILED\n", SKYPOPEN_P_LOG); return CALLFLOW_INCOMING_HANGUP; } } - skypiax_sleep(1000); + skypopen_sleep(1000); sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); remote_party_is_early_media(tech_pvt); } else if (!strcasecmp(value, "MISSED")) { - DEBUGA_SKYPE("We missed skype_call %s\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("We missed skype_call %s\n", SKYPOPEN_P_LOG, id); } else if (!strcasecmp(value, "FINISHED")) { if (!strcasecmp(tech_pvt->skype_call_id, id)) { - DEBUGA_SKYPE("skype_call %s is MY call, now I'm going DOWN\n", SKYPIAX_P_LOG, id); - if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + DEBUGA_SKYPE("skype_call %s is MY call, now I'm going DOWN\n", SKYPOPEN_P_LOG, id); + if (tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) { return CALLFLOW_INCOMING_HANGUP; } else { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; } } else { - DEBUGA_SKYPE("skype_call %s is NOT MY call, ignoring\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("skype_call %s is NOT MY call, ignoring\n", SKYPOPEN_P_LOG, id); } } else if (!strcasecmp(value, "CANCELLED")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_CANCELLED; - DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now CANCELLED\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now CANCELLED\n", SKYPOPEN_P_LOG, id); tech_pvt->skype_call_id[0] = '\0'; - if (tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + if (tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) { + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; return CALLFLOW_INCOMING_HANGUP; } else { - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; } } else if (!strcasecmp(value, "FAILED")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED; - DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now FAILED\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now FAILED\n", SKYPOPEN_P_LOG, id); tech_pvt->skype_call_id[0] = '\0'; - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; return CALLFLOW_INCOMING_HANGUP; } else if (!strcasecmp(value, "REFUSED")) { if (!strcasecmp(id, tech_pvt->skype_call_id)) { /* this is the id of the call we are in, probably we generated it */ tech_pvt->skype_callflow = CALLFLOW_STATUS_REFUSED; - DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now REFUSED\n", SKYPIAX_P_LOG, id); - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + DEBUGA_SKYPE("we tried to call Skype on skype_call %s and Skype has now REFUSED\n", SKYPOPEN_P_LOG, id); + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; tech_pvt->skype_call_id[0] = '\0'; return CALLFLOW_INCOMING_HANGUP; } else { /* we're here because were us that refused an incoming call */ - DEBUGA_SKYPE("we REFUSED skype_call %s\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("we REFUSED skype_call %s\n", SKYPOPEN_P_LOG, id); } } else if (!strcasecmp(value, "TRANSFERRING")) { - DEBUGA_SKYPE("skype_call %s is transferring\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("skype_call %s is transferring\n", SKYPOPEN_P_LOG, id); } else if (!strcasecmp(value, "TRANSFERRED")) { - DEBUGA_SKYPE("skype_call %s has been transferred\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("skype_call %s has been transferred\n", SKYPOPEN_P_LOG, id); } else if (!strcasecmp(value, "ROUTING")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_ROUTING; - tech_pvt->interface_state = SKYPIAX_STATE_DIALING; - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - DEBUGA_SKYPE("skype_call: %s is now ROUTING\n", SKYPIAX_P_LOG, id); + tech_pvt->interface_state = SKYPOPEN_STATE_DIALING; + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + DEBUGA_SKYPE("skype_call: %s is now ROUTING\n", SKYPOPEN_P_LOG, id); } else if (!strcasecmp(value, "UNPLACED")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_UNPLACED; - tech_pvt->interface_state = SKYPIAX_STATE_DIALING; - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - DEBUGA_SKYPE("skype_call: %s is now UNPLACED\n", SKYPIAX_P_LOG, id); + tech_pvt->interface_state = SKYPOPEN_STATE_DIALING; + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + DEBUGA_SKYPE("skype_call: %s is now UNPLACED\n", SKYPOPEN_P_LOG, id); } else if (!strcasecmp(value, "INPROGRESS")) { char msg_to_skype[1024]; if (!strlen(tech_pvt->session_uuid_str)) { - DEBUGA_SKYPE("no tech_pvt->session_uuid_str\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("no tech_pvt->session_uuid_str\n", SKYPOPEN_P_LOG); } if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) { if (!strlen(tech_pvt->session_uuid_str) || !strlen(tech_pvt->skype_call_id) || !strcasecmp(tech_pvt->skype_call_id, id)) { - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPIAX_P_LOG, id); + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + DEBUGA_SKYPE("skype_call: %s is now active\n", SKYPOPEN_P_LOG, id); if (tech_pvt->skype_callflow != CALLFLOW_STATUS_EARLYMEDIA) { tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS; - tech_pvt->interface_state = SKYPIAX_STATE_UP; + tech_pvt->interface_state = SKYPOPEN_STATE_UP; if (tech_pvt->tcp_cli_thread == NULL) { - DEBUGA_SKYPE("START start_audio_threads\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("START start_audio_threads\n", SKYPOPEN_P_LOG); if (start_audio_threads(tech_pvt)) { - ERRORA("start_audio_threads FAILED\n", SKYPIAX_P_LOG); + ERRORA("start_audio_threads FAILED\n", SKYPOPEN_P_LOG); return CALLFLOW_INCOMING_HANGUP; } } - skypiax_sleep(1000); + skypopen_sleep(1000); sprintf(msg_to_skype, "ALTER CALL %s SET_INPUT PORT=\"%d\"", id, tech_pvt->tcp_cli_port); - skypiax_signaling_write(tech_pvt, msg_to_skype); - skypiax_sleep(1000); + skypopen_signaling_write(tech_pvt, msg_to_skype); + skypopen_sleep(1000); sprintf(msg_to_skype, "#output ALTER CALL %s SET_OUTPUT PORT=\"%d\"", id, tech_pvt->tcp_srv_port); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); } tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS; if (!strlen(tech_pvt->session_uuid_str)) { - DEBUGA_SKYPE("New Inbound Channel!\n\n\n\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("New Inbound Channel!\n\n\n\n", SKYPOPEN_P_LOG); new_inbound_channel(tech_pvt); } else { - tech_pvt->interface_state = SKYPIAX_STATE_UP; - DEBUGA_SKYPE("Outbound Channel Answered! session_uuid_str=%s\n", SKYPIAX_P_LOG, tech_pvt->session_uuid_str); + tech_pvt->interface_state = SKYPOPEN_STATE_UP; + DEBUGA_SKYPE("Outbound Channel Answered! session_uuid_str=%s\n", SKYPOPEN_P_LOG, tech_pvt->session_uuid_str); outbound_channel_answered(tech_pvt); } } else { - DEBUGA_SKYPE("I'm on %s, skype_call %s is NOT MY call, ignoring\n", SKYPIAX_P_LOG, tech_pvt->skype_call_id, id); + DEBUGA_SKYPE("I'm on %s, skype_call %s is NOT MY call, ignoring\n", SKYPOPEN_P_LOG, tech_pvt->skype_call_id, id); } } else { tech_pvt->skype_callflow = CALLFLOW_STATUS_INPROGRESS; - DEBUGA_SKYPE("Back from REMOTEHOLD!\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Back from REMOTEHOLD!\n", SKYPOPEN_P_LOG); } } else if (!strcasecmp(value, "REMOTEHOLD")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_REMOTEHOLD; - DEBUGA_SKYPE("skype_call: %s is now REMOTEHOLD\n", SKYPIAX_P_LOG, id); + DEBUGA_SKYPE("skype_call: %s is now REMOTEHOLD\n", SKYPOPEN_P_LOG, id); } else if (!strcasecmp(value, "BUSY")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED; DEBUGA_SKYPE ("we tried to call Skype on skype_call %s and remote party (destination) was BUSY. Our outbound call has failed\n", - SKYPIAX_P_LOG, id); - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + SKYPOPEN_P_LOG, id); + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; tech_pvt->skype_call_id[0] = '\0'; - skypiax_sleep(1000); + skypopen_sleep(1000); return CALLFLOW_INCOMING_HANGUP; } else if (!strcasecmp(value, "WAITING_REDIAL_COMMAND")) { tech_pvt->skype_callflow = CALLFLOW_STATUS_FAILED; DEBUGA_SKYPE ("we tried to call Skype on skype_call %s and remote party (destination) has rejected us (WAITING_REDIAL_COMMAND). Our outbound call has failed\n", - SKYPIAX_P_LOG, id); - skypiax_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); - tech_pvt->interface_state = SKYPIAX_STATE_DOWN; + SKYPOPEN_P_LOG, id); + skypopen_strncpy(tech_pvt->skype_call_id, id, sizeof(tech_pvt->skype_call_id) - 1); + tech_pvt->interface_state = SKYPOPEN_STATE_DOWN; tech_pvt->skype_call_id[0] = '\0'; - skypiax_sleep(1000); + skypopen_sleep(1000); return CALLFLOW_INCOMING_HANGUP; } else { - WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPIAX_P_LOG, id, value); + WARNINGA("skype_call: %s, STATUS: %s is not recognized\n", SKYPOPEN_P_LOG, id, value); } } //STATUS } //CALL /* the "numbered" messages that follows are used by the directory application, not yet ported */ if (!strcasecmp(message, "#333")) { memset(tech_pvt->skype_friends, 0, 4096); - skypiax_strncpy(tech_pvt->skype_friends, &message_2[11], 4095); + skypopen_strncpy(tech_pvt->skype_friends, &message_2[11], 4095); } if (!strcasecmp(message, "#222")) { memset(tech_pvt->skype_fullname, 0, 512); - skypiax_strncpy(tech_pvt->skype_fullname, &message_2[10], 511); + skypopen_strncpy(tech_pvt->skype_fullname, &message_2[10], 511); } if (!strcasecmp(message, "#765")) { memset(tech_pvt->skype_displayname, 0, 512); - skypiax_strncpy(tech_pvt->skype_displayname, &message_2[10], 511); + skypopen_strncpy(tech_pvt->skype_displayname, &message_2[10], 511); } a = 0; } //message end @@ -741,7 +741,7 @@ int skypiax_signaling_read(private_t * tech_pvt) return 0; } -void *skypiax_do_tcp_srv_thread_func(void *obj) +void *skypopen_do_tcp_srv_thread_func(void *obj) { private_t *tech_pvt = obj; int s; @@ -758,21 +758,21 @@ void *skypiax_do_tcp_srv_thread_func(void *obj) struct sockaddr_in remote_addr; int sockbufsize = 0; - s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port); + s = skypopen_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_srv_port); if (s < 0) { - ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG); + ERRORA("skypopen_socket_create_and_bind error!\n", SKYPOPEN_P_LOG); return NULL; } - DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("started tcp_srv_thread thread.\n", SKYPOPEN_P_LOG); listen(s, 6); sin_size = sizeof(remote_addr); - while (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN + while (tech_pvt && tech_pvt->interface_state != SKYPOPEN_STATE_DOWN && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA - || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { + || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) { unsigned int fdselectgio; int rtgio; @@ -792,24 +792,24 @@ void *skypiax_do_tcp_srv_thread_func(void *obj) if (rtgio) { while (s > 0 && (fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { - DEBUGA_SKYPE("ACCEPTED here I send you %d\n", SKYPIAX_P_LOG, tech_pvt->tcp_srv_port); + DEBUGA_SKYPE("ACCEPTED here I send you %d\n", SKYPOPEN_P_LOG, tech_pvt->tcp_srv_port); sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("3 SO_RCVBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("3 SO_RCVBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("3 SO_SNDBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("3 SO_SNDBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); if (!(running && tech_pvt->running)) break; - while (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN + while (tech_pvt && tech_pvt->interface_state != SKYPOPEN_STATE_DOWN && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA - || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { + || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) { unsigned int fdselect; int rt; @@ -831,17 +831,17 @@ void *skypiax_do_tcp_srv_thread_func(void *obj) if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) { len = recv(fd, (char *) srv_in, 640, 0); } else { - skypiax_sleep(10000); + skypopen_sleep(10000); continue; } if (tech_pvt->begin_to_read == 0) { - DEBUGA_SKYPE("len=%d\n", SKYPIAX_P_LOG, len); - skypiax_sleep(10000); + DEBUGA_SKYPE("len=%d\n", SKYPOPEN_P_LOG, len); + skypopen_sleep(10000); continue; } if (len == -1) { - DEBUGA_SKYPE("len=%d, error: %s\n", SKYPIAX_P_LOG, len, strerror(errno)); + DEBUGA_SKYPE("len=%d, error: %s\n", SKYPOPEN_P_LOG, len, strerror(errno)); break; } nospace = 0; @@ -855,41 +855,41 @@ void *skypiax_do_tcp_srv_thread_func(void *obj) switch_buffer_write(tech_pvt->read_buffer, srv_in, len); switch_mutex_unlock(tech_pvt->mutex_audio_srv); if (nospace) { - DEBUGA_SKYPE("NO SPACE READ: there was no space for: %d\n", SKYPIAX_P_LOG, len); + DEBUGA_SKYPE("NO SPACE READ: there was no space for: %d\n", SKYPOPEN_P_LOG, len); } } else if (len == 0) { - DEBUGA_SKYPE("CLOSED\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("CLOSED\n", SKYPOPEN_P_LOG); break; } else { - DEBUGA_SKYPE("len=%d\n", SKYPIAX_P_LOG, len); + DEBUGA_SKYPE("len=%d\n", SKYPOPEN_P_LOG, len); } } else if (rt == 0) { continue; } else { - DEBUGA_SKYPE("SRV rt=%d\n", SKYPIAX_P_LOG, rt); + DEBUGA_SKYPE("SRV rt=%d\n", SKYPOPEN_P_LOG, rt); break; } } - DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Skype incoming audio GONE\n", SKYPOPEN_P_LOG); tech_pvt->skype_callflow = CALLFLOW_INCOMING_HANGUP; - skypiax_close_socket(fd); + skypopen_close_socket(fd); break; } break; } } - DEBUGA_SKYPE("incoming audio (read) server (I am it) EXITING\n", SKYPIAX_P_LOG); - skypiax_close_socket(s); + DEBUGA_SKYPE("incoming audio (read) server (I am it) EXITING\n", SKYPOPEN_P_LOG); + skypopen_close_socket(s); s = -1; tech_pvt->tcp_srv_thread = NULL; return NULL; } -void *skypiax_do_tcp_cli_thread_func(void *obj) +void *skypopen_do_tcp_cli_thread_func(void *obj) { private_t *tech_pvt = obj; int s; @@ -906,24 +906,24 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) #endif /* WIN32 */ int sockbufsize = 0; - s = skypiax_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port); + s = skypopen_socket_create_and_bind(tech_pvt, &tech_pvt->tcp_cli_port); if (s < 0) { - ERRORA("skypiax_socket_create_and_bind error!\n", SKYPIAX_P_LOG); + ERRORA("skypopen_socket_create_and_bind error!\n", SKYPOPEN_P_LOG); return NULL; } - DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("started tcp_cli_thread thread.\n", SKYPOPEN_P_LOG); listen(s, 6); sin_size = sizeof(remote_addr); - while (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN + while (tech_pvt && tech_pvt->interface_state != SKYPOPEN_STATE_DOWN && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA - || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { + || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) { unsigned int fdselectgio; int rtgio; @@ -943,32 +943,32 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) if (rtgio) { while (s > 0 && (fd = accept(s, (struct sockaddr *) &remote_addr, &sin_size)) > 0) { - DEBUGA_SKYPE("ACCEPTED here you send me %d\n", SKYPIAX_P_LOG, tech_pvt->tcp_cli_port); + DEBUGA_SKYPE("ACCEPTED here you send me %d\n", SKYPOPEN_P_LOG, tech_pvt->tcp_cli_port); sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_RCVBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("4 SO_RCVBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("4 SO_RCVBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); sockbufsize = 0; size = sizeof(int); getsockopt(s, SOL_SOCKET, SO_SNDBUF, (char *) &sockbufsize, &size); - DEBUGA_SKYPE("4 SO_SNDBUF is %d, size is %d\n", SKYPIAX_P_LOG, sockbufsize, size); + DEBUGA_SKYPE("4 SO_SNDBUF is %d, size is %d\n", SKYPOPEN_P_LOG, sockbufsize, size); if (!(running && tech_pvt->running)) break; - while (tech_pvt && tech_pvt->interface_state != SKYPIAX_STATE_DOWN + while (tech_pvt && tech_pvt->interface_state != SKYPOPEN_STATE_DOWN && (tech_pvt->skype_callflow == CALLFLOW_STATUS_INPROGRESS || tech_pvt->skype_callflow == CALLFLOW_STATUS_EARLYMEDIA - || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPIAX_STATE_UP)) { + || tech_pvt->skype_callflow == CALLFLOW_STATUS_REMOTEHOLD || tech_pvt->skype_callflow == SKYPOPEN_STATE_UP)) { size_t bytes_to_write; if (!(running && tech_pvt->running)) break; if (tech_pvt->timer_write.timer_interface && tech_pvt->timer_write.timer_interface->timer_next - && tech_pvt->interface_state != SKYPIAX_STATE_HANGUP_REQUESTED) { + && tech_pvt->interface_state != SKYPOPEN_STATE_HANGUP_REQUESTED) { switch_core_timer_next(&tech_pvt->timer_write); } @@ -977,10 +977,10 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) bytes_to_write = 640; len = send(fd, (char *) cli_out, bytes_to_write, 0); if (len == -1) { - DEBUGA_SKYPE("len=%d, error: %s\n", SKYPIAX_P_LOG, len, strerror(errno)); + DEBUGA_SKYPE("len=%d, error: %s\n", SKYPOPEN_P_LOG, len, strerror(errno)); break; } - skypiax_sleep(10000); + skypopen_sleep(10000); continue; } else { @@ -999,7 +999,7 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) if(tech_pvt->write_silence_when_idle){ memset(cli_out, 255, sizeof(cli_out)); bytes_to_write = 640; - //DEBUGA_SKYPE("WRITE Silence!\n", SKYPIAX_P_LOG); + //DEBUGA_SKYPE("WRITE Silence!\n", SKYPOPEN_P_LOG); }else{ continue; } @@ -1008,52 +1008,52 @@ void *skypiax_do_tcp_cli_thread_func(void *obj) if (tech_pvt->skype_callflow != CALLFLOW_STATUS_REMOTEHOLD) { len = send(fd, (char *) cli_out, bytes_to_write, 0); if (len == -1) { - DEBUGA_SKYPE("len=%d, error: %s\n", SKYPIAX_P_LOG, len, strerror(errno)); + DEBUGA_SKYPE("len=%d, error: %s\n", SKYPOPEN_P_LOG, len, strerror(errno)); break; } if (len != bytes_to_write) { - DEBUGA_SKYPE("len=%d\n", SKYPIAX_P_LOG, len); + DEBUGA_SKYPE("len=%d\n", SKYPOPEN_P_LOG, len); } } } } - DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("Skype outbound audio GONE\n", SKYPOPEN_P_LOG); tech_pvt->skype_callflow = CALLFLOW_INCOMING_HANGUP; - skypiax_close_socket(fd); + skypopen_close_socket(fd); break; } break; } } - DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPIAX_P_LOG); - skypiax_close_socket(s); + DEBUGA_SKYPE("outbound audio server (I am it) EXITING\n", SKYPOPEN_P_LOG); + skypopen_close_socket(s); s = -1; tech_pvt->tcp_cli_thread = NULL; return NULL; } -int skypiax_senddigit(private_t * tech_pvt, char digit) +int skypopen_senddigit(private_t * tech_pvt, char digit) { char msg_to_skype[1024]; - DEBUGA_SKYPE("DIGIT received: %c\n", SKYPIAX_P_LOG, digit); + DEBUGA_SKYPE("DIGIT received: %c\n", SKYPOPEN_P_LOG, digit); sprintf(msg_to_skype, "SET CALL %s DTMF %c", tech_pvt->skype_call_id, digit); - skypiax_signaling_write(tech_pvt, msg_to_skype); + skypopen_signaling_write(tech_pvt, msg_to_skype); return 0; } -int skypiax_call(private_t * tech_pvt, char *rdest, int timeout) +int skypopen_call(private_t * tech_pvt, char *rdest, int timeout) { char msg_to_skype[1024]; - DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPIAX_P_LOG, rdest); + DEBUGA_SKYPE("Calling Skype, rdest is: %s\n", SKYPOPEN_P_LOG, rdest); sprintf(msg_to_skype, "CALL %s", rdest); - if (skypiax_signaling_write(tech_pvt, msg_to_skype) < 0) { - ERRORA("failed to communicate with Skype client, now exit\n", SKYPIAX_P_LOG); + if (skypopen_signaling_write(tech_pvt, msg_to_skype) < 0) { + ERRORA("failed to communicate with Skype client, now exit\n", SKYPOPEN_P_LOG); return -1; } return 0; @@ -1063,7 +1063,7 @@ int skypiax_call(private_t * tech_pvt, char *rdest, int timeout) /* PLATFORM SPECIFIC */ /***************************/ #if defined(WIN32) && !defined(__CYGWIN__) -int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany) +int skypopen_pipe_read(switch_file_t * pipe, short *buf, int howmany) { switch_size_t quantity; @@ -1076,7 +1076,7 @@ int skypiax_pipe_read(switch_file_t * pipe, short *buf, int howmany) return howmany; } -int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany) +int skypopen_pipe_write(switch_file_t * pipe, short *buf, int howmany) { switch_size_t quantity; @@ -1089,7 +1089,7 @@ int skypiax_pipe_write(switch_file_t * pipe, short *buf, int howmany) return howmany; } -int skypiax_close_socket(unsigned int fd) +int skypopen_close_socket(unsigned int fd) { int res; @@ -1098,21 +1098,21 @@ int skypiax_close_socket(unsigned int fd) return res; } -int skypiax_audio_init(private_t * tech_pvt) +int skypopen_audio_init(private_t * tech_pvt) { switch_status_t rv; - rv = switch_file_pipe_create(&tech_pvt->audiopipe_srv[0], &tech_pvt->audiopipe_srv[1], skypiax_module_pool); - rv = switch_file_pipe_create(&tech_pvt->audiopipe_cli[0], &tech_pvt->audiopipe_cli[1], skypiax_module_pool); + rv = switch_file_pipe_create(&tech_pvt->audiopipe_srv[0], &tech_pvt->audiopipe_srv[1], skypopen_module_pool); + rv = switch_file_pipe_create(&tech_pvt->audiopipe_cli[0], &tech_pvt->audiopipe_cli[1], skypopen_module_pool); return 0; } #else /* WIN32 */ -int skypiax_pipe_read(int pipe, short *buf, int howmany) +int skypopen_pipe_read(int pipe, short *buf, int howmany) { howmany = read(pipe, buf, howmany); return howmany; } -int skypiax_pipe_write(int pipe, short *buf, int howmany) +int skypopen_pipe_write(int pipe, short *buf, int howmany) { if (buf) { howmany = write(pipe, buf, howmany); @@ -1122,7 +1122,7 @@ int skypiax_pipe_write(int pipe, short *buf, int howmany) } } -int skypiax_close_socket(unsigned int fd) +int skypopen_close_socket(unsigned int fd) { int res; @@ -1131,7 +1131,7 @@ int skypiax_close_socket(unsigned int fd) return res; } -int skypiax_audio_init(private_t * tech_pvt) +int skypopen_audio_init(private_t * tech_pvt) { if (pipe(tech_pvt->audiopipe_srv)) { fcntl(tech_pvt->audiopipe_srv[0], F_SETFL, O_NONBLOCK); @@ -1143,7 +1143,7 @@ int skypiax_audio_init(private_t * tech_pvt) } /* this pipe is the audio fd for asterisk to poll on during a call. FS do not use it */ - tech_pvt->skypiax_sound_capt_fd = tech_pvt->audiopipe_srv[0]; + tech_pvt->skypopen_sound_capt_fd = tech_pvt->audiopipe_srv[0]; return 0; } @@ -1194,12 +1194,12 @@ char return res; } -int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype) +int skypopen_signaling_write(private_t * tech_pvt, char *msg_to_skype) { static char acInputRow[1024]; COPYDATASTRUCT oCopyData; - DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype); + DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPOPEN_P_LOG, msg_to_skype); sprintf(acInputRow, "%s", msg_to_skype); /* send command to skype */ @@ -1208,9 +1208,9 @@ int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype) oCopyData.cbData = strlen(acInputRow) + 1; if (oCopyData.cbData != 1) { if (SendMessage - (tech_pvt->SkypiaxHandles.win32_hGlobal_SkypeAPIWindowHandle, WM_COPYDATA, - (WPARAM) tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, (LPARAM) & oCopyData) == FALSE) { - ERRORA("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax, then launch Skypiax and try again.\n", SKYPIAX_P_LOG); + (tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle, WM_COPYDATA, + (WPARAM) tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle, (LPARAM) & oCopyData) == FALSE) { + ERRORA("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypopen, then launch Skypopen and try again.\n", SKYPOPEN_P_LOG); return -1; } } @@ -1219,7 +1219,7 @@ int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype) } -LRESULT APIENTRY skypiax_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam) +LRESULT APIENTRY skypopen_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, LPARAM ulParam) { LRESULT lReturnCode; int fIssueDefProc; @@ -1230,8 +1230,8 @@ LRESULT APIENTRY skypiax_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, L tech_pvt = (private_t *) GetWindowLong(hWindow, GWL_USERDATA); if (!running) { - DEBUGA_SKYPE("let's DIE!\n", SKYPIAX_P_LOG); - tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle = NULL; + DEBUGA_SKYPE("let's DIE!\n", SKYPOPEN_P_LOG); + tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle = NULL; PostQuitMessage(0); return lReturnCode; } @@ -1239,55 +1239,55 @@ LRESULT APIENTRY skypiax_present(HWND hWindow, UINT uiMessage, WPARAM uiParam, L case WM_CREATE: tech_pvt = (private_t *) ((LPCREATESTRUCT) ulParam)->lpCreateParams; SetWindowLong(hWindow, GWL_USERDATA, (LONG) tech_pvt); - DEBUGA_SKYPE("got CREATE\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("got CREATE\n", SKYPOPEN_P_LOG); break; case WM_DESTROY: - DEBUGA_SKYPE("got DESTROY\n", SKYPIAX_P_LOG); - tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle = NULL; + DEBUGA_SKYPE("got DESTROY\n", SKYPOPEN_P_LOG); + tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle = NULL; PostQuitMessage(0); break; case WM_COPYDATA: - if (tech_pvt->SkypiaxHandles.win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { + if (tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle == (HWND) uiParam) { unsigned int howmany; char msg_from_skype[2048]; PCOPYDATASTRUCT poCopyData = (PCOPYDATASTRUCT) ulParam; memset(msg_from_skype, '\0', sizeof(msg_from_skype)); - skypiax_strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) - 2); + skypopen_strncpy(msg_from_skype, (const char *) poCopyData->lpData, sizeof(msg_from_skype) - 2); howmany = strlen(msg_from_skype) + 1; - howmany = skypiax_pipe_write(tech_pvt->SkypiaxHandles.fdesc[1], (short *) msg_from_skype, howmany); + howmany = skypopen_pipe_write(tech_pvt->SkypopenHandles.fdesc[1], (short *) msg_from_skype, howmany); lReturnCode = 1; } break; default: - if (tech_pvt && tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach) { - if (uiMessage == tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach) { + if (tech_pvt && tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach) { + if (uiMessage == tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach) { switch (ulParam) { case SKYPECONTROLAPI_ATTACH_SUCCESS: - if (!tech_pvt->SkypiaxHandles.currentuserhandle) { - //DEBUGA_SKYPE("\n\n\tConnected to Skype API!\n", SKYPIAX_P_LOG); - tech_pvt->SkypiaxHandles.api_connected = 1; - tech_pvt->SkypiaxHandles.win32_hGlobal_SkypeAPIWindowHandle = (HWND) uiParam; - tech_pvt->SkypiaxHandles.win32_hGlobal_SkypeAPIWindowHandle = tech_pvt->SkypiaxHandles.win32_hGlobal_SkypeAPIWindowHandle; + if (!tech_pvt->SkypopenHandles.currentuserhandle) { + //DEBUGA_SKYPE("\n\n\tConnected to Skype API!\n", SKYPOPEN_P_LOG); + tech_pvt->SkypopenHandles.api_connected = 1; + tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle = (HWND) uiParam; + tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle = tech_pvt->SkypopenHandles.win32_hGlobal_SkypeAPIWindowHandle; } break; case SKYPECONTROLAPI_ATTACH_PENDING_AUTHORIZATION: - skypiax_sleep(5000); + skypopen_sleep(5000); break; case SKYPECONTROLAPI_ATTACH_REFUSED: - ERRORA("Skype client refused to be connected by Skypiax!\n", SKYPIAX_P_LOG); + ERRORA("Skype client refused to be connected by Skypopen!\n", SKYPOPEN_P_LOG); break; case SKYPECONTROLAPI_ATTACH_NOT_AVAILABLE: - ERRORA("Skype API not (yet?) available\n", SKYPIAX_P_LOG); + ERRORA("Skype API not (yet?) available\n", SKYPOPEN_P_LOG); break; case SKYPECONTROLAPI_ATTACH_API_AVAILABLE: - DEBUGA_SKYPE("Skype API available\n", SKYPIAX_P_LOG); - skypiax_sleep(5000); + DEBUGA_SKYPE("Skype API available\n", SKYPOPEN_P_LOG); + skypopen_sleep(5000); break; default: - WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPIAX_P_LOG); + WARNINGA("GOT AN UNKNOWN SKYPE WINDOWS MSG\n", SKYPOPEN_P_LOG); } lReturnCode = 1; break; @@ -1310,24 +1310,24 @@ int win32_Initialize_CreateWindowClass(private_t * tech_pvt) fReturnStatus = 0; lUUIDResult = UuidCreate(&oUUID); - tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle = (HINSTANCE) OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId()); - if (tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle != NULL && (lUUIDResult == RPC_S_OK || lUUIDResult == RPC_S_UUID_LOCAL_ONLY)) { + tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle = (HINSTANCE) OpenProcess(PROCESS_DUP_HANDLE, FALSE, GetCurrentProcessId()); + if (tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle != NULL && (lUUIDResult == RPC_S_OK || lUUIDResult == RPC_S_UUID_LOCAL_ONLY)) { if (UuidToString(&oUUID, &paucUUIDString) == RPC_S_OK) { WNDCLASS oWindowClass; - strcpy(tech_pvt->SkypiaxHandles.win32_acInit_WindowClassName, "Skype-API-Skypiax-"); - strcat(tech_pvt->SkypiaxHandles.win32_acInit_WindowClassName, (char *) paucUUIDString); + strcpy(tech_pvt->SkypopenHandles.win32_acInit_WindowClassName, "Skype-API-Skypopen-"); + strcat(tech_pvt->SkypopenHandles.win32_acInit_WindowClassName, (char *) paucUUIDString); oWindowClass.style = CS_HREDRAW | CS_VREDRAW | CS_DBLCLKS; - oWindowClass.lpfnWndProc = (WNDPROC) & skypiax_present; + oWindowClass.lpfnWndProc = (WNDPROC) & skypopen_present; oWindowClass.cbClsExtra = 0; oWindowClass.cbWndExtra = 0; - oWindowClass.hInstance = tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle; + oWindowClass.hInstance = tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle; oWindowClass.hIcon = NULL; oWindowClass.hCursor = NULL; oWindowClass.hbrBackground = NULL; oWindowClass.lpszMenuName = NULL; - oWindowClass.lpszClassName = tech_pvt->SkypiaxHandles.win32_acInit_WindowClassName; + oWindowClass.lpszClassName = tech_pvt->SkypopenHandles.win32_acInit_WindowClassName; if (RegisterClass(&oWindowClass) != 0) fReturnStatus = 1; @@ -1336,63 +1336,63 @@ int win32_Initialize_CreateWindowClass(private_t * tech_pvt) } } if (fReturnStatus == 0) - CloseHandle(tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle); - tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle = NULL; + CloseHandle(tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle); + tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle = NULL; return (fReturnStatus); } void win32_DeInitialize_DestroyWindowClass(private_t * tech_pvt) { - UnregisterClass(tech_pvt->SkypiaxHandles.win32_acInit_WindowClassName, tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle); - CloseHandle(tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle); - tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle = NULL; + UnregisterClass(tech_pvt->SkypopenHandles.win32_acInit_WindowClassName, tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle); + CloseHandle(tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle); + tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle = NULL; } int win32_Initialize_CreateMainWindow(private_t * tech_pvt) { - tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle = + tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle = CreateWindowEx(WS_EX_APPWINDOW | WS_EX_WINDOWEDGE, - tech_pvt->SkypiaxHandles.win32_acInit_WindowClassName, "", + tech_pvt->SkypopenHandles.win32_acInit_WindowClassName, "", WS_BORDER | WS_SYSMENU | WS_MINIMIZEBOX, CW_USEDEFAULT, CW_USEDEFAULT, - 128, 128, NULL, 0, tech_pvt->SkypiaxHandles.win32_hInit_ProcessHandle, tech_pvt); - return (tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle != NULL ? 1 : 0); + 128, 128, NULL, 0, tech_pvt->SkypopenHandles.win32_hInit_ProcessHandle, tech_pvt); + return (tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle != NULL ? 1 : 0); } void win32_DeInitialize_DestroyMainWindow(private_t * tech_pvt) { - if (tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle != NULL) - DestroyWindow(tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle), tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle = NULL; + if (tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle != NULL) + DestroyWindow(tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle), tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle = NULL; } -void *skypiax_do_skypeapi_thread_func(void *obj) +void *skypopen_do_skypeapi_thread_func(void *obj) { private_t *tech_pvt = obj; #if defined(WIN32) && !defined(__CYGWIN__) switch_status_t rv; - switch_file_pipe_create(&tech_pvt->SkypiaxHandles.fdesc[0], &tech_pvt->SkypiaxHandles.fdesc[1], skypiax_module_pool); - rv = switch_file_pipe_create(&tech_pvt->SkypiaxHandles.fdesc[0], &tech_pvt->SkypiaxHandles.fdesc[1], skypiax_module_pool); + switch_file_pipe_create(&tech_pvt->SkypopenHandles.fdesc[0], &tech_pvt->SkypopenHandles.fdesc[1], skypopen_module_pool); + rv = switch_file_pipe_create(&tech_pvt->SkypopenHandles.fdesc[0], &tech_pvt->SkypopenHandles.fdesc[1], skypopen_module_pool); #else /* WIN32 */ - if (pipe(tech_pvt->SkypiaxHandles.fdesc)) { - fcntl(tech_pvt->SkypiaxHandles.fdesc[0], F_SETFL, O_NONBLOCK); - fcntl(tech_pvt->SkypiaxHandles.fdesc[1], F_SETFL, O_NONBLOCK); + if (pipe(tech_pvt->SkypopenHandles.fdesc)) { + fcntl(tech_pvt->SkypopenHandles.fdesc[0], F_SETFL, O_NONBLOCK); + fcntl(tech_pvt->SkypopenHandles.fdesc[1], F_SETFL, O_NONBLOCK); } #endif /* WIN32 */ - tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach = RegisterWindowMessage("SkypeControlAPIAttach"); - tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover = RegisterWindowMessage("SkypeControlAPIDiscover"); + tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach = RegisterWindowMessage("SkypeControlAPIAttach"); + tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover = RegisterWindowMessage("SkypeControlAPIDiscover"); - skypiax_sleep(200000); //0,2 sec + skypopen_sleep(200000); //0,2 sec - if (tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0 - && tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { + if (tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIAttach != 0 + && tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover != 0) { if (win32_Initialize_CreateWindowClass(tech_pvt)) { if (win32_Initialize_CreateMainWindow(tech_pvt)) { if (SendMessage (HWND_BROADCAST, - tech_pvt->SkypiaxHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover, - (WPARAM) tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle, 0) != 0) { - tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle = tech_pvt->SkypiaxHandles.win32_hInit_MainWindowHandle; + tech_pvt->SkypopenHandles.win32_uiGlobal_MsgID_SkypeControlAPIDiscover, + (WPARAM) tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle, 0) != 0) { + tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle = tech_pvt->SkypopenHandles.win32_hInit_MainWindowHandle; while (running && tech_pvt->running) { MSG oMessage; if (!(running && tech_pvt->running)) @@ -1408,7 +1408,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj) win32_DeInitialize_DestroyWindowClass(tech_pvt); } } - DEBUGA_SKYPE("EXITING\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("EXITING\n", SKYPOPEN_P_LOG); return NULL; } @@ -1419,7 +1419,7 @@ int X11_errors_handler(Display * dpy, XErrorEvent * err) (void) dpy; xerror = err->error_code; - ERRORA("Received error code %d from X Server\n\n", SKYPIAX_P_LOG, xerror); + ERRORA("Received error code %d from X Server\n\n", SKYPOPEN_P_LOG, xerror); return 0; /* ignore the error */ } @@ -1435,12 +1435,12 @@ static int X11_errors_untrap(void) return (xerror != BadValue) && (xerror != BadWindow); } -int skypiax_send_message(private_t * tech_pvt, const char *message_P) +int skypopen_send_message(private_t * tech_pvt, const char *message_P) { - struct SkypiaxHandles *SkypiaxHandles = &tech_pvt->SkypiaxHandles; - Window w_P = SkypiaxHandles->skype_win; - Display *disp = SkypiaxHandles->disp; - Window handle_P = SkypiaxHandles->win; + struct SkypopenHandles *SkypopenHandles = &tech_pvt->SkypopenHandles; + Window w_P = SkypopenHandles->skype_win; + Display *disp = SkypopenHandles->disp; + Window handle_P = SkypopenHandles->win; int ok; @@ -1472,7 +1472,7 @@ int skypiax_send_message(private_t * tech_pvt, const char *message_P) ok = X11_errors_untrap(); if (!ok) { - ERRORA("Sending message failed with status %d\n", SKYPIAX_P_LOG, xerror); + ERRORA("Sending message failed with status %d\n", SKYPOPEN_P_LOG, xerror); tech_pvt->running = 0; return 0; } @@ -1480,16 +1480,16 @@ int skypiax_send_message(private_t * tech_pvt, const char *message_P) return 1; } -int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype) +int skypopen_signaling_write(private_t * tech_pvt, char *msg_to_skype) { - DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPIAX_P_LOG, msg_to_skype); + DEBUGA_SKYPE("SENDING: |||%s||||\n", SKYPOPEN_P_LOG, msg_to_skype); - if (!skypiax_send_message(tech_pvt, msg_to_skype)) { + if (!skypopen_send_message(tech_pvt, msg_to_skype)) { ERRORA - ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypiax, then restart Skype, then launch Skypiax and try again.\n", - SKYPIAX_P_LOG); + ("Sending message failed - probably Skype crashed.\n\nPlease shutdown Skypopen, then restart Skype, then launch Skypopen and try again.\n", + SKYPOPEN_P_LOG); return -1; } @@ -1497,9 +1497,9 @@ int skypiax_signaling_write(private_t * tech_pvt, char *msg_to_skype) } -int skypiax_present(struct SkypiaxHandles *SkypiaxHandles) +int skypopen_present(struct SkypopenHandles *SkypopenHandles) { - Atom skype_inst = XInternAtom(SkypiaxHandles->disp, "_SKYPE_INSTANCE", True); + Atom skype_inst = XInternAtom(SkypopenHandles->disp, "_SKYPE_INSTANCE", True); Atom type_ret; int format_ret; @@ -1511,26 +1511,26 @@ int skypiax_present(struct SkypiaxHandles *SkypiaxHandles) X11_errors_trap(); status = - XGetWindowProperty(SkypiaxHandles->disp, DefaultRootWindow(SkypiaxHandles->disp), + XGetWindowProperty(SkypopenHandles->disp, DefaultRootWindow(SkypopenHandles->disp), skype_inst, 0, 1, False, XA_WINDOW, &type_ret, &format_ret, &nitems_ret, &bytes_after_ret, &prop); X11_errors_untrap(); /* sanity check */ if (status != Success || format_ret != 32 || nitems_ret != 1) { - SkypiaxHandles->skype_win = (Window) - 1; - DEBUGA_SKYPE("Skype instance not found\n", SKYPIAX_P_LOG); + SkypopenHandles->skype_win = (Window) - 1; + DEBUGA_SKYPE("Skype instance not found\n", SKYPOPEN_P_LOG); running = 0; - SkypiaxHandles->api_connected = 0; + SkypopenHandles->api_connected = 0; return 0; } - SkypiaxHandles->skype_win = *(const unsigned long *) prop & 0xffffffff; - DEBUGA_SKYPE("Skype instance found with id #%d\n", SKYPIAX_P_LOG, (unsigned int) SkypiaxHandles->skype_win); - SkypiaxHandles->api_connected = 1; + SkypopenHandles->skype_win = *(const unsigned long *) prop & 0xffffffff; + DEBUGA_SKYPE("Skype instance found with id #%d\n", SKYPOPEN_P_LOG, (unsigned int) SkypopenHandles->skype_win); + SkypopenHandles->api_connected = 1; return 1; } -void skypiax_clean_disp(void *data) +void skypopen_clean_disp(void *data) { int *dispptr; @@ -1541,21 +1541,21 @@ void skypiax_clean_disp(void *data) disp = *dispptr; if (disp) { - DEBUGA_SKYPE("to be destroyed disp %d\n", SKYPIAX_P_LOG, disp); + DEBUGA_SKYPE("to be destroyed disp %d\n", SKYPOPEN_P_LOG, disp); close(disp); - DEBUGA_SKYPE("destroyed disp\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("destroyed disp\n", SKYPOPEN_P_LOG); } else { - DEBUGA_SKYPE("NOT destroyed disp\n", SKYPIAX_P_LOG); + DEBUGA_SKYPE("NOT destroyed disp\n", SKYPOPEN_P_LOG); } - DEBUGA_SKYPE("OUT destroyed disp\n", SKYPIAX_P_LOG); - skypiax_sleep(1000); + DEBUGA_SKYPE("OUT destroyed disp\n", SKYPOPEN_P_LOG); + skypopen_sleep(1000); } -void *skypiax_do_skypeapi_thread_func(void *obj) +void *skypopen_do_skypeapi_thread_func(void *obj) { private_t *tech_pvt = obj; - struct SkypiaxHandles *SkypiaxHandles; + struct SkypopenHandles *SkypopenHandles; char buf[512]; Display *disp = NULL; Window root = -1; @@ -1571,42 +1571,42 @@ void *skypiax_do_skypeapi_thread_func(void *obj) if (!tech_pvt->tcp_cli_port) tech_pvt->tcp_cli_port = 10161; - if (pipe(tech_pvt->SkypiaxHandles.fdesc)) { - fcntl(tech_pvt->SkypiaxHandles.fdesc[0], F_SETFL, O_NONBLOCK); - fcntl(tech_pvt->SkypiaxHandles.fdesc[1], F_SETFL, O_NONBLOCK); + if (pipe(tech_pvt->SkypopenHandles.fdesc)) { + fcntl(tech_pvt->SkypopenHandles.fdesc[0], F_SETFL, O_NONBLOCK); + fcntl(tech_pvt->SkypopenHandles.fdesc[1], F_SETFL, O_NONBLOCK); } - SkypiaxHandles = &tech_pvt->SkypiaxHandles; + SkypopenHandles = &tech_pvt->SkypopenHandles; disp = XOpenDisplay(tech_pvt->X11_display); if (!disp) { - ERRORA("Cannot open X Display '%s', exiting skype thread\n", SKYPIAX_P_LOG, tech_pvt->X11_display); + ERRORA("Cannot open X Display '%s', exiting skype thread\n", SKYPOPEN_P_LOG, tech_pvt->X11_display); running = 0; return NULL; } else { - DEBUGA_SKYPE("X Display '%s' opened\n", SKYPIAX_P_LOG, tech_pvt->X11_display); + DEBUGA_SKYPE("X Display '%s' opened\n", SKYPOPEN_P_LOG, tech_pvt->X11_display); } xfd = XConnectionNumber(disp); fcntl(xfd, F_SETFD, FD_CLOEXEC); - SkypiaxHandles->disp = disp; + SkypopenHandles->disp = disp; - if (skypiax_present(SkypiaxHandles)) { + if (skypopen_present(SkypopenHandles)) { root = DefaultRootWindow(disp); win = XCreateSimpleWindow(disp, root, 0, 0, 1, 1, 0, BlackPixel(disp, DefaultScreen(disp)), BlackPixel(disp, DefaultScreen(disp))); - SkypiaxHandles->win = win; + SkypopenHandles->win = win; - snprintf(buf, 512, "NAME skypiax"); + snprintf(buf, 512, "NAME skypopen"); - if (!skypiax_send_message(tech_pvt, buf)) { - ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG); + if (!skypopen_send_message(tech_pvt, buf)) { + ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypopen again\n", SKYPOPEN_P_LOG); running = 0; return NULL; } snprintf(buf, 512, "PROTOCOL 7"); - if (!skypiax_send_message(tech_pvt, buf)) { - ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypiax again\n", SKYPIAX_P_LOG); + if (!skypopen_send_message(tech_pvt, buf)) { + ERRORA("Sending message failed - probably Skype crashed. Please run/restart Skype manually and launch Skypopen again\n", SKYPOPEN_P_LOG); running = 0; return NULL; } @@ -1636,7 +1636,7 @@ void *skypiax_do_skypeapi_thread_func(void *obj) case ClientMessage: if (an_event.xclient.format != 8) { - skypiax_sleep(1000); //0.1 msec + skypopen_sleep(1000); //0.1 msec break; } @@ -1649,10 +1649,10 @@ void *skypiax_do_skypeapi_thread_func(void *obj) if (strlen(buffer)) { unsigned int howmany; howmany = strlen(b) + 1; - howmany = write(SkypiaxHandles->fdesc[1], b, howmany); + howmany = write(SkypopenHandles->fdesc[1], b, howmany); WARNINGA ("A begin atom while the previous message is not closed???? value of previous message (between vertical bars) is=|||%s|||, will be lost\n", - SKYPIAX_P_LOG, buffer); + SKYPOPEN_P_LOG, buffer); memset(buffer, '\0', 17000); } if (continue_is_broken) { @@ -1664,22 +1664,22 @@ void *skypiax_do_skypeapi_thread_func(void *obj) if (!strlen(buffer)) { DEBUGA_SKYPE ("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||, let's store it and hope next 'begin' will be the good one\n", - SKYPIAX_P_LOG, buf); + SKYPOPEN_P_LOG, buf); strcat(continuebuffer, buf); continue_is_broken = 1; if (!strncmp(buf, "ognised identity", 15)) { WARNINGA ("Got a 'continue' XAtom without a previous 'begin'. It's value (between vertical bars) is=|||%s|||. Let's introduce a 1 second delay.\n", - SKYPIAX_P_LOG, buf); - skypiax_sleep(1000000); //1 sec + SKYPOPEN_P_LOG, buf); + skypopen_sleep(1000000); //1 sec } - skypiax_sleep(1000); //0.1 msec + skypopen_sleep(1000); //0.1 msec break; } } if (continue_is_broken) { XFlush(disp); - skypiax_sleep(1000); //0.1 msec + skypopen_sleep(1000); //0.1 msec continue; } strcat(buffer, buf); @@ -1690,22 +1690,22 @@ void *skypiax_do_skypeapi_thread_func(void *obj) unsigned int howmany; howmany = strlen(b) + 1; - howmany = write(SkypiaxHandles->fdesc[1], b, howmany); + howmany = write(SkypopenHandles->fdesc[1], b, howmany); memset(buffer, '\0', 17000); XFlush(disp); there_were_continues = 0; } - skypiax_sleep(1000); //0.1 msec + skypopen_sleep(1000); //0.1 msec break; default: - skypiax_sleep(1000); //0.1 msec + skypopen_sleep(1000); //0.1 msec break; } } } } else { - ERRORA("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypiax\n", SKYPIAX_P_LOG); + ERRORA("Skype is not running, maybe crashed. Please run/restart Skype and relaunch Skypopen\n", SKYPOPEN_P_LOG); running = 0; return NULL; }