Kannel: Open Source WAP and SMS gateway
svn-r5336
|
Go to the source code of this file.
Macros | |
#define | DEFAULT_OUTGOING_SMS_QLENGTH 1000000 |
Enumerations | |
enum | { BB_RUNNING = 0, BB_ISOLATED = 1, BB_SUSPENDED = 2, BB_SHUTDOWN = 3, BB_DEAD = 4, BB_FULL = 5 } |
enum | { BBSTATUS_HTML = 0, BBSTATUS_TEXT = 1, BBSTATUS_WML = 2, BBSTATUS_XML = 3 } |
#define DEFAULT_OUTGOING_SMS_QLENGTH 1000000 |
Definition at line 69 of file bearerbox.h.
Referenced by init_bearerbox().
anonymous enum |
Enumerator | |
---|---|
BB_RUNNING | |
BB_ISOLATED | |
BB_SUSPENDED | |
BB_SHUTDOWN | |
BB_DEAD | |
BB_FULL |
Definition at line 73 of file bearerbox.h.
anonymous enum |
Enumerator | |
---|---|
BBSTATUS_HTML | |
BBSTATUS_TEXT | |
BBSTATUS_WML | |
BBSTATUS_XML |
Definition at line 84 of file bearerbox.h.
int bb_add_smsc | ( | Octstr * | id | ) |
Definition at line 938 of file bearerbox.c.
References smsc2_add_smsc().
Referenced by httpd_add_smsc().
void bb_alog_init | ( | const Octstr * | format | ) |
Definition at line 359 of file bb_alog.c.
References custom_log_format, gw_assert(), and octstr_duplicate.
Referenced by init_bearerbox().
void bb_alog_shutdown | ( | void | ) |
Definition at line 367 of file bb_alog.c.
References custom_log_format, and octstr_destroy().
Referenced by main().
Definition at line 374 of file bb_alog.c.
References alog(), custom_log_format, DC_8BIT, DC_UCS2, get_pattern(), gw_assert(), msg, octstr_binary_to_hex(), octstr_convert_printable(), octstr_create, octstr_destroy(), octstr_duplicate, octstr_get_cstr, octstr_imm(), octstr_len(), smscconn_id(), smscconn_name(), and text.
Referenced by bb_smscconn_receive(), bb_smscconn_receive_internal(), bb_smscconn_send_failed(), bb_smscconn_sent(), and handle_pdu().
int bb_flush_dlr | ( | void | ) |
Definition at line 916 of file bearerbox.c.
References bb_status, BB_SUSPENDED, and dlr_flush().
Referenced by httpd_flush_dlr().
int bb_graceful_restart | ( | void | ) |
Definition at line 954 of file bearerbox.c.
References cfg, cfg_create(), cfg_filename, cfg_read(), error(), info(), octstr_get_cstr, smsbox_restart(), and smsc2_graceful_restart().
Referenced by httpd_graceful_restart(), and main().
int bb_isolate | ( | void | ) |
Definition at line 861 of file bearerbox.c.
References BB_ISOLATED, BB_RUNNING, bb_status, BB_SUSPENDED, gwlist_add_producer(), gwlist_remove_producer(), isolated, mutex_lock, mutex_unlock, smsc2_suspend(), status_mutex, and suspended.
Referenced by httpd_isolate().
Octstr* bb_print_status | ( | int | status_type | ) |
Definition at line 998 of file bearerbox.c.
References append_status, BB_FULL, BB_ISOLATED, BB_RUNNING, bb_status, bb_status_linebreak(), BB_SUSPENDED, BBSTATUS_HTML, BBSTATUS_WML, BBSTATUS_XML, boxc_incoming_wdp_queue(), boxc_status(), counter_value(), dlr_messages(), dlr_type(), gwlist_len(), incoming_dlr_counter, incoming_dlr_load, incoming_sms, incoming_sms_counter, incoming_sms_load, incoming_wdp, incoming_wdp_counter, load_get(), octstr_append_cstr(), octstr_create, octstr_destroy(), octstr_format(), octstr_get_cstr, outgoing_dlr_counter, outgoing_dlr_load, outgoing_sms, outgoing_sms_counter, outgoing_sms_load, outgoing_wdp, outgoing_wdp_counter, smsc2_status(), start_time, store_messages, udp_outgoing_queue(), and version_report_string().
Referenced by httpd_status().
int bb_reload_lists | ( | void | ) |
Definition at line 971 of file bearerbox.c.
References smsc2_reload_lists().
Referenced by httpd_reload_lists().
int bb_reload_smsc_groups | ( | void | ) |
Definition at line 627 of file bb_smscconn.c.
References cfg_create(), cfg_destroy(), cfg_filename, cfg_get_multi_group(), cfg_read(), cfg_reloaded, debug(), gwlist_destroy(), octstr_get_cstr, octstr_imm(), smsc_groups, and warning().
Referenced by smsc2_add_smsc(), and smsc2_restart_smsc().
int bb_remove_message | ( | Octstr * | id | ) |
Definition at line 976 of file bearerbox.c.
References ack_failed, error(), msg, msg_create, msg_destroy(), octstr_get_cstr, store_save, and uuid_parse().
Referenced by httpd_remove_message().
int bb_remove_smsc | ( | Octstr * | id | ) |
Definition at line 943 of file bearerbox.c.
References smsc2_remove_smsc().
Referenced by httpd_remove_smsc().
int bb_restart | ( | void | ) |
Definition at line 948 of file bearerbox.c.
References bb_shutdown(), and restart.
Referenced by httpd_graceful_restart(), and httpd_restart().
int bb_restart_smsc | ( | Octstr * | id | ) |
Definition at line 933 of file bearerbox.c.
References smsc2_restart_smsc().
Referenced by httpd_restart_smsc().
int bb_resume | ( | void | ) |
Definition at line 898 of file bearerbox.c.
References BB_ISOLATED, BB_RUNNING, bb_status, BB_SUSPENDED, gwlist_remove_producer(), isolated, mutex_lock, mutex_unlock, smsc2_resume(), status_mutex, and suspended.
Referenced by httpd_resume().
int bb_shutdown | ( | void | ) |
Definition at line 832 of file bearerbox.c.
References debug(), mutex_lock, mutex_unlock, set_shutdown_status(), smsc2_shutdown(), status_mutex, and udp_shutdown().
Referenced by bb_restart(), httpadmin_run(), httpd_shutdown(), and main().
char* bb_status_linebreak | ( | int | status_type | ) |
Definition at line 1109 of file bearerbox.c.
References BBSTATUS_HTML, BBSTATUS_TEXT, BBSTATUS_WML, and BBSTATUS_XML.
Referenced by bb_print_status(), boxc_status(), httpd_serve(), and smsc2_status().
int bb_stop_smsc | ( | Octstr * | id | ) |
Definition at line 927 of file bearerbox.c.
References smsc2_stop_smsc().
Referenced by httpd_stop_smsc().
int bb_suspend | ( | void | ) |
Definition at line 880 of file bearerbox.c.
References BB_ISOLATED, BB_RUNNING, bb_status, BB_SUSPENDED, gwlist_add_producer(), isolated, mutex_lock, mutex_unlock, smsc2_suspend(), status_mutex, and suspended.
Referenced by httpd_suspend().
void boxc_cleanup | ( | void | ) |
Definition at line 1527 of file bb_boxc.c.
References box_allow_ip, box_deny_ip, boxid, counter_destroy(), octstr_destroy(), and smsbox_interface.
Referenced by main().
int boxc_incoming_wdp_queue | ( | void | ) |
Definition at line 1510 of file bb_boxc.c.
References gwlist_get(), gwlist_len(), gwlist_lock(), gwlist_unlock(), _boxc::incoming, and wapbox_list.
Referenced by bb_print_status().
Octstr* boxc_status | ( | int | status_type | ) |
Definition at line 1386 of file bb_boxc.c.
References _boxc::alive, bb_status_linebreak(), BBSTATUS_HTML, BBSTATUS_TEXT, BBSTATUS_WML, BBSTATUS_XML, _boxc::boxc_id, _boxc::client_ip, _boxc::conn, _boxc::connect_time, dict_key_count(), gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), gwlist_lock(), gwlist_unlock(), _boxc::incoming, octstr_append_cstr(), octstr_create, octstr_destroy(), octstr_format(), octstr_format_append(), octstr_get_cstr, _boxc::sent, smsbox_list, smsbox_list_rwlock, and wapbox_list.
Referenced by bb_print_status().
int httpadmin_start | ( | Cfg * | config | ) |
Definition at line 557 of file bb_http.c.
References cfg, cfg_get, cfg_get_bool(), cfg_get_integer(), cfg_get_single_group(), gwthread_create, ha_allow_ip, ha_deny_ip, ha_interface, ha_password, ha_port, ha_status_pw, http_open_port_if(), httpadmin_run(), httpadmin_running, octstr_destroy(), octstr_imm(), panic, and ssl.
Referenced by init_bearerbox().
void httpadmin_stop | ( | void | ) |
Definition at line 618 of file bb_http.c.
References gwthread_join_every(), ha_allow_ip, ha_deny_ip, ha_interface, ha_password, ha_status_pw, http_close_all_ports(), httpadmin_run(), and octstr_destroy().
Referenced by main().
int route_incoming_to_boxc | ( | Msg * | msg | ) |
Definition at line 1549 of file bb_boxc.c.
References _boxc::boxc_id, dict_get(), gw_assert(), gw_rand(), gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), gwlist_produce(), _boxc::incoming, incoming_sms, _boxc::load, max_incoming_sms_qlength, msg, octstr_destroy(), octstr_format(), octstr_get_cstr, octstr_len(), _boxc::routable, smsbox_by_default, smsbox_by_id, smsbox_by_receiver, smsbox_by_smsc, smsbox_by_smsc_receiver, smsbox_list, smsbox_list_rwlock, and warning().
Referenced by bb_smscconn_receive_internal(), and sms_to_smsboxes().
int smsbox_restart | ( | Cfg * | config | ) |
Definition at line 1316 of file bb_boxc.c.
References cfg, dict_create(), dict_destroy(), gw_rwlock_unlock(), gw_rwlock_wrlock(), init_smsbox_routes(), octstr_destroy(), smsbox_by_default, smsbox_by_receiver, smsbox_by_smsc, smsbox_by_smsc_receiver, smsbox_list_rwlock, and smsbox_running.
Referenced by bb_graceful_restart().
int smsbox_start | ( | Cfg * | config | ) |
Definition at line 1250 of file bb_boxc.c.
References box_allow_ip, box_deny_ip, boxc_gwlist_destroy(), boxid, cfg, cfg_get, cfg_get_bool(), cfg_get_integer(), cfg_get_single_group(), counter_create(), debug(), dict_create(), error(), gw_rwlock_create(), gwlist_add_producer(), gwlist_create, gwthread_create, info(), init_smsbox_routes(), octstr_create, octstr_destroy(), octstr_imm(), outgoing_sms, panic, sms_dequeue_thread, sms_to_smsboxes(), smsbox_by_default, smsbox_by_id, smsbox_by_receiver, smsbox_by_smsc, smsbox_by_smsc_receiver, smsbox_interface, smsbox_list, smsbox_list_rwlock, SMSBOX_MAX_PENDING, smsbox_max_pending, smsbox_port, smsbox_port_ssl, smsbox_running, and smsboxc_run().
Referenced by start_smsc().
int smsc2_add_smsc | ( | Octstr * | id | ) |
Definition at line 1112 of file bb_smscconn.c.
References bb_reload_smsc_groups(), cfg_get, smscconn::dead_start, error(), gw_rwlock_unlock(), gw_rwlock_wrlock(), gwlist_add_producer(), gwlist_append(), gwlist_get(), gwlist_len(), gwlist_remove_producer(), octstr_compare(), octstr_destroy(), octstr_get_cstr, octstr_imm(), smsc2_find(), smsc_groups, smsc_list, smsc_list_lock, smsc_running, smscconn_create(), smscconn_instances(), smscconn_shutdown(), smscconn_start(), and warning().
Referenced by bb_add_smsc().
void smsc2_cleanup | ( | void | ) |
Definition at line 1314 of file bb_smscconn.c.
References black_list_receiver, black_list_receiver_regex, black_list_receiver_url, black_list_sender, black_list_sender_regex, black_list_sender_url, concat_handling_cleanup(), counter_destroy(), debug(), gw_rwlock_destroy(), gw_rwlock_unlock(), gw_rwlock_wrlock(), gwlist_destroy(), gwlist_get(), gwlist_len(), numhash_destroy(), octstr_destroy(), smsc_groups, smsc_list, smsc_list_lock, smsc_running, smscconn_destroy(), split_msg_counter, unified_prefix, white_black_list_lock, white_list_receiver, white_list_receiver_regex, white_list_receiver_url, white_list_sender, white_list_sender_regex, and white_list_sender_url.
Referenced by main().
int smsc2_graceful_restart | ( | Cfg * | config | ) |
Definition at line 1530 of file bb_smscconn.c.
References cfg, cfg_get_multi_group(), cmp_conn_grp_checksum(), cmp_conn_grp_id(), cmp_rout_grp_checksum(), gw_rwlock_unlock(), gw_rwlock_wrlock(), gwlist_add_producer(), gwlist_append(), gwlist_create, gwlist_delete(), gwlist_destroy(), gwlist_extract_first(), gwlist_get(), gwlist_len(), gwlist_remove_producer(), gwlist_search_all(), gwlist_search_equal(), gwthread_sleep(), gwthread_wakeup(), smscconn::id, info(), octstr_get_cstr, octstr_imm(), router_thread, smsc_groups, smsc_list, smsc_list_lock, smsc_running, smscconn_create(), smscconn_destroy(), smscconn_instances(), smscconn_reconfig(), smscconn_shutdown(), and smscconn_start().
Referenced by bb_graceful_restart().
int smsc2_reload_lists | ( | void | ) |
Definition at line 1174 of file bb_smscconn.c.
References black_list_receiver, black_list_receiver_url, black_list_sender, black_list_sender_url, error(), gw_rwlock_unlock(), gw_rwlock_wrlock(), numhash_create(), numhash_destroy(), octstr_get_cstr, white_black_list_lock, white_list_receiver, white_list_receiver_url, white_list_sender, and white_list_sender_url.
Referenced by bb_reload_lists().
int smsc2_remove_smsc | ( | Octstr * | id | ) |
Definition at line 1083 of file bb_smscconn.c.
References error(), gw_rwlock_unlock(), gw_rwlock_wrlock(), gwlist_add_producer(), gwlist_delete(), gwlist_get(), gwlist_remove_producer(), octstr_get_cstr, smsc2_find(), smsc_list, smsc_list_lock, smsc_running, smscconn_destroy(), and smscconn_shutdown().
Referenced by bb_remove_smsc().
int smsc2_restart | ( | Cfg * | config | ) |
int smsc2_restart_smsc | ( | Octstr * | id | ) |
Definition at line 998 of file bb_smscconn.c.
References bb_reload_smsc_groups(), cfg_get, error(), gw_rwlock_unlock(), gw_rwlock_wrlock(), gwlist_delete(), gwlist_get(), gwlist_insert(), gwlist_len(), gwthread_wakeup(), info(), octstr_compare(), octstr_destroy(), octstr_get_cstr, octstr_imm(), router_thread, smsc2_find(), smsc_groups, smsc_list, smsc_list_lock, smsc_running, smscconn_create(), SMSCCONN_DEAD, smscconn_destroy(), smscconn_start(), smscconn_status(), and warning().
Referenced by bb_restart_smsc().
void smsc2_resume | ( | int | is_init | ) |
Definition at line 1234 of file bb_smscconn.c.
References smscconn::dead_start, gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), gwthread_wakeup(), router_thread, smsc_list, smsc_list_lock, smsc_running, smscconn_shutdown(), and smscconn_start().
Referenced by bb_resume(), and main().
long smsc2_rout | ( | Msg * | msg, |
int | resend | ||
) |
Definition at line 1716 of file bb_smscconn.c.
References BB_SHUTDOWN, bb_smscconn_send_failed(), bb_status, black_list_receiver, black_list_receiver_regex, black_list_sender, black_list_sender_regex, debug(), error(), gw_rand(), gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), gwlist_produce(), gwlist_search_equal(), info(), smsc_state::load, max_outgoing_sms_qlength, msg, msg_destroy(), msg_duplicate(), normalize_number(), numhash_find_number(), octstr_create, octstr_get_cstr, outgoing_sms, smsc_state::queued, SMS_PARAM_UNDEFINED, smsc2_rout(), split_parts::smsc_conn, smsc_list, smsc_list_lock, SMSCCONN_ACTIVE, SMSCCONN_FAILED_DISCARDED, SMSCCONN_FAILED_EXPIRED, SMSCCONN_FAILED_QFULL, SMSCCONN_FAILED_REJECTED, smscconn_info(), SMSCCONN_QUEUED, smscconn_send(), SMSCCONN_SUCCESS, smscconn_usable(), smsc_state::status, unified_prefix, warning(), white_black_list_lock, white_list_receiver, white_list_receiver_regex, white_list_sender, and white_list_sender_regex.
Referenced by deliver_sms_to_queue(), route_incoming_to_smsc(), sms_router(), and smsc2_rout().
int smsc2_shutdown | ( | void | ) |
Definition at line 1276 of file bb_smscconn.c.
References concat_handling_shutdown(), gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), gwlist_remove_producer(), gwthread_wakeup(), incoming_sms, router_thread, smpp_pdu_shutdown(), smsc_list, smsc_list_lock, smsc_running, and smscconn_shutdown().
Referenced by bb_shutdown().
int smsc2_start | ( | Cfg * | config | ) |
Definition at line 806 of file bb_smscconn.c.
References black_list_receiver, black_list_receiver_regex, black_list_receiver_url, black_list_sender, black_list_sender_regex, black_list_sender_url, cfg, cfg_get, cfg_get_bool(), cfg_get_integer(), cfg_get_multi_group(), cfg_get_single_group(), cfg_reloaded, concat_handling_init(), concatenated_mo_timeout, counter_create(), gw_rwlock_init_static(), gwlist_add_producer(), gwlist_append(), gwlist_create, gwlist_get(), gwlist_len(), gwlist_remove_producer(), gwthread_create, handle_concatenated_mo, incoming_sms, info(), numhash_create(), octstr_destroy(), octstr_get_cstr, octstr_imm(), panic, router_thread, smpp_pdu_init(), sms_resend_frequency, sms_resend_retry, sms_router(), smsc_groups, smsc_list, smsc_list_lock, smsc_running, smscconn_create(), smscconn_instances(), split_msg_counter, unified_prefix, warning(), white_black_list_lock, white_list_receiver, white_list_receiver_regex, white_list_receiver_url, white_list_sender, white_list_sender_regex, and white_list_sender_url.
Referenced by start_smsc().
Octstr* smsc2_status | ( | int | status_type | ) |
Definition at line 1362 of file bb_smscconn.c.
References bb_status_linebreak(), BBSTATUS_HTML, BBSTATUS_TEXT, BBSTATUS_WML, BBSTATUS_XML, gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), smscconn::incoming_dlr_load, smscconn::incoming_sms_load, info(), load_get(), octstr_append(), octstr_append_cstr(), octstr_create, octstr_format(), octstr_format_append(), octstr_imm(), smscconn::outgoing_dlr_load, smscconn::outgoing_sms_load, smsc_list, smsc_list_lock, smsc_running, SMSCCONN_ACTIVE, SMSCCONN_ACTIVE_RECV, smscconn_admin_id(), SMSCCONN_CONNECTING, SMSCCONN_DEAD, SMSCCONN_DISCONNECTED, smscconn_id(), smscconn_info(), smscconn_name(), and SMSCCONN_RECONNECTING.
Referenced by bb_print_status().
int smsc2_stop_smsc | ( | Octstr * | id | ) |
Definition at line 968 of file bb_smscconn.c.
References error(), gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), info(), octstr_get_cstr, smsc2_find(), smsc_list, smsc_list_lock, smsc_running, SMSCCONN_DEAD, smscconn_shutdown(), and smscconn_status().
Referenced by bb_stop_smsc().
void smsc2_suspend | ( | void | ) |
Definition at line 1259 of file bb_smscconn.c.
References gw_rwlock_rdlock(), gw_rwlock_unlock(), gwlist_get(), gwlist_len(), smsc_list, smsc_list_lock, smsc_running, and smscconn_stop().
Referenced by bb_isolate(), and bb_suspend().
int udp_addwdp | ( | Msg * | msg | ) |
Definition at line 385 of file bb_udp.c.
References _udpc::addr, gwlist_get(), gwlist_len(), gwlist_lock(), gwlist_produce(), gwlist_unlock(), msg, octstr_compare(), octstr_destroy(), _udpc::outgoing_list, udp_get_ip(), udp_get_port(), udp_running, and udpc_list.
Referenced by wdp_router().
int udp_die | ( | void | ) |
Definition at line 434 of file bb_udp.c.
References allow_ip, debug(), deny_ip, gwlist_consume(), gwlist_destroy(), gwlist_remove_producer(), octstr_destroy(), _udpc::outgoing_list, udp_running, and udpc_list.
Referenced by wdp_router().
int udp_outgoing_queue | ( | void | ) |
Definition at line 460 of file bb_udp.c.
References gwlist_get(), gwlist_len(), gwlist_lock(), gwlist_unlock(), _udpc::outgoing_list, udp_running, and udpc_list.
Referenced by bb_print_status().
int udp_shutdown | ( | void | ) |
Definition at line 424 of file bb_udp.c.
References debug(), gwlist_remove_producer(), incoming_wdp, and udp_running.
Referenced by bb_shutdown().
int udp_start | ( | Cfg * | config | ) |
Definition at line 323 of file bb_udp.c.
References add_service(), allow_ip, cfg, cfg_get, cfg_get_single_group(), debug(), deny_ip, error(), gwlist_add_producer(), gwlist_create, gwlist_destroy(), gwlist_extract_first(), gwlist_len(), incoming_wdp, info(), octstr_destroy(), octstr_get_cstr, octstr_imm(), octstr_split(), udp_running, and udpc_list.
Referenced by start_udp().
int wapbox_start | ( | Cfg * | config | ) |
Definition at line 1339 of file bb_boxc.c.
References box_allow_ip, box_deny_ip, boxid, cfg, cfg_get, cfg_get_bool(), cfg_get_integer(), cfg_get_single_group(), counter_create(), debug(), error(), gwlist_add_producer(), gwlist_create, gwthread_create, info(), octstr_create, octstr_imm(), outgoing_wdp, panic, wapbox_list, wapbox_port, wapbox_port_ssl, wapbox_running, wapboxc_run(), and wdp_to_wapboxes().
Referenced by start_wap().