亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? smsc_smasi.c

?? gnu的專業網關smpp協議支持源代碼。
?? C
?? 第 1 頁 / 共 3 頁
字號:
/* * Implementation of a SM/ASI SMSC module. * * Stipe Tolj <tolj@wapme-systems.de> * * This module connects to a CriticalPath InVoke SMS Center which * uses the SM/ASI protocoll.  * The module is heavily based on the SMPP module design. * * TODO: * 1. alt_dcs is not used. Instead, msg->sms.mclass is used as the SMASI *    Class. * 2. Numbers are not handled correctly, I guess. SMASI allows only(?) *    international numbers without leading double zero. How to ensure *    this? * 3. Handling of npi and ton correct? * 4. SubmitMulti PDUs not supported. * 5. Replace PDUs not supported. * 6. Status PDUs not supported. * 7. Cancel PDUs not supported. * 8. UserRes PDUs not supported. * 9. Smsc PDUs not supported. * 10. EnquireLink PDUs not supported. */#include "gwlib/gwlib.h"#include "msg.h"#include "smsc_p.h"#include "smasi_pdu.h"#include "smscconn_p.h"#include "bb_smscconn_cb.h"#include "sms.h"#include "dlr.h"#define DEBUG 1#ifndef DEBUGstatic void dump_pdu(const char *msg, Octstr *id, SMASI_PDU *pdu) { }#elsestatic void dump_pdu(const char *msg, Octstr *id, SMASI_PDU *pdu) {    debug("bb.sms.smasi", 0, "SMASI[%s]: %s", octstr_get_cstr(id), msg);    smasi_pdu_dump(pdu);}#endif/************************************************************************//* DEFAULT SETTINGS                                                     *//************************************************************************/#define SMASI_DEFAULT_PORT          21500#define SMASI_RECONNECT_DELAY       10.0#define SMASI_DEFAULT_PRIORITY      0#define MAX_PENDING_SUBMITS         10#define SMASI_THROTTLING_SLEEP_TIME 15#define SMASI_ENQUIRE_LINK_INTERVAL  30.0 /************************************************************************//* OVERRIDE SETTINGS                                                    *//************************************************************************//* Set these to -1 if no override desired. Values carried in message will * be used then. Or the defaults - if message has no values. *  * Otherwise these values will be forced! */#define SMASI_OVERRIDE_SOURCE_TON    1#define SMASI_OVERRIDE_SOURCE_NPI    -1#define SMASI_OVERRIDE_DEST_TON      -1#define SMASI_OVERRIDE_DEST_NPI      -1/************************************************************************//* SMASI STRUCTURE AND RELATED FUNCTIONS                                *//************************************************************************/typedef struct {    SMSCConn * conn;                 /* connection to the bearerbox */    int thread_handle;               /* handle for the SMASI thread */    List *msgs_to_send;    Dict *sent_msgs;                 /* hash table for send, but yet not confirmed */    List *received_msgs;             /* list of received, but yet not processed */    Counter *message_id_counter;     /* sequence number */    Octstr *host;                    /* host or IP of the SMASI server */    long port;                       /* port to connect to */    Octstr *username;         Octstr * password;    Octstr * my_number;    long source_addr_ton;    long source_addr_npi;    long dest_addr_ton;    long dest_addr_npi;    long reconnect_delay;    long priority;    time_t throttling_err_time;    int quitting;    long enquire_link_interval;    int logged_off;} SMASI;static SMASI *smasi_create(SMSCConn *conn) {    SMASI *smasi = gw_malloc(sizeof(SMASI));    smasi->conn = conn;    smasi->thread_handle = -1;    smasi->msgs_to_send = list_create();    smasi->sent_msgs = dict_create(16, NULL);    smasi->received_msgs = list_create();    smasi->message_id_counter = counter_create();    smasi->host = NULL;    smasi->username = NULL;    smasi->password = NULL;    smasi->source_addr_ton = -1;    smasi->source_addr_npi = -1;    smasi->dest_addr_ton = -1;    smasi->dest_addr_npi = -1;    smasi->my_number = NULL;    smasi->port = 21500;    smasi->reconnect_delay = 10;    smasi->quitting = 0;    smasi->logged_off = 0;    smasi->priority = 0;    smasi->throttling_err_time = 0;    smasi->enquire_link_interval = 30;    list_add_producer(smasi->msgs_to_send);    return smasi;} static void smasi_destroy(SMASI *smasi) {    if (smasi == NULL) return;    list_destroy(smasi->msgs_to_send, msg_destroy_item);    dict_destroy(smasi->sent_msgs);    list_destroy(smasi->received_msgs, msg_destroy_item);    counter_destroy(smasi->message_id_counter);    octstr_destroy(smasi->host);    octstr_destroy(smasi->username);    octstr_destroy(smasi->password);    gw_free(smasi);} /************************************************************************//* DATA ENCODING                                                        *//************************************************************************//* These values will be initialized on module startup. They contain the * ASCII representation of the chars that need to be escaped in the message * body before transmission. Example: "," (comma) will be represented by * the octet string ":2c". */static Octstr *colon = NULL;static Octstr *assign = NULL;static Octstr *comma = NULL;static Octstr *cr = NULL;static Octstr *lf = NULL;/* * Escapes outgoing message body data by replacing occurrences of "special" * chars inside the octet string. */static void escape_data(Octstr *data) {    long pos = 0;    /* This one uses a different approach than the encode and decode     * functions. Because it is assumed, that only a fraction of the     * contained chars have to be escaped.     */    while (pos < octstr_len(data)) {        Octstr * escaped = NULL;        int check = octstr_get_char(data, pos);        if (check == ':') escaped = colon;        else if (check == '=') escaped = assign;        else if (check == ',') escaped = comma;        else if (check == '\n') escaped = cr;        else if (check == '\r') escaped = lf;        if (escaped != NULL) {            /* If the current char has to be escaped, delete the char from             * the source string, replace it with the escape sequence, and             * advance position until after the inserted sequence.             */            octstr_delete(data, pos, 1);            octstr_insert(data, escaped, pos);            pos += octstr_len(escaped);        } else {            /* If not escaped, simply skip the current char. */            pos++;        }     } } /* * Unescapes incoming message body data by replacing occurrences of escaped * chars with their original character representation. */static void unescape_data(Octstr *data) {    long pos = 0;    /* Again, an inplace transformation is used. Because, again, it is     * assumed that only a fraction of chars has to be unescaped.     */    while (pos < octstr_len(data)) {        int check = octstr_get_char(data, pos);        if (check == ':') {            char byte = 0;            int msb = octstr_get_char(data, pos + 1);            int lsb = octstr_get_char(data, pos + 2);            if (msb == '0') msb = 0;            else if (msb >= '1' && msb <= '9') msb -= '1' + 1;            else msb -= 'a' + 10;            if (lsb == '0') lsb = 0;            else if (lsb >= '1' && lsb <= '9') lsb -= '1' + 1;            else lsb -= 'a' + 10;            byte = msb << 4 | lsb;            /* Do inplace unescaping. */            octstr_delete(data, pos, 3);            octstr_insert_data(data, pos, &byte, 1);        }         pos++;    } }/* * Will replace a binary data octet string (inplace) with a SMASI conform * ASCII representation of the data. */static void encode_binary_data(Octstr *data) {    Octstr *result = octstr_create("");    long pos = 0;    while (pos < octstr_len(data)) {        int encode = octstr_get_char(data, pos);        int msb = (encode & 0xf0) >> 4;        int lsb = (encode & 0x0f) >> 0;        if (msb == 0) msb = '0';        else if (msb < 10) msb = '1' + msb - 1;        else msb = 'a' + msb - 10;        if (lsb == 0) lsb = '0';        else if (lsb < 10) lsb = '1' + lsb - 1;        else lsb = 'a' + lsb - 10;        octstr_append_char(result, ':');        octstr_append_char(result, msb);        octstr_append_char(result, lsb);        pos++;    }     /* Replace binary data octet string with ASCII representation. */    octstr_delete(data, 0, octstr_len(data));    octstr_append(data, result);    octstr_destroy(result);}/* * Replaces a SMASI conform ASCII representation of binary data with the * original binary data octet string. Will abort data decoding if the ASCII * representation is invalid. */static void decode_binary_data(Octstr *data) {    long pos = 0;    Octstr * result = octstr_create("");    for (pos = 0; pos < octstr_len(data); pos += 3) {        int check = octstr_get_char(data, pos);        if (check != ':') {            warning(0, "Malformed binary encoded data.");            return;        } else {            int byte = 0;            int msb = octstr_get_char(data, pos + 1);            int lsb = octstr_get_char(data, pos + 2);            if (msb == '0') msb = 0;            else if (msb >= '1' && msb <= '9') msb = msb - 48;            else msb = msb - 'a' + 10;            if (lsb == '0') lsb = 0;            else if (lsb >= '1' && lsb <= '9') lsb = lsb - 48;            else lsb = lsb - 'a' + 10;            byte = msb << 4 | lsb;            octstr_append_char(result, byte);        }     }     /* Replace ASCII representation with binary data octet string. */    octstr_delete(data, 0, octstr_len(data));    octstr_append(data, result);    octstr_destroy(result);}/************************************************************************//* MESSAGE PROCESSING                                                   *//************************************************************************/static Octstr *get_ton_npi_value(int override, int message) {    if(override != -1) {        debug("bb.sms.smasi", 0, "SMASI: Manually forced source addr ton = %d",               override);        return(octstr_format("%ld", override));    } else {        return(octstr_format("%ld", message));    }}/* * Gets the value to be used as source_addr_ton. Will use override values * if configured. Will use values from message otherwise. Or fall back to * defaults if nothing given. */static Octstr *get_source_addr_ton(SMASI *smasi, Msg *msg) {    return get_ton_npi_value(smasi->source_addr_ton,                              GSM_ADDR_TON_INTERNATIONAL);}/* * Gets the value to be used as source_addr_npi. Will use override values * if configured. Will use values from message otherwise. Or fall back to * defaults if nothing given. */static Octstr *get_source_addr_npi(SMASI *smasi, Msg *msg) {    return get_ton_npi_value(smasi->source_addr_npi,                              GSM_ADDR_NPI_E164);}/* * Gets the value to be used as dest_addr_ton. Will use override values * if configured. Will use values from message otherwise. Or fall back to * defaults if nothing given.

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
国产精品久久久久久久久免费桃花 | 成人18视频在线播放| 色综合色综合色综合色综合色综合| 欧美日韩久久久| 久久精品免视看| 午夜精品福利视频网站| 不卡欧美aaaaa| 欧美一区二区久久| 亚洲一区二区三区四区五区中文| 国产高清久久久久| 日韩欧美中文字幕公布| 一区精品在线播放| 国产麻豆精品视频| 日韩一级片网站| 亚洲国产欧美在线| 91欧美一区二区| 国产精品视频第一区| 美脚の诱脚舐め脚责91| 欧美性受xxxx黑人xyx| 国产精品久久久久久亚洲毛片| 久久国产免费看| 91美女片黄在线| 国产精品美女视频| 免费久久99精品国产| 91麻豆精品国产自产在线| 亚洲主播在线播放| 在线看国产一区二区| 一区二区三区免费在线观看| 成人av免费在线| 中文字幕一区在线观看| 处破女av一区二区| 中文字幕av资源一区| 国内外成人在线视频| 精品国产伦一区二区三区观看方式| 日本vs亚洲vs韩国一区三区| 欧美日韩一区二区不卡| 亚州成人在线电影| 欧美一级日韩免费不卡| 免费精品视频最新在线| 精品久久人人做人人爰| 国产精品一区免费视频| 国产精品麻豆欧美日韩ww| 成人福利视频在线看| 国产精品久久综合| 色狠狠av一区二区三区| 亚洲成人一区在线| 日韩免费一区二区| 国产福利一区二区三区视频在线 | 91猫先生在线| 亚洲国产美国国产综合一区二区| 91福利精品第一导航| 亚洲一区二区精品3399| 日韩三级在线免费观看| 国产成人免费高清| 亚洲欧美偷拍三级| 欧美电影一区二区| 国产激情一区二区三区四区| 中文字幕在线不卡| 欧美福利视频导航| 国产一区二区视频在线播放| 国内欧美视频一区二区| 日韩午夜在线观看视频| 日韩电影在线看| 国产欧美精品在线观看| 国产成人av电影在线| 一区二区在线观看视频在线观看| 欧美日高清视频| 国产成a人无v码亚洲福利| 亚洲尤物在线视频观看| 久久蜜桃av一区精品变态类天堂 | 国产日产欧美一区| 欧美日韩中文字幕一区二区| 国产一区二区三区高清播放| 亚洲一区二三区| 欧美激情一区二区三区在线| 欧美精品久久一区| 97国产一区二区| 99这里只有久久精品视频| 亚洲精品大片www| 欧美xxxxx牲另类人与| 91蜜桃传媒精品久久久一区二区 | 亚洲一二三四在线| 久久亚洲欧美国产精品乐播| 欧美三日本三级三级在线播放| 国v精品久久久网| 免费观看日韩电影| 亚洲综合成人在线视频| 久久日一线二线三线suv| 欧美日韩一级二级| 91色九色蝌蚪| 99精品国产一区二区三区不卡| 麻豆极品一区二区三区| 亚洲大型综合色站| 一区二区三区电影在线播| 亚洲国产高清不卡| 久久综合中文字幕| 日韩美一区二区三区| 91精品国产综合久久久久| 在线视频国内自拍亚洲视频| 白白色亚洲国产精品| 国模无码大尺度一区二区三区| 午夜免费久久看| 亚洲国产美女搞黄色| 亚洲一区在线观看视频| 亚洲另类中文字| 一区二区三区四区国产精品| 亚洲人成在线播放网站岛国| 中文字幕中文字幕在线一区 | 粉嫩在线一区二区三区视频| 久久精品久久综合| 久久福利资源站| 美国精品在线观看| 免费观看一级欧美片| 久久精品999| 精品一区二区三区免费播放| 麻豆精品国产传媒mv男同| 另类人妖一区二区av| 捆绑调教美女网站视频一区| 久久99精品久久久久久国产越南| 偷拍亚洲欧洲综合| 琪琪久久久久日韩精品| 久久99国内精品| 国产精品一品二品| 成人午夜电影久久影院| 不卡高清视频专区| 91丨porny丨在线| 欧美日韩国产乱码电影| 91精品欧美综合在线观看最新| 日韩一区二区高清| 国产三级精品三级| 日韩毛片一二三区| 亚洲一区二区欧美| 久久国产精品一区二区| 久色婷婷小香蕉久久| 成熟亚洲日本毛茸茸凸凹| 99精品在线免费| 欧美人狂配大交3d怪物一区| 欧美草草影院在线视频| 国产亚洲精品福利| 亚洲美女免费视频| 奇米色一区二区| eeuss鲁片一区二区三区在线看| 色婷婷久久综合| 日韩欧美三级在线| 国产精品国产自产拍在线| 亚洲国产欧美在线| 国产福利91精品| 色哟哟一区二区在线观看| 欧美另类高清zo欧美| 日本一区二区免费在线观看视频 | 韩国在线一区二区| 97久久人人超碰| 欧美日本在线看| 国产欧美视频一区二区| 中文字幕在线免费不卡| 日韩理论电影院| 国产麻豆一精品一av一免费| 在线观看免费成人| 欧美在线播放高清精品| 精品国产91亚洲一区二区三区婷婷 | 91福利资源站| 国产欧美一区二区精品忘忧草| 亚洲超丰满肉感bbw| 国产精品456露脸| 91精品黄色片免费大全| 亚洲天堂中文字幕| 国产精品一区二区在线观看不卡| 色丁香久综合在线久综合在线观看| 欧美va亚洲va| 午夜精品在线看| 色狠狠桃花综合| 国产精品三级视频| 国产伦精品一区二区三区免费迷 | 91精品国产91热久久久做人人| 国产精品高潮呻吟久久| 精品亚洲porn| 日韩一区二区三区四区| 亚洲线精品一区二区三区| av激情亚洲男人天堂| 久久欧美一区二区| 激情综合网av| 精品国产91九色蝌蚪| 麻豆精品国产91久久久久久| 欧美精品tushy高清| 亚洲大尺度视频在线观看| 日本道精品一区二区三区| 亚洲色图欧洲色图婷婷| a在线欧美一区| 国产精品免费视频一区| 成人小视频免费在线观看| 国产偷国产偷精品高清尤物| 精品亚洲成a人| 国产欧美一区二区精品忘忧草| 麻豆视频观看网址久久| 日韩欧美高清在线| 奇米精品一区二区三区在线观看一| 欧美日韩国产成人在线91| 亚洲成人av一区二区| 欧美电影影音先锋| 蜜臀av性久久久久蜜臀aⅴ|