GamiManager

GamiManager — An GObject based implementation of the Asterisk Manager Interface

Stability Level

Unstable, unless otherwise indicated

Synopsis


#include <gami.h>

                    GamiManager;
                    GamiManagerClass;
void                (*GamiResponseFunc)                 (GamiResponse *response,
                                                         gpointer user_data);
void                (*GamiManagerNewAsyncFunc)          (GamiManager *gami,
                                                         gpointer user_data);
enum                GamiEventMask;
enum                GamiModuleLoadType;
GamiManager *       gami_manager_new                    (const gchar *host,
                                                         const gchar *port);
void                gami_manager_new_async              (const gchar *host,
                                                         const gchar *port,
                                                         GamiManagerNewAsyncFunc func,
                                                         gpointer user_data);
gboolean            gami_manager_connect                (GamiManager *ami,
                                                         GError **error);

GamiResponse *      gami_manager_login                  (GamiManager *ami,
                                                         const gchar *username,
                                                         const gchar *secret,
                                                         const gchar *auth_type,
                                                         GamiEventMask events,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_logoff                 (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_challenge              (GamiManager *ami,
                                                         const gchar *auth_type,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_absolute_timeout       (GamiManager *ami,
                                                         const gchar *channel,
                                                         gint timeout,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_agi                    (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *command,
                                                         const gchar *command_id,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_bridge                 (GamiManager *ami,
                                                         const gchar *channel1,
                                                         const gchar *channel2,
                                                         gboolean tone,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_hangup                 (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_originate              (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *application_exten,
                                                         const gchar *data_context,
                                                         const gchar *priority,
                                                         guint timeout,
                                                         const gchar *caller_id,
                                                         const gchar *account,
                                                         const GHashTable *variables,
                                                         gboolean async,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_redirect               (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *extra_channel,
                                                         const gchar *exten,
                                                         const gchar *context,
                                                         const gchar *priority,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_set_cdr_user_field     (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *user_field,
                                                         gboolean append,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_mailbox_count          (GamiManager *ami,
                                                         const gchar *mailbox,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_mailbox_status         (GamiManager *ami,
                                                         const gchar *mailbox,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_voicemail_users_list   (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_meetme_list            (GamiManager *ami,
                                                         const gchar *meetme,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_meetme_mute            (GamiManager *ami,
                                                         const gchar *meetme,
                                                         const gchar *user_num,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_meetme_unmute          (GamiManager *ami,
                                                         const gchar *meetme,
                                                         const gchar *user_num,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_monitor                (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *file,
                                                         const gchar *format,
                                                         gboolean mix,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_change_monitor         (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *file,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_pause_monitor          (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_unpause_monitor        (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_stop_monitor           (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_queue_add              (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         guint penalty,
                                                         gboolean paused,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_queue_log              (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *event,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_queue_pause            (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         gboolean paused,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_queue_penalty          (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         guint penalty,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_queue_remove           (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_queue_summary          (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_agent_callback_login   (GamiManager *ami,
                                                         const gchar *agent,
                                                         const gchar *exten,
                                                         const gchar *context,
                                                         gboolean ack_call,
                                                         guint wrapup_time,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_agent_logoff           (GamiManager *ami,
                                                         const gchar *agent,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_agents                 (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_park                   (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *channel2,
                                                         guint timeout,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_parked_calls           (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_get_var                (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *variable,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_set_var                (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *variable,
                                                         const gchar *value,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_db_del                 (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *key,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_db_del_tree            (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_db_get                 (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *key,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_db_put                 (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *key,
                                                         const gchar *val,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_sip_peers              (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_sip_show_peer          (GamiManager *ami,
                                                         const gchar *peer,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_sip_show_registry      (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_iax_peer_list          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_dahdi_dial_offhook     (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *number,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_dahdi_dnd_off          (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_dahdi_dnd_on           (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_dahdi_hangup           (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_dahdi_restart          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_dahdi_show_channels    (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_dahdi_transfer         (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_zap_dial_offhook       (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *number,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_zap_dnd_off            (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_zap_dnd_on             (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_zap_hangup             (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_zap_restart            (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_zap_show_channels      (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_zap_transfer           (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_list_commands          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_core_settings          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_core_status            (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_core_show_channels     (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_status                 (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_ping                   (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_module_check           (GamiManager *ami,
                                                         const gchar *module,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_module_load            (GamiManager *ami,
                                                         const gchar *module,
                                                         GamiModuleLoadType load_type,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_reload                 (GamiManager *ami,
                                                         const gchar *module,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_extension_state        (GamiManager *ami,
                                                         const gchar *exten,
                                                         const gchar *context,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_send_text              (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *message,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_jabber_send            (GamiManager *ami,
                                                         const gchar *jabber,
                                                         const gchar *screen_name,
                                                         const gchar *message,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_play_dtmf              (GamiManager *ami,
                                                         const gchar *channel,
                                                         gchar digit,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_events                 (GamiManager *ami,
                                                         GamiEventMask event_mask,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_user_event             (GamiManager *ami,
                                                         const gchar *user_event,
                                                         const GHashTable *headers,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_wait_event             (GamiManager *ami,
                                                         guint timeout,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

GamiResponse *      gami_manager_list_categories        (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_get_config             (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_get_config_json        (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);
GamiResponse *      gami_manager_create_config          (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Object Hierarchy

  GObject
   +----GamiManager

Properties

  "host"                     gchar*                : Read / Write / Construct Only
  "port"                     gchar*                : Read / Write / Construct Only

Signals

  "connected"                                      : Run Last
  "disconnected"                                   : Run Last
  "event"                                          : Run Last

Description

GamiManager is an implementation of the Asterisk Manager Interface based on GObject. It supports both synchronious and asynchronious operation and integrates well with glib's signal / callback system.

Each manager action returns an GamiResponse and takes at least four parameters common to each action: An optional ActionID as supported by the underlying asterisk API, a callback function for asynchronious operation, optional user data to pass to said function and an optional GError to report underlying network errors. If used asynchroniously, the response will contain a boolean value indicating whether the action request was send successfully. Otherwise, the action response will be returned directly.

Asynchronious callbacks and events require the use of GMainLoop (or derived implementations as gtk_main().

Details

GamiManager

typedef struct _GamiManager GamiManager;

GamiManager represents a connection to an Asterisk server using the manager API. It is used to send actions to the server and receive responses and events.


GamiManagerClass

typedef struct {
    GObjectClass parent_class;
} GamiManagerClass;

The class structure for the GamiManager type

GObjectClass parent_class;

GamiManager's parent class (of type GObjectClass)

GamiResponseFunc ()

void                (*GamiResponseFunc)                 (GamiResponse *response,
                                                         gpointer user_data);

Specifies the type of functions passed as callback to manager actions

response :

the action's GamiResponse.

user_data :

user data passed to the action

GamiManagerNewAsyncFunc ()

void                (*GamiManagerNewAsyncFunc)          (GamiManager *gami,
                                                         gpointer user_data);

Specifies the type of functions passed to gami_manager_new_async()

gami :

the newly created GamiManager

user_data :

user data passed to the function

enum GamiEventMask

typedef enum
{
	GAMI_EVENT_MASK_NONE   = 0,
	GAMI_EVENT_MASK_CALL   = 1 << 0,
	GAMI_EVENT_MASK_CDR    = 1 << 1,
	GAMI_EVENT_MASK_SYSTEM = 1 << 2,
	GAMI_EVENT_MASK_AGENT  = 1 << 3,
	GAMI_EVENT_MASK_LOG    = 1 << 4,
	GAMI_EVENT_MASK_USER   = 1 << 5,
	GAMI_EVENT_MASK_ALL    = 1 << 6
} GamiEventMask;

Flag values to specify any events your application is interested in as passed to gami_manager_login() and gami_manager_events().

GAMI_EVENT_MASK_NONE

do not receive any events

GAMI_EVENT_MASK_CALL

do receive 'call' events

GAMI_EVENT_MASK_CDR

do receive 'cdr' events

GAMI_EVENT_MASK_SYSTEM

do receive 'system' events

GAMI_EVENT_MASK_AGENT

do receive 'agent' events

GAMI_EVENT_MASK_LOG

do receive 'log' events

GAMI_EVENT_MASK_USER

do receive 'user' events

GAMI_EVENT_MASK_ALL

do receive all events

enum GamiModuleLoadType

typedef enum {
	GAMI_MODULE_LOAD,
	GAMI_MODULE_RELOAD,
	GAMI_MODULE_UNLOAD
} GamiModuleLoadType;

An enum type used to determine the operation mode in gami_manager_module_load()

GAMI_MODULE_LOAD

use module operation 'load'

GAMI_MODULE_RELOAD

use module operation 'reload'

GAMI_MODULE_UNLOAD

use module operation 'unload'

gami_manager_new ()

GamiManager *       gami_manager_new                    (const gchar *host,
                                                         const gchar *port);

This function creates an instance of GAMI_TYPE_MANAGER connected to host:port.

host :

Asterisk manager host.

port :

Asterisk manager port.

Returns :

A new GamiManager

gami_manager_new_async ()

void                gami_manager_new_async              (const gchar *host,
                                                         const gchar *port,
                                                         GamiManagerNewAsyncFunc func,
                                                         gpointer user_data);

Asynchronously create a GamiManager connected to host:port. The new object will be passed as a parameter to func when finished.

host :

Asterisk manager host.

port :

Asterisk manager port.

func :

Callback function called when object has been created

user_data :

data to pass to func

gami_manager_connect ()

gboolean            gami_manager_connect                (GamiManager *ami,
                                                         GError **error);

Connect GamiManager with the Asterisk server defined by the object properties "host" and "port".

Note that it is not usually necessary to call this function, as it is called by gami_manager_new() and gami_manager_new_async(). Use it only in classes inheritting from GamiManager.

ami :

GamiManager

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_login ()

GamiResponse *      gami_manager_login                  (GamiManager *ami,
                                                         const gchar *username,
                                                         const gchar *secret,
                                                         const gchar *auth_type,
                                                         GamiEventMask events,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Authenticate to asterisk and open a new manager session

ami :

GamiManager

username :

Username to use for authentification

secret :

Password to use for authentification

auth_type :

AuthType to use for authentification - if set to "md5", secret is expected to contain an MD5 hash of the result string of gami_manager_challenge() and the user's password

events :

Flags of type GamiEventMask, indicating which events should be received initially. It is possible to modify this setting using the gami_manager_events() action

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_logoff ()

GamiResponse *      gami_manager_logoff                 (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Close the manager session and disconnect from asterisk

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_challenge ()

GamiResponse *      gami_manager_challenge              (GamiManager *ami,
                                                         const gchar *auth_type,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve a challenge string to use for authentification of type auth_type

ami :

GamiManager

auth_type :

The authentification type to generate challenge for (e.g. "md5")

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

the generated challenge on success, FALSE on failure

gami_manager_absolute_timeout ()

GamiResponse *      gami_manager_absolute_timeout       (GamiManager *ami,
                                                         const gchar *channel,
                                                         gint timeout,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set timeout for call on channel to timeout seconds

ami :

GamiManager

channel :

The name of the channel to set the timeout for

timeout :

The maximum duration of the current call, in seconds

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_agi ()

GamiResponse *      gami_manager_agi                    (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *command,
                                                         const gchar *command_id,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Execute AGI command command in channel

ami :

GamiManager

channel :

The name of the channel to execute command in

command :

The name of the AGI command to execute

command_id :

(optional) CommandID for matching in AGI notification events

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_bridge ()

GamiResponse *      gami_manager_bridge                 (GamiManager *ami,
                                                         const gchar *channel1,
                                                         const gchar *channel2,
                                                         gboolean tone,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Bridge together the existing channels channel1 and channel2

ami :

GamiManager

channel1 :

The name of the channel to bridge to channel2

channel2 :

The name of the channel to bridge to channel1

tone :

Whether to play courtesy tone to channel2

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_hangup ()

GamiResponse *      gami_manager_hangup                 (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Hang up channel

ami :

GamiManager

channel :

The name of the channel to hang up

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_originate ()

GamiResponse *      gami_manager_originate              (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *application_exten,
                                                         const gchar *data_context,
                                                         const gchar *priority,
                                                         guint timeout,
                                                         const gchar *caller_id,
                                                         const gchar *account,
                                                         const GHashTable *variables,
                                                         gboolean async,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Generate an outbound call from Asterisk and connect the channel to Exten / Context / Priority or execute Application (Data) on the channel

ami :

GamiManager

channel :

The name of the channel to call. Once the channel has answered, the call will be passed to the specified exten/context/priority or application/data

application_exten :

Extension to dial or application to call (depending on priority)

data_context :

Context to dial or data to pass to application (depending on priority)

priority :

(optional) Priority to dial - if NULL, application_exten will be interpretated as application and data_context as data

timeout :

(optional) Time to wait for channel to answer in milliseconds

caller_id :

(optional) CallerID to set on the outgoing channel

account :

(optional) AccountCode to set for the call

variables :

(optional) A GHashTable with name / value pairs to pass as channel variables

async :

(optional) Whether to originate call asynchronously - this allows to originate further calls before a response is received

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_redirect ()

GamiResponse *      gami_manager_redirect               (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *extra_channel,
                                                         const gchar *exten,
                                                         const gchar *context,
                                                         const gchar *priority,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Redirect channel to exten@context:priority

ami :

GamiManager

channel :

The name of the channel redirect

extra_channel :

(optional) Second call leg to transfer

exten :

The extension channel should be redirected to

context :

The context channel should be redirected to

priority :

The priority channel should be redirected to

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_set_cdr_user_field ()

GamiResponse *      gami_manager_set_cdr_user_field     (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *user_field,
                                                         gboolean append,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set CDR user field for channel

ami :

GamiManager

channel :

The name of the channel to set user_field for

user_field :

The value for the CDR user field

append :

(optional) Whether to append user_field to current value

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_mailbox_count ()

GamiResponse *      gami_manager_mailbox_count          (GamiManager *ami,
                                                         const gchar *mailbox,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve count of new and old messages in mailbox

ami :

GamiManager

mailbox :

The mailbox to check messages for

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GHashTable with message counts on success, NULL on failure

gami_manager_mailbox_status ()

GamiResponse *      gami_manager_mailbox_status         (GamiManager *ami,
                                                         const gchar *mailbox,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Check the status of mailbox

ami :

GamiManager

mailbox :

The mailbox to check status for

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GHashTable with status variables on success, NULL on failure

gami_manager_voicemail_users_list ()

GamiResponse *      gami_manager_voicemail_users_list   (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve a list of voicemail users

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of voicemail users (stored as GHashTable) on success, NULL on failure

gami_manager_meetme_list ()

GamiResponse *      gami_manager_meetme_list            (GamiManager *ami,
                                                         const gchar *meetme,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

List al users in conference meetme

ami :

GamiManager

meetme :

The MeetMe conference bridge number

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of user information (stored as GHashTable) on success, NULL on failure

gami_manager_meetme_mute ()

GamiResponse *      gami_manager_meetme_mute            (GamiManager *ami,
                                                         const gchar *meetme,
                                                         const gchar *user_num,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Mutes user_num in conference meetme

ami :

GamiManager

meetme :

The MeetMe conference bridge number

user_num :

The user number in the specified bridge

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_meetme_unmute ()

GamiResponse *      gami_manager_meetme_unmute          (GamiManager *ami,
                                                         const gchar *meetme,
                                                         const gchar *user_num,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Unmutes user_num in conference meetme

ami :

GamiManager

meetme :

The MeetMe conference bridge number

user_num :

The user number in the specified bridge

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_monitor ()

GamiResponse *      gami_manager_monitor                (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *file,
                                                         const gchar *format,
                                                         gboolean mix,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Start monitoring channel

ami :

GamiManager

channel :

Channel to start monitoring

file :

(optional) Filename to use for recording

format :

(optional) Format to use for recording

mix :

(optional) Whether to mix in / out channel into one file

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_change_monitor ()

GamiResponse *      gami_manager_change_monitor         (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *file,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Change the file name of the recording occuring on channel

ami :

GamiManager

channel :

Monitored channel

file :

New filename to use for recording

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_pause_monitor ()

GamiResponse *      gami_manager_pause_monitor          (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Pause monitoring of channel

ami :

GamiManager

channel :

Monitored channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_unpause_monitor ()

GamiResponse *      gami_manager_unpause_monitor        (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Continue monitoring of channel

ami :

GamiManager

channel :

Monitored channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_stop_monitor ()

GamiResponse *      gami_manager_stop_monitor           (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Stop monitoring channel

ami :

GamiManager

channel :

Monitored channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_queue_add ()

GamiResponse *      gami_manager_queue_add              (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         guint penalty,
                                                         gboolean paused,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Add iface to queue

ami :

GamiManager

queue :

Existing queue to add member

iface :

Member interface to add to queue

penalty :

Penalty for new member

paused :

whether iface should be initially paused

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_queue_log ()

GamiResponse *      gami_manager_queue_log              (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *event,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Generate a queue_log entry for queue

ami :

GamiManager

queue :

Queue to generate queue_log entry for

event :

Log event to generate

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_queue_pause ()

GamiResponse *      gami_manager_queue_pause            (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         gboolean paused,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

(Un)pause iface

ami :

GamiManager

queue :

(optional) Existing queue for which iface should be (un)paused

iface :

Member interface (un)pause

paused :

Whether to pause or unpause iface

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_queue_penalty ()

GamiResponse *      gami_manager_queue_penalty          (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         guint penalty,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Change the penalty value of iface

ami :

GamiManager

queue :

(optional) Limit penalty change to existing queue

iface :

Member interface change penalty for

penalty :

New penalty to set for iface

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_queue_remove ()

GamiResponse *      gami_manager_queue_remove           (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *iface,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Remove iface from queue

ami :

GamiManager

queue :

Existing queue to remove member from

iface :

Member interface to remove from queue

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_queue_summary ()

GamiResponse *      gami_manager_queue_summary          (GamiManager *ami,
                                                         const gchar *queue,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Get summary of queue statistics

ami :

GamiManager

queue :

(optional) Only send summary information for queue

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of queue statistics (stored as GHashTable) on success, NULL on failure

gami_manager_agent_callback_login ()

GamiResponse *      gami_manager_agent_callback_login   (GamiManager *ami,
                                                         const gchar *agent,
                                                         const gchar *exten,
                                                         const gchar *context,
                                                         gboolean ack_call,
                                                         guint wrapup_time,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Log in agent and register callback to exten (note that the action has been deprecated in asterisk-1.4 and was removed in asterisk-1.6)

ami :

GamiManager

agent :

The ID of the agent to log in

exten :

The extension to use as callback

context :

(optional) The context to use as callback

ack_call :

(optional) Whether calls should be acknowledged by the agent (by pressing #)

wrapup_time :

(optional) The minimum amount of time after hangup before the agent will receive a new call

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_agent_logoff ()

GamiResponse *      gami_manager_agent_logoff           (GamiManager *ami,
                                                         const gchar *agent,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Log off agent

ami :

GamiManager

agent :

The ID of the agent to log off

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_agents ()

GamiResponse *      gami_manager_agents                 (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

List information about all configured agents and their status

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of agents (stored as GHashTable) on success, NULL on failure

gami_manager_park ()

GamiResponse *      gami_manager_park                   (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *channel2,
                                                         guint timeout,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Park a channel in the parking lot

ami :

GamiManager

channel :

Channel name to park

channel2 :

Channel to announce park info to (and return the call to if the parking times out)

timeout :

(optional) Milliseconds to wait before callback

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_parked_calls ()

GamiResponse *      gami_manager_parked_calls           (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve a list of parked calls

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of parked calls (stored as GHashTable) on success, NULL on failure

gami_manager_get_var ()

GamiResponse *      gami_manager_get_var                (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *variable,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Get value of variable (either from channel or as global)

ami :

GamiManager

channel :

(optional) Channel to retrieve variable from

variable :

Name of the variable to retrieve

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

value of variable or FALSE

gami_manager_set_var ()

GamiResponse *      gami_manager_set_var                (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *variable,
                                                         const gchar *value,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set variable (optionally on channel channel) to value

ami :

GamiManager

channel :

(optional) Channel to set variable for

variable :

Name of the variable to set

value :

New value for variable

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_db_del ()

GamiResponse *      gami_manager_db_del                 (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *key,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Remove AstDB entry family/key

ami :

GamiManager

family :

The AstDB key family in which to delete the key

key :

The name of the AstDB key to delete

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_db_del_tree ()

GamiResponse *      gami_manager_db_del_tree            (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Remove AstDB key family

ami :

GamiManager

family :

The AstDB key family to delete

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_db_get ()

GamiResponse *      gami_manager_db_get                 (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *key,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve value of AstDB entry family/key

ami :

GamiManager

family :

The AstDB key family from which to retrieve the value

key :

The name of the AstDB key

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

the value of family/key on success, FALSE on failure

gami_manager_db_put ()

GamiResponse *      gami_manager_db_put                 (GamiManager *ami,
                                                         const gchar *family,
                                                         const gchar *key,
                                                         const gchar *val,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set AstDB entry family/key to value

ami :

GamiManager

family :

The AstDB key family in which to set the value

key :

The name of the AstDB key

val :

The value to assign to the key

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_sip_peers ()

GamiResponse *      gami_manager_sip_peers              (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve a list of SIP peers

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of SIP peers (stored as GHashTable) on success, NULL on failure

gami_manager_sip_show_peer ()

GamiResponse *      gami_manager_sip_show_peer          (GamiManager *ami,
                                                         const gchar *peer,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve status information for peer

ami :

GamiManager

peer :

SIP peer to get status information for

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GHashTable of peer status information on success, NULL on failure

gami_manager_sip_show_registry ()

GamiResponse *      gami_manager_sip_show_registry      (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve registry information of SIP peers

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of registry information (stored as GHashTable) on success, NULL on failure

gami_manager_iax_peer_list ()

GamiResponse *      gami_manager_iax_peer_list          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve a list of IAX2 peers

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of IAX2 peers (stored as GHashTable) on success, NULL on failure

gami_manager_dahdi_dial_offhook ()

GamiResponse *      gami_manager_dahdi_dial_offhook     (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *number,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Dial over DAHDI channel while offhook

ami :

GamiManager

dahdi_channel :

The DAHDI channel on which to dial number

number :

The number to dial

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_dahdi_dnd_off ()

GamiResponse *      gami_manager_dahdi_dnd_off          (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set DND (Do Not Disturb) status on dahdi_channel to off

ami :

GamiManager

dahdi_channel :

The DAHDI channel on which to turn off DND status

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_dahdi_dnd_on ()

GamiResponse *      gami_manager_dahdi_dnd_on           (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set DND (Do Not Disturb) status on dahdi_channel

ami :

GamiManager

dahdi_channel :

The DAHDI channel on which to turn on DND status

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_dahdi_hangup ()

GamiResponse *      gami_manager_dahdi_hangup           (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Hangup DAHDI channel

ami :

GamiManager

dahdi_channel :

The DAHDI channel to hang up

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_dahdi_restart ()

GamiResponse *      gami_manager_dahdi_restart          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Restart DAHDI channels. Any active calls will be terminated

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_dahdi_show_channels ()

GamiResponse *      gami_manager_dahdi_show_channels    (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Show the status of all DAHDI channels

ami :

GamiManager

dahdi_channel :

(optional) Limit status information to this channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of DAHDI channels (stored as GHashTable) on success, NULL on failure

gami_manager_dahdi_transfer ()

GamiResponse *      gami_manager_dahdi_transfer         (GamiManager *ami,
                                                         const gchar *dahdi_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Transfer DAHDI channel

ami :

GamiManager

dahdi_channel :

The channel to be transferred

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_zap_dial_offhook ()

GamiResponse *      gami_manager_zap_dial_offhook       (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *number,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Dial over ZAP channel while offhook

ami :

GamiManager

zap_channel :

The ZAP channel on which to dial number

number :

The number to dial

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_zap_dnd_off ()

GamiResponse *      gami_manager_zap_dnd_off            (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set DND (Do Not Disturb) status on zap_channel to off

ami :

GamiManager

zap_channel :

The ZAP channel on which to turn off DND status

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_zap_dnd_on ()

GamiResponse *      gami_manager_zap_dnd_on             (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set DND (Do Not Disturb) status on zap_channel

ami :

GamiManager

zap_channel :

The ZAP channel on which to turn on DND status

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_zap_hangup ()

GamiResponse *      gami_manager_zap_hangup             (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Hangup ZAP channel

ami :

GamiManager

zap_channel :

The ZAP channel to hang up

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_zap_restart ()

GamiResponse *      gami_manager_zap_restart            (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Restart ZAP channels. Any active calls will be terminated

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_zap_show_channels ()

GamiResponse *      gami_manager_zap_show_channels      (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Show the status of all ZAP channels

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of ZAP channels (stored as GHashTable) on success, NULL on failure

gami_manager_zap_transfer ()

GamiResponse *      gami_manager_zap_transfer           (GamiManager *ami,
                                                         const gchar *zap_channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Transfer ZAP channel

ami :

GamiManager

zap_channel :

The channel to be transferred

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_list_commands ()

GamiResponse *      gami_manager_list_commands          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

List available Asterisk manager commands - the available actions may vary between different versions of Asterisk and due to the set of loaded modules

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

A GHashTable of action names / descriptions on success, NULL on failure

gami_manager_core_settings ()

GamiResponse *      gami_manager_core_settings          (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve information about PBX core settings (as Asterisk/GAMI version etc.)

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GHashTable with settings variables on success, NULL on failure

gami_manager_core_status ()

GamiResponse *      gami_manager_core_status            (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve information about the current PBX core status (as active calls, startup time etc.)

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GHashTable with status variables on success, NULL on failure

gami_manager_core_show_channels ()

GamiResponse *      gami_manager_core_show_channels     (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve a list of currently active channels

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of active channels (stored as GHashTable) on success, NULL on failure

gami_manager_status ()

GamiResponse *      gami_manager_status                 (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Retrieve status information of active channels (or channel)

ami :

GamiManager

channel :

(optional) Only retrieve status information for this channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GSList of status information (stored as GHashTable) on success, NULL on failure

gami_manager_ping ()

GamiResponse *      gami_manager_ping                   (GamiManager *ami,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Query the Asterisk server to make sure it is still responding. May be used to keep the connection alive

ami :

GamiManager

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_module_check ()

GamiResponse *      gami_manager_module_check           (GamiManager *ami,
                                                         const gchar *module,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Check whether module is loaded

ami :

GamiManager

module :

Asterisk module name (not including extension)

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE if module is loaded, FALSE otherwise

gami_manager_module_load ()

GamiResponse *      gami_manager_module_load            (GamiManager *ami,
                                                         const gchar *module,
                                                         GamiModuleLoadType load_type,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Perform action indicated by load_type for module

ami :

GamiManager

module :

Asterisk module name (not including extension)

load_type :

Load action to perform (load, reload or unload)

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE if module is loaded, FALSE otherwise

gami_manager_reload ()

GamiResponse *      gami_manager_reload                 (GamiManager *ami,
                                                         const gchar *module,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Reload module or all modules

ami :

GamiManager

module :

(optional) The name of the module to reload (not including extension)

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_extension_state ()

GamiResponse *      gami_manager_extension_state        (GamiManager *ami,
                                                         const gchar *exten,
                                                         const gchar *context,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Check extension state of exten@context - if hints are properly configured on the server, the action will report the status of the device connected to exten

ami :

GamiManager

exten :

The name of the extension to check

context :

The context of the extension to check

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

GHashTable of status information on success, NULL on failure

gami_manager_send_text ()

GamiResponse *      gami_manager_send_text              (GamiManager *ami,
                                                         const gchar *channel,
                                                         const gchar *message,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Send message to channel

ami :

GamiManager

channel :

The name of the channel to send message to

message :

The message to send to channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_jabber_send ()

GamiResponse *      gami_manager_jabber_send            (GamiManager *ami,
                                                         const gchar *jabber,
                                                         const gchar *screen_name,
                                                         const gchar *message,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Send message from Jabber / GTalk account jabber to account screen_name

ami :

GamiManager

jabber :

Jabber / GTalk account to send message from

screen_name :

Jabber / GTalk account to send message to

message :

The message to send

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_play_dtmf ()

GamiResponse *      gami_manager_play_dtmf              (GamiManager *ami,
                                                         const gchar *channel,
                                                         gchar digit,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Play a DTMF digit digit on channel

ami :

GamiManager

channel :

The name of the channel to send digit to

digit :

The DTMF digit to play on channel

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_events ()

GamiResponse *      gami_manager_events                 (GamiManager *ami,
                                                         GamiEventMask event_mask,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Set GamiEventMask for the connection to control which events shall be received

ami :

GamiManager

event_mask :

GamiEventMask to set for the connection

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_user_event ()

GamiResponse *      gami_manager_user_event             (GamiManager *ami,
                                                         const gchar *user_event,
                                                         const GHashTable *headers,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Send the user defined event user_event with an optional payload of headers

ami :

GamiManager

user_event :

The user defined event to send

headers :

(optional) Optional header to add to the event

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_wait_event ()

GamiResponse *      gami_manager_wait_event             (GamiManager *ami,
                                                         guint timeout,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Wait for an event to occur

ami :

GamiManager

timeout :

(optional) Maximum time to wait for events in seconds

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

gami_manager_list_categories ()

GamiResponse *      gami_manager_list_categories        (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

List categories in filename

ami :

GamiManager

filename :

The name of the configuration file to list categories for

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

A GHashTable of category number / name on success, NULL on failure

gami_manager_get_config ()

GamiResponse *      gami_manager_get_config             (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Get content of configuration file filename

ami :

GamiManager

filename :

The name of the configuration file to get content for

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

A GHashTable of line number / values on success, NULL on failure

gami_manager_get_config_json ()

GamiResponse *      gami_manager_get_config_json        (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Get content of configuration file filename as JS hash for use with JSON

ami :

GamiManager

filename :

The name of the configuration file to get content for

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

A GHashTable with file dump on success, NULL on failure

gami_manager_create_config ()

GamiResponse *      gami_manager_create_config          (GamiManager *ami,
                                                         const gchar *filename,
                                                         const gchar *action_id,
                                                         GamiResponseFunc response_func,
                                                         gpointer response_data,
                                                         GError **error);

Create an empty configurion file filename

ami :

GamiManager

filename :

The name of the configuration file to create

action_id :

(optional) ActionID to ease response matching

response_func :

Callback for asynchronious operation. Passing NULL will trigger synchronious mode

response_data :

User data to pass to the callback. If NULL is passed for response_func, the parameter is ignored

error :

A location to return an error of type GIOChannelError

Returns :

TRUE on success, FALSE on failure

Property Details

The "host" property

  "host"                     gchar*                : Read / Write / Construct Only

The Asterisk manager host to connect to

Default value: "localhost"


The "port" property

  "port"                     gchar*                : Read / Write / Construct Only

The Asterisk manager port to connect to

Default value: "5038"

Signal Details

The "connected" signal

void                user_function                      (GamiManager *ami,
                                                        gpointer     user_data)      : Run Last

The ::connected signal is emitted after successfully establishing a connection to the Asterisk server

ami :

The GamiManager that received the signal

user_data :

user data set when the signal handler was connected.

The "disconnected" signal

void                user_function                      (GamiManager *ami,
                                                        gpointer     user_data)      : Run Last

The ::disconnected event is emitted each time the connection to the Asterisk server is lost

ami :

The GamiManager that received the signal

user_data :

user data set when the signal handler was connected.

The "event" signal

void                user_function                      (GamiManager *ami,
                                                        GHashTable  *event,
                                                        gpointer     user_data)      : Run Last

The ::event signal is emitted each time Asterisk emits an event

ami :

The GamiManager that received the signal

event :

The event that occurred (stored as a GHashTable)

user_data :

user data set when the signal handler was connected.