/*
 * Gnophone: A client for the Asterisk PBX
 *
 * Copyright (C) 2000, Linux Support Services, Inc.
 *
 * Written by Mark Spencer
 *
 * Linux/UNIX version distributed under the terms of
 * the GNU General Public License
 *
 * telco.h: Telco routines, gui and low level
 *
 */

#ifndef _GNOPHONE_TELCO_H
#define _GNOPHONE_TELCO_H

/* Convert number to IAX.  If there's an error, we set the first byte to 0
   and then have a null terminated string with the error text */
extern char *telco_to_irl(char *number); 

/* Return IAX server */
extern char *telco_get_server(void);

/* Return IAX username */
extern char *telco_get_username(void);

/* Return IAX password */
extern char *telco_get_password(void);

/* Return IAX secret */
extern char *telco_get_secret(void);

/* Return IAX peer */
extern char *telco_get_peer(void);

/* Return IAX context */
extern char *telco_get_context(void);

/* Return IAX prefix */
extern char *telco_get_prefix(void);

/* Return IAX port number */
extern short telco_get_port(void);

#define TELCO_MODE_NONE     0
#define TELCO_MODE_IAXTEL   1
#define TELCO_MODE_ASTERISK 2

/* Return telephone number mode */
extern short telco_get_mode(void);

/* Set IAX server */
extern void telco_set_server(char *server);

/* Set IAX context */
extern void telco_set_context(char *context);

/* Set IAX username */
extern void telco_set_username(char *username);

/* Set IAX password */
extern void telco_set_password(char *password);

/* Set IAX port num */
extern void telco_set_port(short port);

/* Set IAX peer for registration */
extern void telco_set_peer(char *peer);

/* Set IAX secret for registration */
extern void telco_set_secret(char *secret);

/* Set IAX prefix */
extern void telco_set_prefix(char *prefix);

/* Show the telco GUI configuration */									
extern int telco_show_gui(void);

/* Save settings to config file */
extern int telco_save_settings(void);

/* Load settings from config file */
extern int telco_load_settings(void);

/* Set the mode */
extern int telco_set_mode(int mode);

/* Clear the number complete list */
extern void telco_clear_nbrc(void);

/* Clear the number complete list */
extern void telco_register_nbrc(char *pattern);

/* Iterate over the number complete list with a function */
extern void telco_iterate(void (*func)(char *s, void *data), void *data);

/* Does the number match a number complete */
extern int telco_match_nbrc(char *s);

/* Does the number still have a chance at matching something in the future? */
extern int telco_can_match_nbrc(char *s);
#endif
