mm-iface-mode: provide direction and number when creating calls

Calls created from property bundles are always outgoing, while calls
created as input events from URCs during runtime are always incoming.

This change makes it mandatory to provide at least direction of the
call when the object is created, leaving the number as an optional
property that may or may not be known in advance (e.g. it would be
optional only for incoming calls).
This commit is contained in:
Aleksander Morgado
2018-10-16 17:09:21 +00:00
committed by Dan Williams
parent 44413308b2
commit 887376fe44
8 changed files with 38 additions and 28 deletions
+4 -2
View File
@@ -2987,10 +2987,12 @@ modem_voice_disable_unsolicited_events (MMIfaceModemVoice *self,
/* Create call (Voice interface) */
static MMBaseCall *
create_call (MMIfaceModemVoice *self)
create_call (MMIfaceModemVoice *self,
MMCallDirection direction,
const gchar *number)
{
/* New Huawei Call */
return mm_call_huawei_new (MM_BASE_MODEM (self));
return mm_call_huawei_new (MM_BASE_MODEM (self), direction, number);
}
/*****************************************************************************/
+5 -1
View File
@@ -201,10 +201,14 @@ cleanup_unsolicited_events (MMBaseCall *self,
/*****************************************************************************/
MMBaseCall *
mm_call_huawei_new (MMBaseModem *modem)
mm_call_huawei_new (MMBaseModem *modem,
MMCallDirection direction,
const gchar *number)
{
return MM_BASE_CALL (g_object_new (MM_TYPE_CALL_HUAWEI,
MM_BASE_CALL_MODEM, modem,
"direction", direction,
"number", number,
MM_BASE_CALL_SUPPORTS_DIALING_TO_RINGING, TRUE,
MM_BASE_CALL_SUPPORTS_RINGING_TO_ACTIVE, TRUE,
NULL));
+3 -1
View File
@@ -43,6 +43,8 @@ struct _MMCallHuaweiClass {
GType mm_call_huawei_get_type (void);
MMBaseCall *mm_call_huawei_new (MMBaseModem *modem);
MMBaseCall *mm_call_huawei_new (MMBaseModem *modem,
MMCallDirection direction,
const gchar *number);
#endif /* MM_CALL_HUAWEI_H */