## CallsOrigin

CallsOrigin — An object that originates calls.

## Functions

void | (*CallsOriginForeachCallFunc) ()
char * | calls_origin_get_name ()
char * | calls_origin_get_id ()
GList * | calls_origin_get_calls ()
void | calls_origin_foreach_call ()
void | calls_origin_dial ()
gboolean | calls_origin_supports_protocol ()
GStrv | calls_origin_get_emergency_numbers ()
const char * | calls_origin_get_country_code ()
const char * | calls_origin_get_network_country_code ()

## Properties

gpointer | calls | Read
char * | country-code | Read
GStrv | emergency-numbers | Read
char * | id | Read / Write / Construct Only
char * | name | Read

## Signals

void | call-added | Run Last
void | call-removed | Run Last

## Types and Values

#define | CALLS_TYPE_ORIGIN
struct | CallsOriginInterface
| CallsOrigin

## Object Hierarchy

        GInterface
        ╰── CallsOrigin

## Prerequisites

CallsOrigin requires CallsMessageSource and GObject.

## Known Derived Interfaces

CallsOrigin is required by CallsAccount.

## Description

## Functions

### CallsOriginForeachCallFunc ()

    void
    (*CallsOriginForeachCallFunc) (gpointer param,
                                   CallsCall *call,
                                   CallsOrigin *origin);

### calls_origin_get_name ()

    char *
    calls_origin_get_name (CallsOrigin *self);

Get the user-presentable name of the origin.

Returns (transfer full): A string containing the name. The string must be freed by the caller.

#### Parameters

self | a CallsOrigin |

### calls_origin_get_id ()

    char *
    calls_origin_get_id (CallsOrigin *self);

Get the id of the origin.

Returns (transfer full): A string containing the id. The string must be freed by the caller.

#### Parameters

self | a CallsOrigin |

### calls_origin_get_calls ()

    GList *
    calls_origin_get_calls (CallsOrigin *self);

Get the list of current calls.

#### Parameters

self | a CallsOrigin |

#### Returns

A newly-allocated GList of objects implementing CallsCall or NULL if there was an error.

[transfer container]

### calls_origin_foreach_call ()

    void
    calls_origin_foreach_call (CallsOrigin *self,
                               CallsOriginForeachCallFunc callback,
                               gpointer param);

Iterate over all current calls from this origin

#### Parameters

self | a CallsOrigin |
callback | function to be called for each call from the origin |
param | user data for `callback` |

### calls_origin_dial ()

    void
    calls_origin_dial (CallsOrigin *self,
                       const char *number);

Dial a new number from this origin. If a new call is successfully created, the call-added signal will be emitted with the call. If there is an error, an appropriate message signal will be emitted.

#### Parameters

self | a CallsOrigin |
number | the number to dial |

### calls_origin_supports_protocol ()

    gboolean
    calls_origin_supports_protocol (CallsOrigin *self,
                                    const char *protocol);

#### Parameters

self | A CallsOrigin |
protocol | The protocol to check support for |

#### Returns

`TRUE` if the origin supports the protocol, `FALSE` otherwise

### calls_origin_get_emergency_numbers ()

    GStrv
    calls_origin_get_emergency_numbers (CallsOrigin *self);

#### Parameters

self | a CallsOrigin |

#### Returns

The supported emergency numbers.

[transfer full]

### calls_origin_get_country_code ()

    const char *
    calls_origin_get_country_code (CallsOrigin *self);

#### Parameters

self | A CallsOrigin |

#### Returns

The iso country code.

[nullable]

### calls_origin_get_network_country_code ()

    const char *
    calls_origin_get_network_country_code (CallsOrigin *self);

Gets the country code of the mobile network we're currently connected to.

#### Parameters

self | A CallsOrigin |

#### Returns

The country code.

[nullable]

## Types and Values

### CALLS_TYPE_ORIGIN

    #define CALLS_TYPE_ORIGIN (calls_origin_get_type ())

### struct CallsOriginInterface

    struct CallsOriginInterface {
      GTypeInterface parent_iface;

      void           (*dial)                                (CallsOrigin *self,
                                                             const char  *number);
      gboolean       (*supports_protocol)                   (CallsOrigin *self,
                                                             const char  *protocol);
      const char *   (*get_country_code)                    (CallsOrigin *self);
      /* TODO: should we have an additional CALLS_MODEM_ORIGIN interface for modems? */
      const char *   (*get_network_country_code)            (CallsOrigin *self);
    };

### CallsOrigin

    typedef struct _CallsOrigin CallsOrigin;

## Property Details

### The `“calls”` property

      “calls”                    gpointer

The list of current calls.

Owner: CallsOrigin

Flags: Read

### The `“country-code”` property

      “country-code”             char *

The country code of the origin, if any.

Owner: CallsOrigin

Flags: Read

Default value: NULL

### The `“emergency-numbers”` property

      “emergency-numbers”        GStrv

The available emergency numbers.

Owner: CallsOrigin

Flags: Read

### The `“id”` property

      “id”                       char *

ID of the origin.

Owner: CallsOrigin

Flags: Read / Write / Construct Only

Default value: NULL

### The `“name”` property

      “name”                     char *

The name of the origin.

Owner: CallsOrigin

Flags: Read

Default value: NULL

## Signal Details

### The `“call-added”` signal

    void
    user_function (CallsOrigin *callsorigin,
                   CallsCall   *arg1,
                   gpointer     user_data)

Flags: Run Last

### The `“call-removed”` signal

    void
    user_function (CallsOrigin *callsorigin,
                   CallsCall   *arg1,
                   char        *arg2,
                   gpointer     user_data)

Flags: Run Last