CallsCall

CallsCall — A call.

Functions

Properties

char * id Read / Write / Construct
gboolean inbound Read / Write / Construct Only
char * name Read / Write
char * protocol Read
gboolean silenced Read
CallsCallState state Read / Write

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 id, name and a state. Only the state changes after creation. If the state is CALLS_CALL_STATE_INCOMING, the call can be answered with calls_call_answer. The call can also be hung up at any time with calls_call_hang_up.

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

Functions

calls_call_get_id ()

const char *
calls_call_get_id (CallsCall *self);

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

Parameters

self

a CallsCall

 

Returns

the id, or NULL.

[transfer none]


calls_call_set_id ()

void
calls_call_set_id (CallsCall *self,
                   const char *id);

Set the id of the call. Some implementations might only be able to set the id after construction.

Parameters

self

a CallsCall

 

id

the id of the remote party

 

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.

Returns the id, or NULL

Parameters

self

a CallsCall

 

calls_call_set_name ()

void
calls_call_set_name (CallsCall *self,
                     const char *name);

Sets the name of the call as provided by the network.

Parameters

self

a CallsCall

 

name

the name to set

 

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_set_state ()

void
calls_call_set_state (CallsCall *self,
                      CallsCallState state);

Set the current state of the call.

Parameters

self

a CallsCall

 

state

a CallsCallState

 

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_get_protocol ()

const char *
calls_call_get_protocol (CallsCall *self);

Get the protocol of the call (i.e. "tel", "sip")

Parameters

self

a CallsCall

 

Returns

The protocol used or NULL when unknown


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_can_dtmf ()

gboolean
calls_call_can_dtmf (CallsCall *self);

Parameters

self

a CallsCall

 

Returns

TRUE if this call supports DTMF, FALSE otherwise


calls_call_send_dtmf_tone ()

void
calls_call_send_dtmf_tone (CallsCall *self,
                           char key);

Start playing a DTMF tone for the specified key. Implementations will stop playing the tone either after an implementation-specific timeout.

Parameters

self

a CallsCall

 

key

which tone to start

 

calls_call_get_contact ()

CallsBestMatch *
calls_call_get_contact (CallsCall *self);

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

Parameters

self

a CallsCall

 

Returns

A CallsBestMatch.

[transfer full]


calls_call_silence_ring ()

void
calls_call_silence_ring (CallsCall *self);

Inhibit ringing

Parameters

self

a CallsCall

 

calls_call_get_silenced ()

gboolean
calls_call_get_silenced (CallsCall *self);

Parameters

self

a CallsCall

 

Returns

TRUE if call has been silenced to not ring, FALSE otherwise


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_UNKNOWN

   

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_protocol)         (CallsCall *self);
  void            (*answer)               (CallsCall *self);
  void            (*hang_up)              (CallsCall *self);
  void            (*send_dtmf_tone)       (CallsCall *self,
                                           char       key);
};

CallsCall

typedef struct _CallsCall CallsCall;

Property Details

The “id” property

  “id”                       char *

The id the call is connected to if known.

Owner: CallsCall

Flags: Read / Write / Construct

Default value: NULL


The “inbound” property

  “inbound”                  gboolean

Whether the call is inbound.

Owner: CallsCall

Flags: Read / Write / Construct Only

Default value: FALSE


The “name” property

  “name”                     char *

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

Owner: CallsCall

Flags: Read / Write

Default value: NULL


The “protocol” property

  “protocol”                 char *

The protocol used for this call.

Owner: CallsCall

Flags: Read

Default value: NULL


The “silenced” property

  “silenced”                 gboolean

Whether the call ringing should be silenced.

Owner: CallsCall

Flags: Read

Default value: FALSE


The “state” property

  “state”                    CallsCallState

The current state of the call.

Owner: CallsCall

Flags: Read / Write

Default value: CALLS_CALL_STATE_UNKNOWN

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