core,voice: minor coding style fixes
This commit is contained in:
@@ -74,8 +74,8 @@ handle_start_context_free (HandleStartContext *ctx)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_start_ready (MMBaseCall *self,
|
handle_start_ready (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleStartContext *ctx)
|
HandleStartContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
@@ -84,9 +84,8 @@ handle_start_ready (MMBaseCall *self,
|
|||||||
} else {
|
} else {
|
||||||
/* Transition from Unknown->Dialing */
|
/* Transition from Unknown->Dialing */
|
||||||
if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) == MM_CALL_STATE_UNKNOWN ) {
|
if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) == MM_CALL_STATE_UNKNOWN ) {
|
||||||
|
|
||||||
/* Update state */
|
/* Update state */
|
||||||
mm_base_call_change_state(self, MM_CALL_STATE_DIALING, MM_CALL_STATE_REASON_OUTGOING_STARTED);
|
mm_base_call_change_state (self, MM_CALL_STATE_DIALING, MM_CALL_STATE_REASON_OUTGOING_STARTED);
|
||||||
}
|
}
|
||||||
mm_gdbus_call_complete_start (MM_GDBUS_CALL (ctx->self), ctx->invocation);
|
mm_gdbus_call_complete_start (MM_GDBUS_CALL (ctx->self), ctx->invocation);
|
||||||
}
|
}
|
||||||
@@ -96,8 +95,8 @@ handle_start_ready (MMBaseCall *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_start_auth_ready (MMBaseModem *modem,
|
handle_start_auth_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleStartContext *ctx)
|
HandleStartContext *ctx)
|
||||||
{
|
{
|
||||||
MMCallState state;
|
MMCallState state;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
@@ -111,7 +110,7 @@ handle_start_auth_ready (MMBaseModem *modem,
|
|||||||
/* We can only start call created by the user */
|
/* We can only start call created by the user */
|
||||||
state = mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self));
|
state = mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self));
|
||||||
|
|
||||||
if (state != MM_CALL_STATE_UNKNOWN ){
|
if (state != MM_CALL_STATE_UNKNOWN) {
|
||||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
@@ -132,13 +131,13 @@ handle_start_auth_ready (MMBaseModem *modem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MM_BASE_CALL_GET_CLASS (ctx->self)->start (ctx->self,
|
MM_BASE_CALL_GET_CLASS (ctx->self)->start (ctx->self,
|
||||||
(GAsyncReadyCallback)handle_start_ready,
|
(GAsyncReadyCallback)handle_start_ready,
|
||||||
ctx);
|
ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
handle_start (MMBaseCall *self,
|
handle_start (MMBaseCall *self,
|
||||||
GDBusMethodInvocation *invocation)
|
GDBusMethodInvocation *invocation)
|
||||||
{
|
{
|
||||||
HandleStartContext *ctx;
|
HandleStartContext *ctx;
|
||||||
|
|
||||||
@@ -158,7 +157,6 @@ handle_start (MMBaseCall *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/* Accept call (DBus call handling) */
|
/* Accept call (DBus call handling) */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -188,9 +186,8 @@ handle_accept_ready (MMBaseCall *self,
|
|||||||
} else {
|
} else {
|
||||||
/* Transition from Unknown->Dialing */
|
/* Transition from Unknown->Dialing */
|
||||||
if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) == MM_CALL_STATE_RINGING_IN) {
|
if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) == MM_CALL_STATE_RINGING_IN) {
|
||||||
|
|
||||||
/* Update state */
|
/* Update state */
|
||||||
mm_base_call_change_state(self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED);
|
mm_base_call_change_state (self, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED);
|
||||||
}
|
}
|
||||||
mm_gdbus_call_complete_accept (MM_GDBUS_CALL (ctx->self), ctx->invocation);
|
mm_gdbus_call_complete_accept (MM_GDBUS_CALL (ctx->self), ctx->invocation);
|
||||||
}
|
}
|
||||||
@@ -200,8 +197,8 @@ handle_accept_ready (MMBaseCall *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_accept_auth_ready (MMBaseModem *modem,
|
handle_accept_auth_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleAcceptContext *ctx)
|
HandleAcceptContext *ctx)
|
||||||
{
|
{
|
||||||
MMCallState state;
|
MMCallState state;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
@@ -215,7 +212,7 @@ handle_accept_auth_ready (MMBaseModem *modem,
|
|||||||
state = mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self));
|
state = mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self));
|
||||||
|
|
||||||
/* We can only accept incoming call in ringing state */
|
/* We can only accept incoming call in ringing state */
|
||||||
if (state != MM_CALL_STATE_RINGING_IN ){
|
if (state != MM_CALL_STATE_RINGING_IN) {
|
||||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
@@ -236,13 +233,13 @@ handle_accept_auth_ready (MMBaseModem *modem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MM_BASE_CALL_GET_CLASS (ctx->self)->accept (ctx->self,
|
MM_BASE_CALL_GET_CLASS (ctx->self)->accept (ctx->self,
|
||||||
(GAsyncReadyCallback)handle_accept_ready,
|
(GAsyncReadyCallback)handle_accept_ready,
|
||||||
ctx);
|
ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
handle_accept (MMBaseCall *self,
|
handle_accept (MMBaseCall *self,
|
||||||
GDBusMethodInvocation *invocation)
|
GDBusMethodInvocation *invocation)
|
||||||
{
|
{
|
||||||
HandleAcceptContext *ctx;
|
HandleAcceptContext *ctx;
|
||||||
|
|
||||||
@@ -282,8 +279,8 @@ handle_hangup_context_free (HandleHangupContext *ctx)
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_hangup_ready (MMBaseCall *self,
|
handle_hangup_ready (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleHangupContext *ctx)
|
HandleHangupContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
@@ -292,10 +289,9 @@ handle_hangup_ready (MMBaseCall *self,
|
|||||||
} else {
|
} else {
|
||||||
/* Transition from Unknown->Dialing */
|
/* Transition from Unknown->Dialing */
|
||||||
if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) != MM_CALL_STATE_TERMINATED ||
|
if (mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) != MM_CALL_STATE_TERMINATED ||
|
||||||
mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) != MM_CALL_STATE_UNKNOWN ){
|
mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self)) != MM_CALL_STATE_UNKNOWN) {
|
||||||
|
|
||||||
/* Update state */
|
/* Update state */
|
||||||
mm_base_call_change_state(self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED);
|
mm_base_call_change_state (self, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED);
|
||||||
}
|
}
|
||||||
mm_gdbus_call_complete_hangup (MM_GDBUS_CALL (ctx->self), ctx->invocation);
|
mm_gdbus_call_complete_hangup (MM_GDBUS_CALL (ctx->self), ctx->invocation);
|
||||||
}
|
}
|
||||||
@@ -305,8 +301,8 @@ handle_hangup_ready (MMBaseCall *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_hangup_auth_ready (MMBaseModem *modem,
|
handle_hangup_auth_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleHangupContext *ctx)
|
HandleHangupContext *ctx)
|
||||||
{
|
{
|
||||||
MMCallState state;
|
MMCallState state;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
@@ -320,11 +316,11 @@ handle_hangup_auth_ready (MMBaseModem *modem,
|
|||||||
state = mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self));
|
state = mm_gdbus_call_get_state (MM_GDBUS_CALL (ctx->self));
|
||||||
|
|
||||||
/* We can only hangup call in a valid state */
|
/* We can only hangup call in a valid state */
|
||||||
if (state == MM_CALL_STATE_TERMINATED || state == MM_CALL_STATE_UNKNOWN ){
|
if (state == MM_CALL_STATE_TERMINATED || state == MM_CALL_STATE_UNKNOWN) {
|
||||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
"This call was not active, cannot hangup ");
|
"This call was not active, cannot hangup");
|
||||||
handle_hangup_context_free (ctx);
|
handle_hangup_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -341,13 +337,13 @@ handle_hangup_auth_ready (MMBaseModem *modem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
MM_BASE_CALL_GET_CLASS (ctx->self)->hangup (ctx->self,
|
MM_BASE_CALL_GET_CLASS (ctx->self)->hangup (ctx->self,
|
||||||
(GAsyncReadyCallback)handle_hangup_ready,
|
(GAsyncReadyCallback)handle_hangup_ready,
|
||||||
ctx);
|
ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
handle_hangup (MMBaseCall *self,
|
handle_hangup (MMBaseCall *self,
|
||||||
GDBusMethodInvocation *invocation)
|
GDBusMethodInvocation *invocation)
|
||||||
{
|
{
|
||||||
HandleHangupContext *ctx;
|
HandleHangupContext *ctx;
|
||||||
|
|
||||||
@@ -367,7 +363,6 @@ handle_hangup (MMBaseCall *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/* Send tone (DBus call handling) */
|
/* Send tone (DBus call handling) */
|
||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
@@ -405,8 +400,8 @@ handle_send_tone_ready (MMBaseCall *self,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
handle_send_tone_auth_ready (MMBaseModem *modem,
|
handle_send_tone_auth_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
HandleSendToneContext *ctx)
|
HandleSendToneContext *ctx)
|
||||||
{
|
{
|
||||||
MMCallState state;
|
MMCallState state;
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
@@ -425,7 +420,7 @@ handle_send_tone_auth_ready (MMBaseModem *modem,
|
|||||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_UNSUPPORTED,
|
MM_CORE_ERROR_UNSUPPORTED,
|
||||||
"SendToneing call is not supported by this modem");
|
"Sending tone is not supported by this modem");
|
||||||
handle_send_tone_context_free (ctx);
|
handle_send_tone_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@@ -435,15 +430,14 @@ handle_send_tone_auth_ready (MMBaseModem *modem,
|
|||||||
g_dbus_method_invocation_return_error (ctx->invocation,
|
g_dbus_method_invocation_return_error (ctx->invocation,
|
||||||
MM_CORE_ERROR,
|
MM_CORE_ERROR,
|
||||||
MM_CORE_ERROR_FAILED,
|
MM_CORE_ERROR_FAILED,
|
||||||
"This call was not active, cannot send_tone ");
|
"This call was not active, cannot send tone");
|
||||||
handle_send_tone_context_free (ctx);
|
handle_send_tone_context_free (ctx);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
mm_dbg("[%s:%d] Tone string: '%s'", __func__, __LINE__, ctx->tone);
|
|
||||||
MM_BASE_CALL_GET_CLASS (ctx->self)->send_tone (ctx->self, ctx->tone,
|
MM_BASE_CALL_GET_CLASS (ctx->self)->send_tone (ctx->self, ctx->tone,
|
||||||
(GAsyncReadyCallback)handle_send_tone_ready,
|
(GAsyncReadyCallback)handle_send_tone_ready,
|
||||||
ctx);
|
ctx);
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
@@ -457,7 +451,6 @@ handle_send_tone (MMBaseCall *self,
|
|||||||
ctx->self = g_object_ref (self);
|
ctx->self = g_object_ref (self);
|
||||||
ctx->invocation = g_object_ref (invocation);
|
ctx->invocation = g_object_ref (invocation);
|
||||||
|
|
||||||
mm_dbg("[%s:%d] Tone string: '%s'", __func__, __LINE__, tone);
|
|
||||||
ctx->tone = g_strdup(tone);
|
ctx->tone = g_strdup(tone);
|
||||||
g_object_get (self,
|
g_object_get (self,
|
||||||
MM_BASE_CALL_MODEM, &ctx->modem,
|
MM_BASE_CALL_MODEM, &ctx->modem,
|
||||||
@@ -632,7 +625,7 @@ call_start_ready (MMBaseModem *modem,
|
|||||||
}
|
}
|
||||||
|
|
||||||
/* check response for error */
|
/* check response for error */
|
||||||
if( response && strlen(response) > 0 ) {
|
if (response && strlen (response) > 0 ) {
|
||||||
g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
g_set_error (&error, MM_CORE_ERROR, MM_CORE_ERROR_FAILED,
|
||||||
"Couldn't start the call: "
|
"Couldn't start the call: "
|
||||||
"Modem response '%s'", response);
|
"Modem response '%s'", response);
|
||||||
@@ -705,16 +698,16 @@ call_accept_context_complete_and_free (CallAcceptContext *ctx)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
call_accept_finish (MMBaseCall *self,
|
call_accept_finish (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
call_accept_ready (MMBaseModem *modem,
|
call_accept_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
CallAcceptContext *ctx)
|
CallAcceptContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
const gchar *response;
|
const gchar *response;
|
||||||
@@ -758,8 +751,8 @@ call_accept_ready (MMBaseModem *modem,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
call_accept (MMBaseCall *self,
|
call_accept (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
CallAcceptContext *ctx;
|
CallAcceptContext *ctx;
|
||||||
gchar *cmd;
|
gchar *cmd;
|
||||||
@@ -847,8 +840,8 @@ call_hangup_ready (MMBaseModem *modem,
|
|||||||
|
|
||||||
static void
|
static void
|
||||||
call_hangup (MMBaseCall *self,
|
call_hangup (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
CallHangupContext *ctx;
|
CallHangupContext *ctx;
|
||||||
gchar *cmd;
|
gchar *cmd;
|
||||||
@@ -893,16 +886,16 @@ call_send_tone_context_complete_and_free (CallSendToneContext *ctx)
|
|||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
call_send_tone_finish (MMBaseCall *self,
|
call_send_tone_finish (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
call_send_tone_ready (MMBaseModem *modem,
|
call_send_tone_ready (MMBaseModem *modem,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
CallSendToneContext *ctx)
|
CallSendToneContext *ctx)
|
||||||
{
|
{
|
||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
const gchar *response = NULL;
|
const gchar *response = NULL;
|
||||||
@@ -937,8 +930,7 @@ call_send_tone (MMBaseCall *self,
|
|||||||
ctx->self = g_object_ref (self);
|
ctx->self = g_object_ref (self);
|
||||||
ctx->modem = g_object_ref (self->priv->modem);
|
ctx->modem = g_object_ref (self->priv->modem);
|
||||||
|
|
||||||
mm_dbg("[%s:%d] Tone string: '%s'", __func__, __LINE__, tone);
|
cmd = g_strdup_printf ("AT+VTS=%c", tone[0]);
|
||||||
cmd = g_strdup_printf ("AT+VTS=%c",tone[0]);
|
|
||||||
mm_base_modem_at_command (ctx->modem,
|
mm_base_modem_at_command (ctx->modem,
|
||||||
cmd,
|
cmd,
|
||||||
3,
|
3,
|
||||||
|
@@ -35,9 +35,9 @@ typedef struct _MMBaseCall MMBaseCall;
|
|||||||
typedef struct _MMBaseCallClass MMBaseCallClass;
|
typedef struct _MMBaseCallClass MMBaseCallClass;
|
||||||
typedef struct _MMBaseCallPrivate MMBaseCallPrivate;
|
typedef struct _MMBaseCallPrivate MMBaseCallPrivate;
|
||||||
|
|
||||||
#define MM_BASE_CALL_PATH "call-path"
|
#define MM_BASE_CALL_PATH "call-path"
|
||||||
#define MM_BASE_CALL_CONNECTION "call-connection"
|
#define MM_BASE_CALL_CONNECTION "call-connection"
|
||||||
#define MM_BASE_CALL_MODEM "call-modem"
|
#define MM_BASE_CALL_MODEM "call-modem"
|
||||||
|
|
||||||
struct _MMBaseCall {
|
struct _MMBaseCall {
|
||||||
MmGdbusCallSkeleton parent;
|
MmGdbusCallSkeleton parent;
|
||||||
@@ -48,31 +48,31 @@ struct _MMBaseCallClass {
|
|||||||
MmGdbusCallSkeletonClass parent;
|
MmGdbusCallSkeletonClass parent;
|
||||||
|
|
||||||
/* Start the call */
|
/* Start the call */
|
||||||
void (* start) (MMBaseCall *self,
|
void (* start) (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean (* start_finish) (MMBaseCall *self,
|
gboolean (* start_finish) (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Accept the call */
|
/* Accept the call */
|
||||||
void (* accept) (MMBaseCall *self,
|
void (* accept) (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean (* accept_finish) (MMBaseCall *self,
|
gboolean (* accept_finish) (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Hangup the call */
|
/* Hangup the call */
|
||||||
void (* hangup) (MMBaseCall *self,
|
void (* hangup) (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean (* hangup_finish) (MMBaseCall *self,
|
gboolean (* hangup_finish) (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Send a DTMF tone */
|
/* Send a DTMF tone */
|
||||||
void (* send_tone) (MMBaseCall *self,
|
void (* send_tone) (MMBaseCall *self,
|
||||||
const gchar *tone,
|
const gchar *tone,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
@@ -81,9 +81,9 @@ struct _MMBaseCallClass {
|
|||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
/* Delete the call */
|
/* Delete the call */
|
||||||
void (* delete) (MMBaseCall *self,
|
void (* delete) (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean (* delete_finish) (MMBaseCall *self,
|
gboolean (* delete_finish) (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
@@ -94,20 +94,23 @@ GType mm_base_call_get_type (void);
|
|||||||
/* This one can be overriden by plugins */
|
/* This one can be overriden by plugins */
|
||||||
MMBaseCall *mm_base_call_new (MMBaseModem *modem);
|
MMBaseCall *mm_base_call_new (MMBaseModem *modem);
|
||||||
MMBaseCall *mm_base_call_new_from_properties (MMBaseModem *modem,
|
MMBaseCall *mm_base_call_new_from_properties (MMBaseModem *modem,
|
||||||
MMCallProperties *properties,
|
MMCallProperties *properties,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
void mm_base_call_export (MMBaseCall *self);
|
void mm_base_call_export (MMBaseCall *self);
|
||||||
void mm_base_call_unexport (MMBaseCall *self);
|
void mm_base_call_unexport (MMBaseCall *self);
|
||||||
const gchar *mm_base_call_get_path (MMBaseCall *self);
|
const gchar *mm_base_call_get_path (MMBaseCall *self);
|
||||||
void mm_base_call_change_state (MMBaseCall *self, MMCallState new_state, MMCallStateReason reason);
|
void mm_base_call_change_state (MMBaseCall *self,
|
||||||
void mm_base_call_received_dtmf (MMBaseCall *self, gchar *tone);
|
MMCallState new_state,
|
||||||
|
MMCallStateReason reason);
|
||||||
|
void mm_base_call_received_dtmf (MMBaseCall *self,
|
||||||
|
gchar *tone);
|
||||||
|
|
||||||
void mm_base_call_delete (MMBaseCall *self,
|
void mm_base_call_delete (MMBaseCall *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data);
|
gpointer user_data);
|
||||||
gboolean mm_base_call_delete_finish (MMBaseCall *self,
|
gboolean mm_base_call_delete_finish (MMBaseCall *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error);
|
GError **error);
|
||||||
|
|
||||||
#endif /* MM_BASE_CALL_H */
|
#endif /* MM_BASE_CALL_H */
|
||||||
|
@@ -6212,12 +6212,12 @@ modem_messaging_create_sms (MMIfaceModemMessaging *self)
|
|||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
|
|
||||||
/* Check if Voice supported (Voice interface) */
|
/* Check if Voice supported (Voice interface) */
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
modem_voice_check_support_finish (MMIfaceModemVoice *self,
|
modem_voice_check_support_finish (MMIfaceModemVoice *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
@@ -6255,7 +6255,7 @@ modem_voice_check_support (MMIfaceModemVoice *self,
|
|||||||
user_data,
|
user_data,
|
||||||
modem_voice_check_support);
|
modem_voice_check_support);
|
||||||
|
|
||||||
/* We assume that all modems has voice capabilities, but ... */
|
/* We assume that all modems have voice capabilities, but ... */
|
||||||
|
|
||||||
/* Check ATH support */
|
/* Check ATH support */
|
||||||
mm_base_modem_at_command (MM_BASE_MODEM (self),
|
mm_base_modem_at_command (MM_BASE_MODEM (self),
|
||||||
@@ -6282,10 +6282,8 @@ ring_received (MMPortSerialAt *port,
|
|||||||
GMatchInfo *info,
|
GMatchInfo *info,
|
||||||
MMBroadbandModem *self)
|
MMBroadbandModem *self)
|
||||||
{
|
{
|
||||||
//Do not match anything from regex
|
mm_dbg ("Ringing");
|
||||||
(void)info;
|
mm_iface_modem_voice_create_incoming_call (MM_IFACE_MODEM_VOICE (self));
|
||||||
|
|
||||||
mm_iface_modem_voice_create_incoming_call(MM_IFACE_MODEM_VOICE(self));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -6294,11 +6292,15 @@ cring_received (MMPortSerialAt *port,
|
|||||||
MMBroadbandModem *self)
|
MMBroadbandModem *self)
|
||||||
{
|
{
|
||||||
/* The match info gives us in which storage the index applies */
|
/* The match info gives us in which storage the index applies */
|
||||||
gchar *str = mm_get_string_unquoted_from_match_info (info, 1);
|
gchar *str;
|
||||||
//TODO: In str you could have "VOICE" or "DATA". Now consider only "VOICE"
|
|
||||||
|
/* We could have "VOICE" or "DATA". Now consider only "VOICE" */
|
||||||
|
|
||||||
|
str = mm_get_string_unquoted_from_match_info (info, 1);
|
||||||
|
mm_dbg ("Ringing (%s)", str);
|
||||||
g_free (str);
|
g_free (str);
|
||||||
|
|
||||||
mm_iface_modem_voice_create_incoming_call(MM_IFACE_MODEM_VOICE(self));
|
mm_iface_modem_voice_create_incoming_call (MM_IFACE_MODEM_VOICE (self));
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -6307,20 +6309,22 @@ clip_received (MMPortSerialAt *port,
|
|||||||
MMBroadbandModem *self)
|
MMBroadbandModem *self)
|
||||||
{
|
{
|
||||||
/* The match info gives us in which storage the index applies */
|
/* The match info gives us in which storage the index applies */
|
||||||
gchar *str = mm_get_string_unquoted_from_match_info (info, 1);
|
gchar *str;
|
||||||
|
|
||||||
if( str ) {
|
str = mm_get_string_unquoted_from_match_info (info, 1);
|
||||||
|
|
||||||
|
if (str) {
|
||||||
guint validity = 0;
|
guint validity = 0;
|
||||||
guint type = 0;
|
guint type = 0;
|
||||||
|
|
||||||
mm_get_uint_from_match_info (info, 2, &type);
|
mm_get_uint_from_match_info (info, 2, &type);
|
||||||
mm_get_uint_from_match_info (info, 3, &validity);
|
mm_get_uint_from_match_info (info, 3, &validity);
|
||||||
|
|
||||||
mm_dbg ("[%s:%d] CLIP regex => number:'%s', type:'%d', validity:'%d'", __func__, __LINE__, str, type, validity);
|
mm_dbg ("Caller ID received: number '%s', type '%d', validity '%d'", str, type, validity);
|
||||||
|
|
||||||
mm_iface_modem_voice_update_incoming_call_number(MM_IFACE_MODEM_VOICE(self), str, type, validity);
|
mm_iface_modem_voice_update_incoming_call_number (MM_IFACE_MODEM_VOICE (self), str, type, validity);
|
||||||
|
|
||||||
g_free(str);
|
g_free (str);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -6329,11 +6333,8 @@ nocarrier_received (MMPortSerialAt *port,
|
|||||||
GMatchInfo *info,
|
GMatchInfo *info,
|
||||||
MMBroadbandModem *self)
|
MMBroadbandModem *self)
|
||||||
{
|
{
|
||||||
//Do not match anything from regex
|
mm_dbg ("No carrier");
|
||||||
(void)info;
|
mm_iface_modem_voice_network_hangup (MM_IFACE_MODEM_VOICE (self));
|
||||||
|
|
||||||
mm_dbg ("[%s:%d]", __func__, __LINE__);
|
|
||||||
mm_iface_modem_voice_network_hangup(MM_IFACE_MODEM_VOICE(self));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -6466,7 +6467,6 @@ ring_response_processor (MMBaseModem *self,
|
|||||||
static const MMBaseModemAtCommand ring_sequence[] = {
|
static const MMBaseModemAtCommand ring_sequence[] = {
|
||||||
/* Show caller number on RING. */
|
/* Show caller number on RING. */
|
||||||
{ "+CLIP=1", 3, FALSE, ring_response_processor },
|
{ "+CLIP=1", 3, FALSE, ring_response_processor },
|
||||||
|
|
||||||
/* Show difference between data call and voice call */
|
/* Show difference between data call and voice call */
|
||||||
{ "+CRC=1", 3, FALSE, ring_response_processor },
|
{ "+CRC=1", 3, FALSE, ring_response_processor },
|
||||||
{ NULL }
|
{ NULL }
|
||||||
|
@@ -49,19 +49,18 @@ mm_iface_modem_voice_create_call (MMIfaceModemVoice *self)
|
|||||||
MMBaseCall *
|
MMBaseCall *
|
||||||
mm_iface_modem_voice_create_incoming_call (MMIfaceModemVoice *self)
|
mm_iface_modem_voice_create_incoming_call (MMIfaceModemVoice *self)
|
||||||
{
|
{
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
MMCallList *list = NULL;
|
MMCallList *list = NULL;
|
||||||
|
|
||||||
g_object_get (MM_BASE_MODEM (self),
|
g_object_get (MM_BASE_MODEM (self),
|
||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( list ) {
|
if (list) {
|
||||||
|
call = mm_call_list_get_new_incoming (list);
|
||||||
|
|
||||||
call = mm_call_list_get_new_incoming(list);
|
if (!call) {
|
||||||
if( !call ) {
|
mm_dbg("Incoming call does not exist; create it");
|
||||||
|
|
||||||
mm_dbg("[%s:%d] Incoming call does not exist; create it", __func__, __LINE__);
|
|
||||||
|
|
||||||
call = mm_base_call_new (MM_BASE_MODEM (self));
|
call = mm_base_call_new (MM_BASE_MODEM (self));
|
||||||
g_object_set (call,
|
g_object_set (call,
|
||||||
@@ -72,13 +71,10 @@ mm_iface_modem_voice_create_incoming_call (MMIfaceModemVoice *self)
|
|||||||
|
|
||||||
/* Only export once properly created */
|
/* Only export once properly created */
|
||||||
mm_base_call_export (call);
|
mm_base_call_export (call);
|
||||||
mm_dbg ("[%s:%d] New call exported to DBUS", __func__, __LINE__);
|
mm_dbg ("New call exported to DBus");
|
||||||
|
|
||||||
mm_call_list_add_call(list, call);
|
mm_call_list_add_call (list, call);
|
||||||
mm_dbg ("[%s:%d] Call added to list", __func__, __LINE__);
|
mm_dbg ("Call added to the list");
|
||||||
|
|
||||||
} else {
|
|
||||||
// mm_dbg("[%s:%d] Incoming call already exist. Do nothing", __func__, __LINE__);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
g_object_unref (list);
|
g_object_unref (list);
|
||||||
@@ -87,7 +83,11 @@ mm_iface_modem_voice_create_incoming_call (MMIfaceModemVoice *self)
|
|||||||
return call;
|
return call;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mm_iface_modem_voice_update_incoming_call_number (MMIfaceModemVoice *self, gchar *number, guint type, guint validity)
|
gboolean
|
||||||
|
mm_iface_modem_voice_update_incoming_call_number (MMIfaceModemVoice *self,
|
||||||
|
gchar *number,
|
||||||
|
guint type,
|
||||||
|
guint validity)
|
||||||
{
|
{
|
||||||
gboolean updated = FALSE;
|
gboolean updated = FALSE;
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
@@ -97,27 +97,30 @@ gboolean mm_iface_modem_voice_update_incoming_call_number (MMIfaceModemVoice *se
|
|||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( list ) {
|
if (list) {
|
||||||
|
call = mm_call_list_get_new_incoming (list);
|
||||||
|
|
||||||
call = mm_call_list_get_new_incoming(list);
|
if (call) {
|
||||||
if( call ) {
|
|
||||||
g_object_set (call, "number", number, NULL);
|
g_object_set (call, "number", number, NULL);
|
||||||
mm_gdbus_call_set_number(MM_GDBUS_CALL (call), number);
|
mm_gdbus_call_set_number (MM_GDBUS_CALL (call), number);
|
||||||
|
|
||||||
//TODO: Maybe also this parameters should be used
|
/*
|
||||||
(void)type;
|
* TODO: Maybe also this parameters should be used:
|
||||||
(void)validity;
|
* - type
|
||||||
|
* - validity
|
||||||
|
*/
|
||||||
|
|
||||||
updated = TRUE;
|
updated = TRUE;
|
||||||
} else {
|
} else {
|
||||||
mm_dbg("[%s:%d] Incoming call does not exist yet", __func__, __LINE__);
|
mm_dbg ("Incoming call does not exist yet");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mm_iface_modem_voice_call_dialing_to_ringing(MMIfaceModemVoice *self)
|
gboolean
|
||||||
|
mm_iface_modem_voice_call_dialing_to_ringing (MMIfaceModemVoice *self)
|
||||||
{
|
{
|
||||||
gboolean updated = FALSE;
|
gboolean updated = FALSE;
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
@@ -127,22 +130,22 @@ gboolean mm_iface_modem_voice_call_dialing_to_ringing(MMIfaceModemVoice *self)
|
|||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( list ) {
|
if (list) {
|
||||||
|
call = mm_call_list_get_first_outgoing_dialing_call (list);
|
||||||
call = mm_call_list_get_first_outgoing_dialing_call(list);
|
|
||||||
if( call ) {
|
|
||||||
mm_base_call_change_state(call, MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED);
|
|
||||||
|
|
||||||
|
if (call) {
|
||||||
|
mm_base_call_change_state (call, MM_CALL_STATE_RINGING_OUT, MM_CALL_STATE_REASON_OUTGOING_STARTED);
|
||||||
updated = TRUE;
|
updated = TRUE;
|
||||||
} else {
|
} else {
|
||||||
mm_dbg("[%s:%d] Outgoing dialing call does not exist", __func__, __LINE__);
|
mm_dbg ("Outgoing dialing call does not exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mm_iface_modem_voice_call_ringing_to_active(MMIfaceModemVoice *self)
|
gboolean
|
||||||
|
mm_iface_modem_voice_call_ringing_to_active (MMIfaceModemVoice *self)
|
||||||
{
|
{
|
||||||
gboolean updated = FALSE;
|
gboolean updated = FALSE;
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
@@ -152,22 +155,22 @@ gboolean mm_iface_modem_voice_call_ringing_to_active(MMIfaceModemVoice *self)
|
|||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( list ) {
|
if (list) {
|
||||||
|
call = mm_call_list_get_first_ringing_call (list);
|
||||||
call = mm_call_list_get_first_ringing_call(list);
|
|
||||||
if( call ) {
|
|
||||||
mm_base_call_change_state(call, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED);
|
|
||||||
|
|
||||||
|
if (call) {
|
||||||
|
mm_base_call_change_state (call, MM_CALL_STATE_ACTIVE, MM_CALL_STATE_REASON_ACCEPTED);
|
||||||
updated = TRUE;
|
updated = TRUE;
|
||||||
} else {
|
} else {
|
||||||
mm_dbg("[%s:%d] Ringing call does not exist", __func__, __LINE__);
|
mm_dbg ("Ringing call does not exist");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self)
|
gboolean
|
||||||
|
mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self)
|
||||||
{
|
{
|
||||||
gboolean updated = FALSE;
|
gboolean updated = FALSE;
|
||||||
MMBaseCall *call = NULL;
|
MMBaseCall *call = NULL;
|
||||||
@@ -177,22 +180,23 @@ gboolean mm_iface_modem_voice_network_hangup (MMIfaceModemVoice *self)
|
|||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( list ) {
|
if (list) {
|
||||||
|
call = mm_call_list_get_first_non_terminated_call (list);
|
||||||
call = mm_call_list_get_first_non_terminated_call(list);
|
|
||||||
if( call ) {
|
|
||||||
mm_base_call_change_state(call, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED);
|
|
||||||
|
|
||||||
|
if (call) {
|
||||||
|
mm_base_call_change_state (call, MM_CALL_STATE_TERMINATED, MM_CALL_STATE_REASON_TERMINATED);
|
||||||
updated = TRUE;
|
updated = TRUE;
|
||||||
} else {
|
} else {
|
||||||
mm_dbg("[%s:%d] No call to hangup", __func__, __LINE__);
|
mm_dbg ("No call to hangup");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
}
|
}
|
||||||
|
|
||||||
gboolean mm_iface_modem_voice_received_dtmf (MMIfaceModemVoice *self, gchar *tone)
|
gboolean
|
||||||
|
mm_iface_modem_voice_received_dtmf (MMIfaceModemVoice *self,
|
||||||
|
gchar *tone)
|
||||||
{
|
{
|
||||||
gboolean updated = FALSE;
|
gboolean updated = FALSE;
|
||||||
MMCallList *list = NULL;
|
MMCallList *list = NULL;
|
||||||
@@ -201,8 +205,8 @@ gboolean mm_iface_modem_voice_received_dtmf (MMIfaceModemVoice *self, gchar *ton
|
|||||||
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
MM_IFACE_MODEM_VOICE_CALL_LIST, &list,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
if( list ) {
|
if (list) {
|
||||||
updated = mm_call_list_send_dtmf_to_active_calls(list, tone);
|
updated = mm_call_list_send_dtmf_to_active_calls (list, tone);
|
||||||
}
|
}
|
||||||
|
|
||||||
return updated;
|
return updated;
|
||||||
@@ -369,8 +373,8 @@ handle_create_auth_ready (MMBaseModem *self,
|
|||||||
}
|
}
|
||||||
|
|
||||||
call = mm_base_call_new_from_properties (MM_BASE_MODEM (self),
|
call = mm_base_call_new_from_properties (MM_BASE_MODEM (self),
|
||||||
properties,
|
properties,
|
||||||
&error);
|
&error);
|
||||||
if (!call) {
|
if (!call) {
|
||||||
g_object_unref (properties);
|
g_object_unref (properties);
|
||||||
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
g_dbus_method_invocation_take_error (ctx->invocation, error);
|
||||||
@@ -397,8 +401,8 @@ handle_create_auth_ready (MMBaseModem *self,
|
|||||||
|
|
||||||
/* Complete the DBus call */
|
/* Complete the DBus call */
|
||||||
mm_gdbus_modem_voice_complete_create_call (ctx->skeleton,
|
mm_gdbus_modem_voice_complete_create_call (ctx->skeleton,
|
||||||
ctx->invocation,
|
ctx->invocation,
|
||||||
mm_base_call_get_path (call));
|
mm_base_call_get_path (call));
|
||||||
g_object_unref (call);
|
g_object_unref (call);
|
||||||
|
|
||||||
g_object_unref (properties);
|
g_object_unref (properties);
|
||||||
@@ -466,9 +470,9 @@ handle_list (MmGdbusModemVoice *skeleton,
|
|||||||
}
|
}
|
||||||
|
|
||||||
paths = mm_call_list_get_paths (list);
|
paths = mm_call_list_get_paths (list);
|
||||||
mm_gdbus_modem_voice_complete_list_calls(skeleton,
|
mm_gdbus_modem_voice_complete_list_calls (skeleton,
|
||||||
invocation,
|
invocation,
|
||||||
(const gchar *const *)paths);
|
(const gchar *const *)paths);
|
||||||
g_strfreev (paths);
|
g_strfreev (paths);
|
||||||
g_object_unref (list);
|
g_object_unref (list);
|
||||||
return TRUE;
|
return TRUE;
|
||||||
@@ -483,7 +487,7 @@ update_message_list (MmGdbusModemVoice *skeleton,
|
|||||||
gchar **paths;
|
gchar **paths;
|
||||||
|
|
||||||
paths = mm_call_list_get_paths (list);
|
paths = mm_call_list_get_paths (list);
|
||||||
mm_gdbus_modem_voice_set_calls(skeleton, (const gchar *const *)paths);
|
mm_gdbus_modem_voice_set_calls (skeleton, (const gchar *const *)paths);
|
||||||
g_strfreev (paths);
|
g_strfreev (paths);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -494,7 +498,7 @@ call_added (MMCallList *list,
|
|||||||
{
|
{
|
||||||
mm_dbg ("Added CALL at '%s'", call_path);
|
mm_dbg ("Added CALL at '%s'", call_path);
|
||||||
update_message_list (skeleton, list);
|
update_message_list (skeleton, list);
|
||||||
mm_gdbus_modem_voice_emit_call_added(skeleton, call_path);
|
mm_gdbus_modem_voice_emit_call_added (skeleton, call_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
@@ -504,7 +508,7 @@ call_deleted (MMCallList *list,
|
|||||||
{
|
{
|
||||||
mm_dbg ("Deleted CALL at '%s'", call_path);
|
mm_dbg ("Deleted CALL at '%s'", call_path);
|
||||||
update_message_list (skeleton, list);
|
update_message_list (skeleton, list);
|
||||||
mm_gdbus_modem_voice_emit_call_deleted(skeleton, call_path);
|
mm_gdbus_modem_voice_emit_call_deleted (skeleton, call_path);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
@@ -539,8 +543,8 @@ disabling_context_complete_and_free (DisablingContext *ctx)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_iface_modem_voice_disable_finish (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_disable_finish (MMIfaceModemVoice *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
@@ -634,8 +638,8 @@ interface_disabling_step (DisablingContext *ctx)
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_iface_modem_voice_disable (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_disable (MMIfaceModemVoice *self,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
DisablingContext *ctx;
|
DisablingContext *ctx;
|
||||||
|
|
||||||
@@ -710,8 +714,8 @@ enabling_context_complete_and_free_if_cancelled (EnablingContext *ctx)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_iface_modem_voice_enable_finish (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_enable_finish (MMIfaceModemVoice *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
@@ -823,9 +827,9 @@ interface_enabling_step (EnablingContext *ctx)
|
|||||||
|
|
||||||
void
|
void
|
||||||
mm_iface_modem_voice_enable (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_enable (MMIfaceModemVoice *self,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
EnablingContext *ctx;
|
EnablingContext *ctx;
|
||||||
|
|
||||||
@@ -905,8 +909,8 @@ check_support_ready (MMIfaceModemVoice *self,
|
|||||||
GError *error = NULL;
|
GError *error = NULL;
|
||||||
|
|
||||||
if (!MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support_finish (self,
|
if (!MM_IFACE_MODEM_VOICE_GET_INTERFACE (self)->check_support_finish (self,
|
||||||
res,
|
res,
|
||||||
&error)) {
|
&error)) {
|
||||||
if (error) {
|
if (error) {
|
||||||
/* This error shouldn't be treated as critical */
|
/* This error shouldn't be treated as critical */
|
||||||
mm_dbg ("Voice support check failed: '%s'", error->message);
|
mm_dbg ("Voice support check failed: '%s'", error->message);
|
||||||
@@ -1003,7 +1007,7 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
|
|
||||||
/* Finally, export the new interface */
|
/* Finally, export the new interface */
|
||||||
mm_gdbus_object_skeleton_set_modem_voice (MM_GDBUS_OBJECT_SKELETON (ctx->self),
|
mm_gdbus_object_skeleton_set_modem_voice (MM_GDBUS_OBJECT_SKELETON (ctx->self),
|
||||||
MM_GDBUS_MODEM_VOICE (ctx->skeleton));
|
MM_GDBUS_MODEM_VOICE (ctx->skeleton));
|
||||||
|
|
||||||
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
g_simple_async_result_set_op_res_gboolean (ctx->result, TRUE);
|
||||||
initialization_context_complete_and_free (ctx);
|
initialization_context_complete_and_free (ctx);
|
||||||
@@ -1015,17 +1019,17 @@ interface_initialization_step (InitializationContext *ctx)
|
|||||||
|
|
||||||
gboolean
|
gboolean
|
||||||
mm_iface_modem_voice_initialize_finish (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_initialize_finish (MMIfaceModemVoice *self,
|
||||||
GAsyncResult *res,
|
GAsyncResult *res,
|
||||||
GError **error)
|
GError **error)
|
||||||
{
|
{
|
||||||
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
return !g_simple_async_result_propagate_error (G_SIMPLE_ASYNC_RESULT (res), error);
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
mm_iface_modem_voice_initialize (MMIfaceModemVoice *self,
|
mm_iface_modem_voice_initialize (MMIfaceModemVoice *self,
|
||||||
GCancellable *cancellable,
|
GCancellable *cancellable,
|
||||||
GAsyncReadyCallback callback,
|
GAsyncReadyCallback callback,
|
||||||
gpointer user_data)
|
gpointer user_data)
|
||||||
{
|
{
|
||||||
InitializationContext *ctx;
|
InitializationContext *ctx;
|
||||||
MmGdbusModemVoice *skeleton = NULL;
|
MmGdbusModemVoice *skeleton = NULL;
|
||||||
@@ -1110,9 +1114,9 @@ mm_iface_modem_voice_get_type (void)
|
|||||||
};
|
};
|
||||||
|
|
||||||
iface_modem_voice_type = g_type_register_static (G_TYPE_INTERFACE,
|
iface_modem_voice_type = g_type_register_static (G_TYPE_INTERFACE,
|
||||||
"MMIfaceModemVoice",
|
"MMIfaceModemVoice",
|
||||||
&info,
|
&info,
|
||||||
0);
|
0);
|
||||||
|
|
||||||
g_type_interface_add_prerequisite (iface_modem_voice_type, MM_TYPE_IFACE_MODEM);
|
g_type_interface_add_prerequisite (iface_modem_voice_type, MM_TYPE_IFACE_MODEM);
|
||||||
}
|
}
|
||||||
|
@@ -85,10 +85,10 @@ GArray *mm_filter_supported_capabilities (MMModemCapability all,
|
|||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* VOICE specific helpers and utilities */
|
/* VOICE specific helpers and utilities */
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
GRegex *mm_voice_ring_regex_get (void);
|
GRegex *mm_voice_ring_regex_get (void);
|
||||||
GRegex *mm_voice_cring_regex_get(void);
|
GRegex *mm_voice_cring_regex_get(void);
|
||||||
GRegex *mm_voice_clip_regex_get (void);
|
GRegex *mm_voice_clip_regex_get (void);
|
||||||
GRegex *mm_voice_nocarrier_regex_get (void);
|
GRegex *mm_voice_nocarrier_regex_get (void);
|
||||||
|
|
||||||
/*****************************************************************************/
|
/*****************************************************************************/
|
||||||
/* 3GPP specific helpers and utilities */
|
/* 3GPP specific helpers and utilities */
|
||||||
|
Reference in New Issue
Block a user