Om2008.8: execute script on incoming call

Michael 'Mickey' Lauer mickey at openmoko.org
Thu Aug 28 01:18:29 CEST 2008


Am Donnerstag 28 August 2008 01:10:25 schrieb Michael 'Mickey' Lauer:
> def onCallStatus( index, status, properties ):
>     if status == "incoming":
>         try:
>              action = actions[properties["number"]]
>         except KeyError:
>              pass
>         else:
>               subprocess.Popen( action, shell=True )

Bummer, forgot to hangup here... use that:

def onCallStatus( index, status, properties ):
    if status == "incoming":
        try:
             action = actions[properties["number"]]
        except KeyError:
             pass
        else:
              obj = 
bus.get_object( "org.freesmartphone.ogsmd", "/org/freesmartphone/Device/GSM" )
              callInterface = dbus.Interface( 
obj, "org.freesmartphone.GSM.Call" )
              callInterface.Release( index )
              subprocess.Popen( action, shell=True )

-- 
:M:




More information about the community mailing list