CallsCall

CallsCall — A call.

Functions

Properties

gboolean inbound Read
gchar * name Read
gchar * number Read
CallsCallState state Read

Signals

void state-changed Run Last

Types and Values

Object Hierarchy

    GEnum
    ╰── CallsCallState
    GObject
    ╰── CallsCall

Description

This is the interface to a call. It has a number, name and a state. Only the state changes after creation. If the state is CALL_CALL_STATE_INCOMING, the call can be answered with answer. The call can also be hung up at any time with hang_up.

DTMF tones can be played the call using tone_start and tone_stop. Valid characters for the key are 0-9, '*', '#', 'A', 'B', 'C' and 'D'.

Functions

calls_call_get_number ()

const char *
calls_call_get_number (CallsCall *self);

Get the number the call is connected to. It is possible that this could return NULL if the number is not known, for example if an incoming PTSN call has no caller ID information.

Parameters

self

a CallsCall

 

Returns

the number, or NULL


calls_call_get_name ()

const char *
calls_call_get_name (CallsCall *self);

Get the name of the party the call is connected to, if the network provides it.

Parameters

self

a CallsCall

 

Returns

the number, or NULL


calls_call_get_state ()

CallsCallState
calls_call_get_state (CallsCall *self);

Get the current state of the call.

Parameters

self

a CallsCall

 

Returns

the state


calls_call_get_inbound ()

gboolean
calls_call_get_inbound (CallsCall *self);

Get the direction of the call.

Parameters

self

a CallsCall

 

Returns

TRUE if inbound, FALSE if outbound.


calls_call_answer ()

void
calls_call_answer (CallsCall *self);

If the call is incoming, answer it.

Parameters

self

a CallsCall

 

calls_call_hang_up ()

void
calls_call_hang_up (CallsCall *self);

Hang up the call.

Parameters

self

a CallsCall

 

calls_call_tone_start ()

void
calls_call_tone_start (CallsCall *self,
                       gchar key);

Start playing a DTMF tone for the specified key. Implementations will stop playing the tone either after an implementation-specific timeout, or after calls_call_tone_stop is called with the same value for key .

Parameters

self

a CallsCall

 

key

which tone to start

 

calls_call_tone_stoppable ()

gboolean
calls_call_tone_stoppable (CallsCall *self);

Determine whether tones for this call can be stopped by calling calls_call_tone_stop. Some implementations will only allow fixed-length tones to be played. In that case, this function should return FALSE.

Parameters

self

a CallsCall

 

Returns

whether calls to calls_call_tone_stop will do anything


calls_call_tone_stop ()

void
calls_call_tone_stop (CallsCall *self,
                      gchar key);

Stop playing a DTMF tone previously started with calls_call_tone_start.

Parameters

self

a CallsCall

 

key

which tone to stop

 

calls_call_get_contact ()

CallsBestMatch *
calls_call_get_contact (CallsCall *self);

This a convenience function to optain the CallsBestMatch matching the phone number of the CallsCall.

Parameters

self

a CallsCall

 

Returns

A CallsBestMatch.

[transfer: full]


calls_call_state_to_string ()

void
calls_call_state_to_string (GString *string,
                            CallsCallState state);

calls_call_state_parse_nick ()

gboolean
calls_call_state_parse_nick (CallsCallState *state,
                             const char *nick);

Types and Values

CALLS_TYPE_CALL

#define CALLS_TYPE_CALL (calls_call_get_type ())

enum CallsCallState

Members

CALLS_CALL_STATE_ACTIVE

   

CALLS_CALL_STATE_HELD

   

CALLS_CALL_STATE_DIALING

   

CALLS_CALL_STATE_ALERTING

   

CALLS_CALL_STATE_INCOMING

   

CALLS_CALL_STATE_WAITING

   

CALLS_CALL_STATE_DISCONNECTED

   

struct CallsCallClass

struct CallsCallClass {
  GObjectClass parent_iface;

  const char     *(*get_number)           (CallsCall *self);
  const char     *(*get_name)             (CallsCall *self);
  CallsCallState  (*get_state)            (CallsCall *self);
  gboolean        (*get_inbound)          (CallsCall *self);
  void            (*answer)               (CallsCall *self);
  void            (*hang_up)              (CallsCall *self);
  void            (*tone_start)           (CallsCall *self,
                                           char       key);
  void            (*tone_stop)            (CallsCall *self,
                                           char       key);
};

CallsCall

typedef struct _CallsCall CallsCall;

Property Details

The “inbound” property

  “inbound”                  gboolean

Whether the call is inbound.

Flags: Read

Default value: FALSE


The “name” property

  “name”                     gchar *

The name of the party the call is connected to, if the network provides it.

Flags: Read

Default value: NULL


The “number” property

  “number”                   gchar *

The number the call is connected to if known.

Flags: Read

Default value: NULL


The “state” property

  “state”                    CallsCallState

The current state of the call.

Flags: Read

Default value: CALLS_CALL_STATE_ACTIVE

Signal Details

The “state-changed” signal

void
user_function (CallsCall     *self,
               CallsCallState new_state,
               CallsCallState old_state,
               gpointer       user_data)

This signal is emitted when the state of the call changes, for example when it's answered or when the call is disconnected.

Parameters

self

The CallsCall instance.

 

new_state

The new state of the call.

 

old_state

The old state of the call.

 

user_data

user data set when the signal handler was connected.

 

Flags: Run Last