In spite of the last proposal was very similar, for my opinion, to Messaging/SMS style, I've attach'd
a new patch with your last suggestions. If you think I don't understand what you said yet, send me your
modified patch.

Thanks,

Riccardo Vangelisti - Sadel SpA
Software Development
Via Serenari 1, Castel Maggiore (BO)
Il 20/04/2015 19:03, Aleksander Morgado ha scritto:

On Mon, Apr 20, 2015 at 6:47 PM, Riccardo Vangelisti <[email protected]> wrote:
Thanks for you support.

I agree with your opinion and I changed my proposal with your advices.
I follow the SMS and Messaging implementation and I create two new interfaces named CallLog and Call.
CallLog contains all Call objects created.


​Ouch, no no, this proposal is even nastier :) I think you didn't understand me.

I was suggesting 2 interfaces:
  * "Voice" interface applicable to the "Modem" object. This one would have the Start(), Hangup(), Accept()... methods. Also a List() method to list which are the available call objects. And also the "Audio" property as well.
  * "Call" interface applicable to a new "Call" object. This one would have e.g. the Direction property, the Number property... i.e. all the stuff applicable to one single call.

This would be equivalent to the Messaging+SMS interfaces (Messaging~Voice, SMS~Call).
 
All Call state are described in a schema that I've attached.


​Ah, nice one.​

 
About call type specification, in GSM service there are two types of call: Voice Call and Data Call.
In AT Standard the ATD command is described as follow:

"ATD[<digits>][I/i][;]

[...]

When ';' is contained in this command, a voice call is initiated.
When ';' is not contained in this command, a data service call is initiated."

Data call is used for example with ZMODEM in order to trasfer files between two endpoint.


​I would completely ignore this and only support voice calls for now. We should try to write a minimal API, we can extend it afterwards if the need ever arises.​


--


>From 6842a64860b9e3f52afa1d7d72bd86e489209b95 Mon Sep 17 00:00:00 2001
From: Riccardo Vangelisti <[email protected]>
Date: Tue, 21 Apr 2015 10:04:48 +0200
Subject: [PATCH] Added Modem.Voice and Call interfaces for voice call handling

---
 include/ModemManager-enums.h                       |  30 ++++++
 introspection/all.xml                              |   2 +
 .../org.freedesktop.ModemManager1.Call.xml         |  49 ++++++++++
 .../org.freedesktop.ModemManager1.Modem.Voice.xml  | 105 +++++++++++++++++++++
 4 files changed, 186 insertions(+)
 create mode 100644 introspection/org.freedesktop.ModemManager1.Call.xml
 create mode 100644 introspection/org.freedesktop.ModemManager1.Modem.Voice.xml

diff --git a/include/ModemManager-enums.h b/include/ModemManager-enums.h
index 57a2b27..aa61325 100644
--- a/include/ModemManager-enums.h
+++ b/include/ModemManager-enums.h
@@ -1168,4 +1168,34 @@ typedef enum { /*< underscore_name=mm_oma_session_state_failed_reason >*/
     MM_OMA_SESSION_STATE_FAILED_REASON_SESSION_CANCELLED     = 5
 } MMOmaSessionStateFailedReason;
 
+/**
+ * MMCallState:
+ * MM_CALL_STATE_UNKNOWN: default state for a new outgoing call
+ * MM_CALL_STATE_RINGING: call is waiting for an answer 
+ * @MM_CALL_STATE_ACCEPTED: call is active between two peers
+ * @MM_CALL_STATE_TERMINATED: call is terminated
+ * @MM_CALL_STATE_REFUSED: call is refused or busy
+ * @MM_CALL_STATE_ERROR: call in error (wrong number, network unavailable, etc..)
+ * 
+ * State of Call
+ */
+typedef enum { /*< underscore_name=mm_call_state >*/
+    MM_CALL_STATE_UNKNOWN       = 0,
+    MM_CALL_STATE_RINGING       = 1,
+    MM_CALL_STATE_ACCEPTED      = 2,
+    MM_CALL_STATE_TERMINATED    = 3,
+    MM_CALL_STATE_REFUSED       = 4,
+    MM_CALL_STATE_ERROR         = 5
+} MMCallState;
+
+/**
+ * MMCallDirection:
+ * @MM_CALL_DIRECTION_INCOMING : call from network
+ * @MM_CALL_DIRECTION_OUTGOING : call to network
+ */
+typedef enum { /*< underscore_name=mm_call_direction >*/
+    MM_CALL_DIRECTION_INCOMING  = 0,
+    MM_CALL_DIRECTION_OUTGOING  = 1
+} MMCallDirection;
+
 #endif /*  _MODEMMANAGER_ENUMS_H_ */
diff --git a/introspection/all.xml b/introspection/all.xml
index 4d277e3..57c28d0 100644
--- a/introspection/all.xml
+++ b/introspection/all.xml
@@ -6,7 +6,9 @@
   <xi:include href="org.freedesktop.ModemManager1.Sim.xml"/>
   <xi:include href="org.freedesktop.ModemManager1.Bearer.xml"/>
   <xi:include href="org.freedesktop.ModemManager1.Sms.xml"/>
+  <xi:include href="org.freedesktop.ModemManager1.Call.xml"/>
   <xi:include href="org.freedesktop.ModemManager1.Modem.xml"/>
+  <xi:include href="org.freedesktop.ModemManager1.Modem.Voice.xml"/>
   <xi:include href="org.freedesktop.ModemManager1.Modem.Modem3gpp.xml"/>
   <xi:include href="org.freedesktop.ModemManager1.Modem.Modem3gpp.Ussd.xml"/>
   <xi:include href="org.freedesktop.ModemManager1.Modem.ModemCdma.xml"/>
diff --git a/introspection/org.freedesktop.ModemManager1.Call.xml b/introspection/org.freedesktop.ModemManager1.Call.xml
new file mode 100644
index 0000000..5f007b5
--- /dev/null
+++ b/introspection/org.freedesktop.ModemManager1.Call.xml
@@ -0,0 +1,49 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd";>
+
+  <!--
+      org.freedesktop.ModemManager1.Call:
+      @short_description: The ModemManager Call interface.
+
+      The Call interface Defines operations and properties of a single Call.
+  -->
+  <interface name="org.freedesktop.ModemManager1.Call">
+
+    <!--
+        StateChanged:
+        @old: Old state MMCallState
+        @new: New state MMCallState
+
+        Emitted when call changes state
+    -->
+    <signal name="StateChanged">
+      <arg name="old" type="i" />
+      <arg name="new" type="i" />
+    </signal>
+
+    <!--
+        State:
+
+        A <link linkend="MMCallState">MMCallState</link> value,
+        describing the state of the call.
+    -->
+    <property name="State" type="i" access="read" />
+
+    <!--
+        Direction:
+
+        A <link linkend="MMCallDirection">MMCallDirection</link> value,
+        describing the direction of the call.
+    -->
+    <property name="Direction" type="i" access="read" />
+
+    <!--
+        Number:
+
+        The remote phone number.
+    -->
+    <property name="Number" type="s" access="read" />
+
+  </interface>
+</node>
diff --git a/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml b/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml
new file mode 100644
index 0000000..739c6a6
--- /dev/null
+++ b/introspection/org.freedesktop.ModemManager1.Modem.Voice.xml
@@ -0,0 +1,105 @@
+<?xml version="1.0" encoding="UTF-8" ?>
+
+<node name="/" xmlns:doc="http://www.freedesktop.org/dbus/1.0/doc.dtd";>
+
+  <!--
+      org.freedesktop.ModemManager1.Modem.Voice:
+      @short_description: The ModemManager Voice interface.
+
+      The Voice interface handles Calls.
+  -->
+  <interface name="org.freedesktop.ModemManager1.Modem.Voice">
+
+    <!--
+        Start:
+        @number : phone number
+        @callpath : path to new Call Object
+
+        Start a new call
+    -->
+    <method name="Start">
+      <arg name="number" type="s" direction="in" />
+      <arg name="callpath" type="o" direction="out" />
+    </method>
+
+    <!--
+        Accept:
+        @callpath : path to signaled Call Object
+
+        Accept incoming call (Answer).
+    -->
+    <method name="Accept">
+      <arg name="callpath" type="o" direction="in" />
+    </method>
+
+    <!--
+        HangUp:
+        @callpath : path to Call Object
+
+        Hangup the specified active call.
+    -->
+    <method name="HangUp">
+      <arg name="callpath" type="o" direction="in" />
+    </method>
+
+    <!--
+        List:
+        @result: The list of call object paths.
+
+        Retrieve all Calls.
+    -->
+    <method name="List">
+      <arg name="result" type="ao" direction="out" />
+    </method>
+
+    <!--
+        Delete:
+        @path: The object path of the Call to delete.
+
+        Delete a Call.
+    -->
+    <method name="Delete">
+      <arg name="path" type="o" direction="in" />
+    </method>
+
+    <!--
+        Incoming:
+        @callpath: Object path of the new call.
+
+        Emitted when a new incoming call has been received.
+    -->
+    <signal name="Incoming">
+      <arg name="callpath" type="o" />
+    </signal>
+
+    <!--
+        Deleted:
+        @path: Object path of the now deleted Call.
+
+        Emitted when a call has been deleted.
+    -->
+    <signal name="Deleted">
+      <arg name="path" type="o" />
+    </signal>
+
+    <!--
+        Calls:
+
+        The list of calls object paths.
+    -->
+    <property name="Calls" type="ao" access="read" />
+
+    <!--
+        Audio:
+
+        The audio device.
+
+        Example list:
+        - "analog" (PCM analog)
+        - "/dev/ttyUSB2" (sound device)
+        - "others?"
+    -->
+    <property name="Audio" type="s" access="read" />
+
+  </interface>
+</node>
-- 
2.1.4

_______________________________________________
ModemManager-devel mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/modemmanager-devel

Reply via email to