Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I've seen several links suggesting it is possible to make a call from the command-line with skype. The instructions suggest something along the lines of:

skype --callto:+14445551234

However, this gets me an error message, "skype: unrecognized option '--callto:+14445551234".

Is this possible?

Use case scenario:

I want to call a particular number frequently.

  • assuming skype client is already running and logged in.
  • I create a shortcut on my desktop, which runs skype --callto:+14445551234 or something similar.
  • Double-click the shortcut.
  • skype window pops up, immediately calling this number

Can this be done?

I know there is a Skype API. Can this be done from a normal skype installation on Ubuntu, without installing any developer tools?

EDIT: I am considering this question to be still open, because I would like to know if this is possible from a default installation of skype without any additional functionality.

However, the answer below regarding "Skype4Py" does answer the desired outcome, albeit with an additional tool. I will mark this as the answer if another is not forthcoming in a few weeks.

share|improve this question
add comment

1 Answer

up vote 4 down vote accepted

Yes, if you use Skype4Py.

I've created a simple callto.py script based on examples/callfriend.py from Skype4Py. It takes a phone number or a friend name from the skype roster as an argument. It's only working if skype is already launched.

Skype will ask you if you want to give API permission to Skype4Py.

Code follows:

#!python
# ---------------------------------------------------------------------------------------------
#  Python / Skype4Py example that takes a skypename or number from the commandline
# and calls it.
#

import sys
import Skype4Py

# This variable will get its actual value in OnCall handler
CallStatus = 0

# Here we define a set of call statuses that indicate a call has been either aborted or finished
CallIsFinished = set ([Skype4Py.clsFailed, Skype4Py.clsFinished, Skype4Py.clsMissed, Skype4Py.clsRefused, Skype4Py.clsBusy, Skype4Py.clsCancelled]);

def AttachmentStatusText(status):
   return skype.Convert.AttachmentStatusToText(status)

def CallStatusText(status):
    return skype.Convert.CallStatusToText(status)

# This handler is fired when status of Call object has changed
def OnCall(call, status):
    global CallStatus
    CallStatus = status
    print 'Call status: ' + CallStatusText(status)

# This handler is fired when Skype attatchment status changes
def OnAttach(status): 
    print 'API attachment status: ' + AttachmentStatusText(status)
    if status == Skype4Py.apiAttachAvailable:
        skype.Attach()

# Let's see if we were started with a command line parameter..
try:
    CmdLine = sys.argv[1]
except:
    print 'Missing command line parameter'
    sys.exit()

# Creating Skype object and assigning event handlers..
skype = Skype4Py.Skype()
skype.OnAttachmentStatus = OnAttach
skype.OnCallStatus = OnCall

# Starting Skype if it's not running already..
if not skype.Client.IsRunning:
    print 'Starting Skype..'
    skype.Client.Start()

# Attatching to Skype..
print 'Connecting to Skype..'
skype.Attach()

# Make the call
print 'Calling ' + CmdLine + '..'
skype.PlaceCall(CmdLine)

# Loop until CallStatus gets one of "call terminated" values in OnCall handler
while not CallStatus in CallIsFinished:
    pass
share|improve this answer
    
Hey. This looks promising. Preliminary to installing skype4py and testing this out, can you tell me basically what this script will do? ie, I run what command to get what result? –  e.m.fields Oct 11 '10 at 4:28
    
Put it in a file callto.py and you can run it with python callto.py <phone-number>. If your skype is online, it will start a call to <phone-number>. –  jneves Oct 11 '10 at 11:12
    
Cool. This answers the desired outcome, but I am leaving this question to be open because I'd like to hear if this is possible via normal skype capabilities, the google results seemed to indicate so. However, thank you for the answer. –  e.m.fields Oct 13 '10 at 20:07
1  
Good luck. My own searches led me to believe it's something specific to the windows client, but I'd love to find out otherwise. –  jneves Oct 15 '10 at 7:48
1  
I don't think you can call phone number from the command line by just using skype. Every time you call skype from the command line, it will start a new skype instance. You can only pipe the username and password using --piped-login –  Adi Roiban Nov 7 '10 at 21:39
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.