Kannel: Open Source WAP and SMS gateway
svn-r5336
|
#include <errno.h>
#include <signal.h>
#include <stdarg.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include <unistd.h>
#include <sys/time.h>
#include "gwlib/gwlib.h"
#include "smsc.h"
#include "smsc_p.h"
#include "msg.h"
Go to the source code of this file.
Macros | |
#define | MAX_READ_INTO_BUFFER (1024) |
Functions | |
static void | smscenter_lock (SMSCenter *smsc) |
static void | smscenter_unlock (SMSCenter *smsc) |
SMSCenter * | smscenter_construct (void) |
void | smscenter_destruct (SMSCenter *smsc) |
int | smscenter_submit_msg (SMSCenter *smsc, Msg *msg) |
int | smscenter_receive_msg (SMSCenter *smsc, Msg **msg) |
int | smscenter_pending_smsmessage (SMSCenter *smsc) |
int | smscenter_read_into_buffer (SMSCenter *smsc) |
void | smscenter_remove_from_buffer (SMSCenter *smsc, size_t n) |
SMSCenter * | smsc_open (CfgGroup *grp) |
int | smsc_reopen (SMSCenter *smsc) |
char * | smsc_name (SMSCenter *smsc) |
int | smsc_close (SMSCenter *smsc) |
#define MAX_READ_INTO_BUFFER (1024) |
Definition at line 84 of file smsc.c.
Referenced by smscenter_read_into_buffer().
int smsc_close | ( | SMSCenter * | smsc | ) |
Definition at line 648 of file smsc.c.
References cimd_close(), emi_close(), ois_close(), sema_close(), SMSC_TYPE_CIMD, SMSC_TYPE_EMI_X25, SMSC_TYPE_OIS, SMSC_TYPE_SEMA_X28, smscenter_lock(), and SMSCenter::type.
Referenced by smscwrapper_destroy().
char* smsc_name | ( | SMSCenter * | smsc | ) |
Definition at line 643 of file smsc.c.
References SMSCenter::name.
Referenced by smsc_wrapper_create().
Definition at line 444 of file smsc.c.
References allow_ip, SMSCenter::allowed_prefix, SMSCenter::alt_charset, cfg_get, cfg_get_integer(), cimd_open(), SMSCenter::denied_prefix, emi_open(), error(), host, octstr_compare(), octstr_create, octstr_destroy(), octstr_get_cstr, octstr_imm(), octstr_parse_long(), ois_open(), our_port, password, port, SMSCenter::preferred_prefix, sema_open(), SMSC_TYPE_CIMD, SMSC_TYPE_EMI_X25, SMSC_TYPE_OIS, SMSC_TYPE_SEMA_X28, type, and username.
Referenced by smsc_wrapper_create().
int smsc_reopen | ( | SMSCenter * | smsc | ) |
Definition at line 610 of file smsc.c.
References cimd_reopen(), emi_reopen(), SMSCenter::killed, ois_reopen(), sema_reopen(), SMSC_TYPE_CIMD, SMSC_TYPE_EMI_X25, SMSC_TYPE_OIS, SMSC_TYPE_SEMA_X28, smscenter_lock(), smscenter_unlock(), and SMSCenter::type.
Referenced by reconnect().
SMSCenter* smscenter_construct | ( | void | ) |
Definition at line 101 of file smsc.c.
References SMSCenter::allowed_prefix, SMSCenter::alt_charset, SMSCenter::buffer, SMSCenter::buflen, SMSCenter::bufsize, SMSCenter::cimd_hostname, SMSCenter::cimd_password, SMSCenter::cimd_port, SMSCenter::cimd_username, SMSCenter::denied_prefix, SMSCenter::emi_password, SMSCenter::emi_phonenum, SMSCenter::emi_serialdevice, SMSCenter::emi_username, SMSCenter::hostname, SMSCenter::id, SMSCenter::keepalive, SMSCenter::killed, SMSCenter::mutex, mutex_create, SMSCenter::name, SMSCenter::ois_ack_debt, SMSCenter::ois_alive, SMSCenter::ois_alive2, SMSCenter::ois_buffer, SMSCenter::ois_buflen, SMSCenter::ois_bufsize, SMSCenter::ois_flags, SMSCenter::ois_listening_socket, SMSCenter::ois_received_mo, SMSCenter::ois_socket, SMSCenter::port, SMSCenter::preferred_prefix, SMSCenter::sema_fd, SMSCenter::sema_homenua, SMSCenter::sema_serialdevice, SMSCenter::sema_smscnua, SMSC_TYPE_DELETED, SMSCenter::socket, and SMSCenter::type.
Referenced by cimd_open(), emi_open(), ois_open(), and sema_open().
void smscenter_destruct | ( | SMSCenter * | smsc | ) |
Definition at line 168 of file smsc.c.
References SMSCenter::buffer, SMSCenter::cimd_hostname, SMSCenter::cimd_password, SMSCenter::cimd_username, SMSCenter::emi_password, SMSCenter::emi_phonenum, SMSCenter::emi_serialdevice, SMSCenter::emi_username, SMSCenter::hostname, SMSCenter::mutex, mutex_destroy(), SMSCenter::ois_buffer, ois_delete_queue(), SMSCenter::sema_homenua, SMSCenter::sema_serialdevice, and SMSCenter::sema_smscnua.
Referenced by cimd_open(), emi_open(), ois_open(), and sema_open().
|
static |
Definition at line 422 of file smsc.c.
References error(), SMSCenter::mutex, mutex_lock, SMSC_TYPE_DELETED, and SMSCenter::type.
Referenced by smsc_close(), smsc_reopen(), smscenter_pending_smsmessage(), smscenter_receive_msg(), and smscenter_submit_msg().
int smscenter_pending_smsmessage | ( | SMSCenter * | smsc | ) |
Definition at line 302 of file smsc.c.
References cimd_pending_smsmessage(), emi_pending_smsmessage(), error(), ois_pending_smsmessage(), sema_pending_smsmessage(), SMSC_TYPE_CIMD, SMSC_TYPE_EMI_X25, SMSC_TYPE_OIS, SMSC_TYPE_SEMA_X28, smscenter_lock(), smscenter_unlock(), and SMSCenter::type.
Referenced by sms_receive().
int smscenter_read_into_buffer | ( | SMSCenter * | smsc | ) |
Definition at line 348 of file smsc.c.
References SMSCenter::buffer, SMSCenter::buflen, SMSCenter::bufsize, error(), SMSCenter::hostname, MAX_READ_INTO_BUFFER, SMSCenter::port, and SMSCenter::socket.
Referenced by cimd_open_connection(), cimd_pending_smsmessage(), connect_tcpip(), expect_acknowledge(), and ois_read_into_buffer().
Definition at line 251 of file smsc.c.
References cimd_receive_msg(), emi_receive_msg(), error(), msg, ois_receive_msg(), sema_receive_msg(), SMSC_TYPE_CIMD, SMSC_TYPE_EMI_X25, SMSC_TYPE_OIS, SMSC_TYPE_SEMA_X28, smscenter_lock(), smscenter_unlock(), and SMSCenter::type.
Referenced by sms_receive().
void smscenter_remove_from_buffer | ( | SMSCenter * | smsc, |
size_t | n | ||
) |
Definition at line 412 of file smsc.c.
References SMSCenter::buffer, and SMSCenter::buflen.
Referenced by cimd_open_connection(), cimd_pending_smsmessage(), cimd_receive_msg(), connect_tcpip(), expect_acknowledge(), ois_close(), ois_extract_line_from_buffer(), and ois_extract_msg_from_buffer().
Definition at line 209 of file smsc.c.
References cimd_submit_msg(), emi_submit_msg(), error(), msg, ois_submit_msg(), sema_submit_msg(), SMSC_TYPE_CIMD, SMSC_TYPE_EMI_X25, SMSC_TYPE_OIS, SMSC_TYPE_SEMA_X28, smscenter_lock(), smscenter_unlock(), and SMSCenter::type.
Referenced by sms_send().
|
static |
Definition at line 433 of file smsc.c.
References SMSCenter::mutex, and mutex_unlock.
Referenced by smsc_reopen(), smscenter_pending_smsmessage(), smscenter_receive_msg(), and smscenter_submit_msg().