Kannel: Open Source WAP and SMS gateway
svn-r5336
|
#include <ctype.h>
#include <time.h>
#include <errno.h>
#include <limits.h>
#include <string.h>
#include <unistd.h>
#include "gwlib/gwlib.h"
#include "sms.h"
#include "dlr.h"
#include "dlr_p.h"
#include "meta_data.h"
Go to the source code of this file.
Macros | |
#define | O_DELETE(a) { if (a) octstr_destroy(a); a = NULL; } |
#define | O_DELETE(a) { if (a) octstr_destroy(a); a = NULL; } |
#define | O_SET(x, val) if (octstr_len(val) > 0) { x = val; val = NULL; } |
Functions | |
struct dlr_entry * | dlr_entry_create (void) |
struct dlr_entry * | dlr_entry_duplicate (const struct dlr_entry *dlr) |
void | dlr_entry_destroy (struct dlr_entry *dlr) |
struct dlr_db_fields * | dlr_db_fields_create (CfgGroup *grp) |
void | dlr_db_fields_destroy (struct dlr_db_fields *fields) |
void | dlr_init (Cfg *cfg) |
void | dlr_shutdown () |
long | dlr_messages (void) |
const char * | dlr_type (void) |
void | dlr_add (const Octstr *smsc, const Octstr *ts, Msg *msg, int use_dst) |
Msg * | dlr_find (const Octstr *smsc, const Octstr *ts, const Octstr *dst, int typ, int use_dst) |
void | dlr_flush (void) |
Msg * | create_dlr_from_msg (const Octstr *smsc, const Msg *msg, const Octstr *reply, long stat) |
Variables | |
static struct dlr_storage * | handles = NULL |
#define O_DELETE | ( | a | ) | { if (a) octstr_destroy(a); a = NULL; } |
Referenced by dlr_db_fields_destroy(), and dlr_entry_destroy().
#define O_DELETE | ( | a | ) | { if (a) octstr_destroy(a); a = NULL; } |
#define O_SET | ( | x, | |
val | |||
) | if (octstr_len(val) > 0) { x = val; val = NULL; } |
Referenced by dlr_find().
Definition at line 501 of file dlr.c.
References debug(), DLR_IS_ENABLED, dlr_mask, gw_assert(), meta_data_set_value(), METADATA_ORIG_MSG_GROUP, METADATA_ORIG_MSG_GROUP_DLR_MASK, msg, msg_create, octstr_create, octstr_destroy(), octstr_duplicate, octstr_format(), octstr_get_cstr, octstr_imm(), reply(), report_mo, and dlr_entry::smsc.
Referenced by bb_smscconn_send_failed(), and bb_smscconn_sent().
Definition at line 330 of file dlr.c.
References dlr_entry::boxc_id, debug(), dlr_entry::destination, dlr_storage::dlr_add, dlr_entry_create(), DLR_IS_ENABLED, dlr_type(), gw_assert(), handles, dlr_entry::mask, msg, octstr_create, octstr_destroy(), octstr_duplicate, octstr_get_cstr, octstr_len(), dlr_entry::service, dlr_entry::smsc, dlr_entry::source, split, dlr_entry::timestamp, dlr_entry::url, dlr_entry::use_dst, and warning().
Referenced by add_msg_cb(), at2_send_one_message(), cgw_handle_op(), cimd2_submit_msg(), clickatell_parse_reply(), emi2_handle_smscreq(), generic_parse_reply(), handle_pdu(), kannel_parse_reply(), msg_cb(), oisd_submit_msg(), soap_read_response(), and xidris_parse_reply().
struct dlr_db_fields* dlr_db_fields_create | ( | CfgGroup * | grp | ) |
Definition at line 169 of file dlr.c.
References cfg_get, cfg_get_integer(), dlr_db_fields::field_boxc, dlr_db_fields::field_dst, dlr_db_fields::field_mask, dlr_db_fields::field_serv, dlr_db_fields::field_smsc, dlr_db_fields::field_src, dlr_db_fields::field_status, dlr_db_fields::field_ts, dlr_db_fields::field_url, gw_assert(), octstr_imm(), panic, dlr_db_fields::table, and dlr_db_fields::ttl.
void dlr_db_fields_destroy | ( | struct dlr_db_fields * | fields | ) |
Definition at line 204 of file dlr.c.
References dlr_db_fields::field_boxc, dlr_db_fields::field_dst, dlr_db_fields::field_mask, dlr_db_fields::field_serv, dlr_db_fields::field_smsc, dlr_db_fields::field_src, dlr_db_fields::field_status, dlr_db_fields::field_ts, dlr_db_fields::field_url, O_DELETE, and dlr_db_fields::table.
struct dlr_entry* dlr_entry_create | ( | void | ) |
Definition at line 103 of file dlr.c.
References gw_assert().
Referenced by dlr_add(), dlr_entry_duplicate(), and dlr_spool_get().
void dlr_entry_destroy | ( | struct dlr_entry * | dlr | ) |
Definition at line 142 of file dlr.c.
References dlr_entry::boxc_id, dlr_entry::destination, dlr_entry::mask, O_DELETE, dlr_entry::service, dlr_entry::smsc, dlr_entry::source, dlr_entry::timestamp, and dlr_entry::url.
Referenced by dlr_find(), dlr_mem_flush(), dlr_mem_remove(), dlr_mem_shutdown(), and dlr_spool_add().
Definition at line 119 of file dlr.c.
References dlr_entry::boxc_id, dlr_entry::destination, dlr_entry_create(), dlr_entry::mask, octstr_duplicate, dlr_entry::service, dlr_entry::smsc, dlr_entry::source, dlr_entry::timestamp, and dlr_entry::url.
Referenced by dlr_mem_get().
Definition at line 387 of file dlr.c.
References dlr_entry::boxc_id, debug(), dlr_entry::destination, dlr_entry_destroy(), dlr_storage::dlr_get, DLR_IS_NOT_FINAL, DLR_IS_SUCCESS_OR_FAIL, dlr_mask, dlr_storage::dlr_remove, dlr_type(), dlr_storage::dlr_update, handles, dlr_entry::mask, meta_data_set_value(), METADATA_ORIG_MSG_GROUP, METADATA_ORIG_MSG_GROUP_DLR_MASK, MIN_DST_LEN, msg, msg_create, O_SET, octstr_create, octstr_delete(), octstr_destroy(), octstr_duplicate, octstr_format(), octstr_get_cstr, octstr_imm(), octstr_len(), report_mo, dlr_entry::service, dlr_entry::smsc, dlr_entry::source, dlr_entry::url, dlr_entry::use_dst, and warning().
Referenced by at2_pdu_decode_report_sm(), cgw_handle_op(), cimd2_accept_delivery_report_message(), clickatell_receive_sms(), generic_receive_sms(), handle_dlr(), handle_operation(), kannel_receive_sms(), main_connection_loop(), msg_to_pdu(), oisd_accept_delivery_report_message(), soap_parse_dlr(), and xidris_receive_sms().
void dlr_flush | ( | void | ) |
Definition at line 491 of file dlr.c.
References dlr_storage::dlr_flush, dlr_messages(), dlr_type(), handles, and info().
Referenced by bb_flush_dlr().
void dlr_init | ( | Cfg * | cfg | ) |
Definition at line 233 of file dlr.c.
References cfg, cfg_get, cfg_get_single_group(), dlr_storage::dlr_add, dlr_storage::dlr_get, dlr_init_cass(), dlr_init_mem(), dlr_init_mssql(), dlr_init_mysql(), dlr_init_oracle(), dlr_init_pgsql(), dlr_init_redis(), dlr_init_sdb(), dlr_init_spool(), dlr_init_sqlite3(), dlr_storage::dlr_remove, dlr_type(), handles, info(), octstr_compare(), octstr_destroy(), octstr_get_cstr, octstr_imm(), panic, dlr_storage::type, and warning().
Referenced by init_smppbox(), and main().
long dlr_messages | ( | void | ) |
Definition at line 308 of file dlr.c.
References dlr_storage::dlr_messages, and handles.
Referenced by bb_print_status(), and dlr_flush().
void dlr_shutdown | ( | void | ) |
Definition at line 299 of file dlr.c.
References dlr_storage::dlr_shutdown, and handles.
Referenced by main().
const char* dlr_type | ( | void | ) |
Definition at line 319 of file dlr.c.
References handles, and dlr_storage::type.
Referenced by bb_print_status(), dlr_add(), dlr_find(), dlr_flush(), and dlr_init().
|
static |
Definition at line 97 of file dlr.c.
Referenced by dlr_add(), dlr_find(), dlr_flush(), dlr_init(), dlr_messages(), dlr_shutdown(), and dlr_type().