Register FAQ / Rules Forum Spy Search Today's Posts Mark Forums Read
Go Back   MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Reply
 
Thread Tools Search this Thread Display Modes
Old Jul 6, 2013, 12:23 PM   #1
Shawzborne
macrumors 6502
 
Join Date: Jun 2013
Script to Auto Record incoming Skype calls with Piezo

Hi Everyone,

Could one of you talented coders out there create me a script or something that could run in the background which tells Piezo to auto-record incoming skype calls?

Thank-you,

Shawn
Shawzborne is offline   0 Reply With Quote
Old Aug 13, 2013, 04:05 PM   #2
numero
macrumors member
 
Join Date: Jul 2002
Location: OR
Skype is ending support for their API in September 2013. My first thought on how to accomplish this without the API is to detect when network ports are opened. Skype seems to have 3 ports open all of the time. Mine goes to 6 when a call is active and makes a stop at 5 and 4 after a call before settling back in at 3.

The code below gives you a start on this. Insert the appropriate code to start/stop Piezo where noted. If you get stuck post what you have back here.

Code:
repeat -- main event loop
	repeat -- loop when no call is present or Skype is not running
		if (callInProgress()) then
			exit repeat
		else
			delay 15 -- sleep for 15 seconds before checking again
		end if
	end repeat
	
	-- initiate recording here between repeat loops
	-- you are on your own for this one
	-- I don't have the Piezo application
	
	repeat
		if (not callInProgress()) then
			exit repeat
		else
			delay 15 -- Skype keeps ports open for about 60 seconds after a call  ends. Recording will end somewhere between 60 and 75 seconds after talking stops.
		end if
	end repeat
	
	-- The only way you get to this line is if there was a recording initiated that has now ended.
	-- Tell Piezo to turn the recording off.
	
end repeat



on callInProgress()
	set pid to do shell script "ps -Af | grep Skype | grep -v grep | cut -d ' ' -f 4"
	if ((pid as text) is "") then
		return false
	end if
	set skypeOpenFilesCount to do shell script "lsof -p " & pid & " | grep ESTAB | wc -l"
	
	ignoring white space
		set openNumber to skypeOpenFilesCount as number
	end ignoring
	
	if (openNumber > 5) then
		return true
		log ("talking")
	else
		return false
		log ("not talking")
	end if
end callInProgress
numero is offline   0 Reply With Quote

Reply
MacRumors Forums > Apple Systems and Services > Programming > Mac Programming

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Similar Threads
thread Thread Starter Forum Replies Last Post
Skype incoming audio only on right speaker? Jerz Mac Applications and Mac App Store 10 Mar 26, 2014 07:06 PM
Problem with incoming calls ArminOF iOS 7 0 Sep 21, 2013 07:37 AM
Incoming calls coming in as 2 incoming calls NatureX iOS 7 2 Jul 15, 2013 08:27 AM
iPhone: JB Iphone freezes on incoming calls (FaceTime and Cellular calls) seance765 Jailbreaks and iOS Hacks 10 Dec 6, 2012 02:56 AM
iOS 6 incoming calls GeorgieAcevedo iOS 6 2 Jul 10, 2012 01:35 PM

Forum Jump

All times are GMT -5. The time now is 03:20 PM.

Mac Rumors | Mac | iPhone | iPhone Game Reviews | iPhone Apps

Mobile Version | Fixed | Fluid | Fluid HD
Copyright 2002-2013, MacRumors.com, LLC