maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   Maemo 5 / Fremantle (https://talk.maemo.org/forumdisplay.php?f=40)
-   -   How to make a VoIP call from the command-line? (https://talk.maemo.org/showthread.php?t=67776)

archebyte 2011-01-02 15:50

How to make a VoIP call from the command-line?
 
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!

rosh 2011-01-02 16:11

Re: How to make a VoIP call from the command-line?
 
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.

archebyte 2011-01-02 18:16

Re: How to make a VoIP call from the command-line?
 
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?


All times are GMT. The time now is 20:22.

vBulletin® Version 3.8.8