RmRouter

RmRouter — Router related functions (login, get settings, ...)

Stability Level

Stable, unless otherwise indicated

Functions

gboolean rm_router_present ()
gboolean rm_router_login ()
gboolean rm_router_logout ()
gboolean rm_router_get_settings ()
const gchar * rm_router_get_name ()
const gchar * rm_router_get_version ()
gchar * rm_router_get_host ()
gchar * rm_router_get_login_password ()
void rm_router_set_login_password ()
gchar * rm_router_get_login_user ()
gchar * rm_router_get_ftp_password ()
gchar * rm_router_get_ftp_user ()
void rm_router_load_journal_async ()
gpointer rm_router_load_journal_finish ()
gboolean rm_router_clear_journal ()
gboolean rm_router_dial_number ()
gboolean rm_router_hangup ()
gchar * rm_router_get_ip ()
gboolean rm_router_reconnect ()
gboolean rm_router_delete_fax ()
gboolean rm_router_delete_voice ()
gchar * rm_router_get_area_code ()
gchar * rm_router_get_country_code ()
gchar * rm_router_get_international_access_code ()
gchar * rm_router_get_national_prefix ()
void rm_router_set_active ()
gboolean rm_router_init ()
void rm_router_shutdown ()
gchar ** rm_router_get_numbers ()
void rm_router_process_journal ()
gboolean rm_router_register ()
gchar * rm_router_load_fax ()
gchar * rm_router_load_voice ()
void rm_router_load_voice_mail_async ()
GBytes * rm_router_load_voice_mail_finish ()
gboolean rm_router_info_free ()
gboolean rm_router_is_cable ()
GList * rm_router_load_fax_reports ()
GList * rm_router_load_voice_records ()
void rm_router_free_phone_list ()
gboolean rm_router_get_suppress_state ()
void rm_router_release_lock ()
gboolean rm_router_is_locked ()
gboolean rm_router_need_ftp ()

Types and Values

Description

Router related function to interact in an easy way. As it uses router plugins it can be used with different router vendors.

Functions

rm_router_present ()

gboolean
rm_router_present (RmRouterInfo *router_info);

Check if router is present.

Parameters

router_info

a RmRouterInfo

 

Returns

present state


rm_router_login ()

gboolean
rm_router_login (RmProfile *profile);

Login to router.

Parameters

profile

a RmProfile

 

Returns

login state


rm_router_logout ()

gboolean
rm_router_logout (RmProfile *profile);

Router logout.

Parameters

profile

a RmProfile

 

Returns

logout state


rm_router_get_settings ()

gboolean
rm_router_get_settings (RmProfile *profile);

Get router settings (and setup devices)

Parameters

profile

a RmProfile

 

Returns

router settings


rm_router_get_name ()

const gchar *
rm_router_get_name (RmProfile *profile);

Get router name

Parameters

profile

a RmProfile

 

Returns

router name


rm_router_get_version ()

const gchar *
rm_router_get_version (RmProfile *profile);

Get router version

Parameters

profile

a RmProfile

 

Returns

router version


rm_router_get_host ()

gchar *
rm_router_get_host (RmProfile *profile);

Get router host

Parameters

profile

a RmProfile

 

Returns

newly allocated string with router host or "" if no profile is active


rm_router_get_login_password ()

gchar *
rm_router_get_login_password (RmProfile *profile);

Get login password.

Parameters

profile

a RmProfile

 

Returns

login password


rm_router_set_login_password ()

void
rm_router_set_login_password (RmProfile *profile,
                              char *password);

rm_router_get_login_user ()

gchar *
rm_router_get_login_user (RmProfile *profile);

Get login user

Parameters

profile

a RmProfile

 

Returns

login user


rm_router_get_ftp_password ()

gchar *
rm_router_get_ftp_password (RmProfile *profile);

Get router FTP password.

Parameters

profile

a RmProfile

 

Returns

router ftp password


rm_router_get_ftp_user ()

gchar *
rm_router_get_ftp_user (RmProfile *profile);

Get router FTP user.

Parameters

profile

a RmProfile

 

Returns

router ftp user


rm_router_load_journal_async ()

void
rm_router_load_journal_async (RmProfile *profile,
                              GCancellable *cancellable,
                              GAsyncReadyCallback callback,
                              gpointer user_data);

rm_router_load_journal_finish ()

gpointer
rm_router_load_journal_finish (GObject *source,
                               GAsyncResult *result,
                               GError **error);

rm_router_clear_journal ()

gboolean
rm_router_clear_journal (RmProfile *profile);

Clear router journal

Parameters

profile

a RmProfile

 

Returns

clear journal return state


rm_router_dial_number ()

gboolean
rm_router_dial_number (RmProfile *profile,
                       gint port,
                       const gchar *number);

Dial number

Parameters

profile

a RmProfile

 

port

dial port

 

number

number to dial

 

Returns

return state of dial function


rm_router_hangup ()

gboolean
rm_router_hangup (RmProfile *profile,
                  gint port,
                  const gchar *number);

Hangup call

Parameters

profile

a RmProfile

 

port

dial port

 

number

number to dial

 

Returns

return state of hangup function


rm_router_get_ip ()

gchar *
rm_router_get_ip (RmProfile *profile);

Get external IP address

Parameters

profile

a RmProfile

 

Returns

IP address


rm_router_reconnect ()

gboolean
rm_router_reconnect (RmProfile *profile);

Reconnect network connection

Parameters

profile

a RmProfile

 

Returns

TRUE on success, otherwise FALSE


rm_router_delete_fax ()

gboolean
rm_router_delete_fax (RmProfile *profile,
                      const gchar *filename);

Delete fax file on router

Parameters

profile

a RmProfile

 

filename

fax filename to delete

 

Returns

TRUE on success, otherwise FALSE


rm_router_delete_voice ()

gboolean
rm_router_delete_voice (RmProfile *profile,
                        const gchar *filename);

Delete voice file on router

Parameters

profile

a RmProfile

 

filename

voice filename to delete

 

Returns

TRUE on success, otherwise FALSE


rm_router_get_area_code ()

gchar *
rm_router_get_area_code (RmProfile *profile);

Get router area code

Parameters

profile

a RmProfile

 

Returns

area code


rm_router_get_country_code ()

gchar *
rm_router_get_country_code (RmProfile *profile);

Get router country code

Parameters

profile

a RmProfile

 

Returns

country code


rm_router_get_international_access_code ()

gchar *
rm_router_get_international_access_code
                               (RmProfile *profile);

Get international access code

Parameters

profile

a RmProfile

 

Returns

international access code


rm_router_get_national_prefix ()

gchar *
rm_router_get_national_prefix (RmProfile *profile);

Get national call prefix

Parameters

profile

a RmProfile

 

Returns

national call prefix


rm_router_set_active ()

void
rm_router_set_active (RmProfile *profile);

Set profile as active.

Parameters

profile

a RmProfile

 

rm_router_init ()

gboolean
rm_router_init (void);

Initialize router (if available set internal router structure)

Returns

TRUE on success, otherwise FALSE


rm_router_shutdown ()

void
rm_router_shutdown (void);

Shutdown router


rm_router_get_numbers ()

gchar **
rm_router_get_numbers (RmProfile *profile);

Get array of phone numbers.

Parameters

profile

a RmProfile

 

Returns

phone number array


rm_router_process_journal ()

void
rm_router_process_journal (GList *journal);

Router needs to process a new loaded journal (emit journal-process signal and journal-loaded)

Parameters

journal

journal list

 

rm_router_register ()

gboolean
rm_router_register (RmRouter *router);

Register new router

Parameters

router

a RmRouter

 

Returns

TRUE


rm_router_load_fax ()

gchar *
rm_router_load_fax (RmProfile *profile,
                    const gchar *name,
                    gsize *len);

Load fax file

Parameters

profile

a RmProfile

 

name

fax filename

 

len

pointer to store data length to

 

Returns

fax data


rm_router_load_voice ()

gchar *
rm_router_load_voice (RmProfile *profile,
                      const gchar *name,
                      gsize *len);

Load voice file

Parameters

profile

a RmProfile

 

name

voice filename

 

len

pointer to store data length to

 

Returns

voice data


rm_router_load_voice_mail_async ()

void
rm_router_load_voice_mail_async (RmProfile *profile,
                                 const char *name,
                                 GCancellable *cancellable,
                                 GAsyncReadyCallback callback,
                                 gpointer user_data);

rm_router_load_voice_mail_finish ()

GBytes *
rm_router_load_voice_mail_finish (GObject *source_object,
                                  GAsyncResult *result,
                                  GError **error);

rm_router_info_free ()

gboolean
rm_router_info_free (RmRouterInfo *info);

Free router info structure

Parameters

info

a RmRouterInfo

 

Returns

TRUE if structure is freed, otherwise FALSE


rm_router_is_cable ()

gboolean
rm_router_is_cable (RmProfile *profile);

Check if router is using cable as annex

Parameters

profile

a RmProfile

 

Returns

TRUE if cable is used, otherwise FALSE


rm_router_load_fax_reports ()

GList *
rm_router_load_fax_reports (RmProfile *profile,
                            GList *journal);

Load fax reports and add them to the journal

Parameters

profile

a RmProfile

 

journal

journal list pointer

 

Returns

new journal list with attached fax reports


rm_router_load_voice_records ()

GList *
rm_router_load_voice_records (RmProfile *profile,
                              GList *journal);

Load voice records and add them to the journal

Parameters

profile

a RmProfile

 

journal

journal list pointer

 

Returns

new journal list with attached voice records


rm_router_free_phone_list ()

void
rm_router_free_phone_list (GList *phone_list);

Free full phone list.

Parameters

phone_list

phone list

 

rm_router_get_suppress_state ()

gboolean
rm_router_get_suppress_state (RmProfile *profile);

Get number suppress state

Parameters

profile

a RmProfile

 

Returns

suppress state


rm_router_release_lock ()

void
rm_router_release_lock (void);

Release router login blocked


rm_router_is_locked ()

gboolean
rm_router_is_locked (void);

Check whether router login is blocked

Returns

locked state


rm_router_need_ftp ()

gboolean
rm_router_need_ftp (RmProfile *profile);

Checks wether router needs ftp or is capable of TR-064

Parameters

profile

a RmProfile

 

Returns

TRUE if ftp support is needed

Types and Values

ROUTER_ENABLE_TELNET

#define ROUTER_ENABLE_TELNET    "#96*5*"

ROUTER_ENABLE_CAPI

#define ROUTER_ENABLE_CAPI      "#96*3*"

enum RmPhoneNumberType

The type of a phone number.

Members

RM_PHONE_NUMBER_TYPE_HOME

home number

 

RM_PHONE_NUMBER_TYPE_WORK

work number

 

RM_PHONE_NUMBER_TYPE_MOBILE

mobile number

 

RM_PHONE_NUMBER_TYPE_FAX_HOME

home fax number

 

RM_PHONE_NUMBER_TYPE_FAX_WORK

work fax number

 

RM_PHONE_NUMBER_TYPE_PAGER

pager number

 

RM_PHONE_NUMBER_TYPE_OTHER

   

ROUTER_DIAL_PORT_AUTO

#define ROUTER_DIAL_PORT_AUTO   -1

RmPhoneInfo

typedef struct {
} RmPhoneInfo;

The RmPhoneInfo contains only private fileds and should not be directly accessed.


RmPhoneNumber

typedef struct {
} RmPhoneNumber;

The RmPhoneNumber contains only private fileds and should not be directly accessed.


RmRouter

typedef struct {
} RmRouter;

The RmRouter contains only private fileds and should not be directly accessed.