Skip to content

Instantly share code, notes, and snippets.

@telent
Created January 14, 2022 00:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save telent/15cb90639c4bc700088a9aa6ada6d6c2 to your computer and use it in GitHub Desktop.
Save telent/15cb90639c4bc700088a9aa6ada6d6c2 to your computer and use it in GitHub Desktop.
(local lgi (require :lgi))
(local dbus (require :dbus_proxy))
(local GLib lgi.GLib)
(local GV lgi.GLib.Variant)
(local variant dbus.variant)
;; https://www.freedesktop.org/software/ModemManager/api/latest/ref-dbus.html
(local modem-manager
(dbus.Proxy:new
{
:bus dbus.Bus.SYSTEM
:name "org.freedesktop.ModemManager1"
:interface "org.freedesktop.DBus.ObjectManager"
;; mmcli -L
:path "/org/freedesktop/ModemManager1"
}))
(fn voice []
(dbus.Proxy:new
{
:bus dbus.Bus.SYSTEM
:name "org.freedesktop.ModemManager1"
:interface "org.freedesktop.ModemManager1.Modem.Voice"
:path (next (modem-manager:GetManagedObjects))
}))
(fn start-call [number]
(let [call-path (: (voice) :CreateCall {:number (GV "s" number)})
o (dbus.Proxy:new
{
:bus dbus.Bus.SYSTEM
:name "org.freedesktop.ModemManager1"
:interface "org.freedesktop.ModemManager1.Call"
:path call-path
})]
(o:Start)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment