Created
January 14, 2022 00:48
-
-
Save telent/15cb90639c4bc700088a9aa6ada6d6c2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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