Reply
Thread Tools
Posts: 268 | Thanked: 304 times | Joined on Oct 2009 @ Orlando, USA
#1
I would like to initiate a Skype/Gtalk call to a contact via a command/script.

Is there a way to do it using dbus?

Any help would be appreciated.

Thanks!
 
Posts: 93 | Thanked: 13 times | Joined on Nov 2010
#2
Code:
#!/usr/bin/python
 
import dbus
import sys
 
# Get the target phone number (or SIP address) from the command line
TARGET = sys.argv[1];
 
# Configure the telepathy path to the SofiaSIP account that we wish to use.
# Use "mc-tool list" (from the libmissioncontrol-utils package) to see your accounts.
SIP_ACCOUNT = 'sofiasip/sip/_31234567_40sipgate_2eco_2euk0'
 
# This gets us a connnection to the session bus
bus = dbus.SessionBus()
 
# This sets up a path to the SIP account within telepathy.
PATH = '/org/freedesktop/Telepathy/Account/'
PATH += SIP_ACCOUNT
 
# This sets up a proxy object as a "handle" to the AccountManager of our target account
account = bus.get_object('org.freedesktop.Telepathy.AccountManager', PATH)
 
# This launches the actual SIP call with a method call to EnsureChannel on that object
account.EnsureChannel( \
        dbus.Dictionary({
                dbus.String(u'org.freedesktop.Telepathy.Channel.TargetHandleType'): dbus.UInt32(1),
                dbus.String(u'org.freedesktop.Telepathy.Channel.ChannelType'): dbus.String(u'org.freedesktop.Telepathy.Channel.Type.StreamedMedia'),
                dbus.String(u'org.freedesktop.Telepathy.Channel.TargetID'): dbus.String(TARGET),
        }, signature='sv'),
        dbus.UInt64(0),
        dbus.String(''),
        dbus_interface='com.nokia.Account.Interface.ChannelRequests')
 
sys.exit(0)
Check below for more info...
http://wiki.maemo.org/Phone_control

Enjoy.
 

The Following User Says Thank You to rosh For This Useful Post:
Posts: 268 | Thanked: 304 times | Joined on Oct 2009 @ Orlando, USA
#3
Thanks!

Can this be used to make a call to a Skype/Gtalk user instead of a phone number? what would the TARGET be then? userid@skype.com?
 
Reply


 
Forum Jump


All times are GMT. The time now is 18:03.