114 #include <sys/types.h>   115 #include <sys/socket.h>   131 #include <libxml/xmlmemory.h>   132 #include <libxml/parser.h>   135 #define SOAP_SLEEP_TIME             0.01   136 #define SOAP_MAX_MESSAGE_PER_ROUND      1   137 #define SOAP_DEFAULT_SENDER_STRING      "Kannel"   138 #define SOAP_DEFAULT_VALIDITY           60   141 #define SOAP_MO_URI         "/mo"   142 #define SOAP_DLR_URI        "/dlr"   145 #define SOAP_DEFAULT_MESSAGE                "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Error>No method by that name</Error>"   146 #define SOAP_ERROR_NO_DLR_MESSAGE           "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Error>Sorry - no DLR for that MT</Error>"   147 #define SOAP_ERROR_DLR_MESSAGE              "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Error>Fatal error while trying to parse delivery report</Error>"   148 #define SOAP_ERROR_MO_MESSAGE               "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Error>Fatal error while trying to parse incoming MO</Error>"   149 #define SOAP_ERROR_NO_DATA_MESSAGE          "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Error>No data received</Error>"   150 #define SOAP_ERROR_MALFORMED_DATA_MESSAGE           "<?xml version=\"1.0\" encoding=\"UTF-8\"?>\r\n<Error>Malformed data received</Error>"   153 #define SOAP_ERROR_NO_DLR_CODE              HTTP_BAD_METHOD   154 #define SOAP_DEFAULT_CODE               HTTP_NOT_FOUND   155 #define SOAP_ERROR_DLR_CODE             HTTP_INTERNAL_SERVER_ERROR   156 #define SOAP_ERROR_MO_CODE              HTTP_INTERNAL_SERVER_ERROR   157 #define SOAP_ERROR_NO_DATA_CODE             HTTP_NOT_IMPLEMENTED   158 #define SOAP_ERROR_MALFORMED_DATA_CODE                  HTTP_BAD_GATEWAY   159 #define SOAP_QUERY_OK                   HTTP_OK   164 #define MIN_SOAP_CLIENTS            5   165 #define MAX_SOAP_CLIENTS            50   166 #define CLIENT_BUSY_TIME            5   167 #define CLIENT_TEARDOWN_TIME        600   168 #define CLIENT_BUSY_LOAD            5   170 #define SPEC_DEFAULT                "default"   225 #define O_DESTROY(a)    { if(a) octstr_destroy(a); a=NULL; }   358     List* filenames = NULL;
   397         error(0, 
"invalid port definition for SOAP server (%ld) - aborting", 
   403         error(0, 
"invalid or missing send-url definition for SOAP - aborting.");
   408         error(0, 
"invalid or missing form variable name definition for SOAP - aborting.");
   417         error(0,
"SOAP: Not enough template files for XML generation, you need 3 - aborting"); 
   422         error(0,
"SOAP: Can't load XML template for MT - aborting"); 
   429         error(0,
"SOAP: Can't load XML template for MO - aborting"); 
   436         error(0,
"SOAP: Can't load XML template for DLR - aborting"); 
   446         error(0,
"Not enough spec files for XML parsing, you need 4 - aborting"); 
   451         error(0,
"Can't load spec for MT parsing - aborting"); 
   457         error(0,
"SOAP: Can't load spec for MO parsing - aborting"); 
   463         error(0,
"SOAP: Can't load spec for DLR parsing - aborting"); 
   470         error(0,
"SOAP: Can't load 'deps' file for MO processing - aborting"); 
   477     debug(
"bb.soap.create",0,
"Connecting to %s",
   510         error(0, 
"SOAP: soap_create, failed to spawn thread - aborting");
   518     error(0, 
"SOAP: Failed to create SOAP smsc connection");
   576     debug(
"bb.soap.add_msg",0,
"SOAP[%s]: got a new MT from %s, list has now %ld MTs", 
   603     debug(
"bb.soap.cb", 0, 
"SOAP[%s]: Shutting down SMSCConn, %s", 
   613     if (finish_sending == 0) {
   638     debug(
"smsc.soap.start", 0, 
"SOAP[%s]: start called", 
   647         error(0, 
"SOAP: soap_start, failed to spawn thread - aborting");
   654     debug(
"smsc.soap.start",0,
"SOAP[%s]: starting OK", 
   673     debug(
"smsc.soap.stop", 0, 
"SOAP[%s]: stop called", 
   723     debug(
"bb.soap.listener",0,
"SOAP[%s]: listener entering", 
   738                     error(0, 
"SOAP[%s]: failed to start HTTP server!", 
   783     debug(
"bb.soap.connection",0,
"SOAP[%s]: connection shutting down", 
   789     debug(
"bb.soap.connection",0,
"SOAP[%s]: sending messages back to bearerbox", 
   798     debug(
"bb.soap.connection",0,
"SOAP[%s]: playing dead", 
   803     debug(
"bb.soap.connection",0,
"SOAP[%s]: don't need the queue anymore", 
   810     debug(
"bb.soap.connection",0,
"SOAP[%s]: tell caller to stop", 
   816     debug(
"bb.soap.connection",0,
"SOAP[%s]: done with privdata", 
   840     debug(
"bb.soap.connection", 0, 
"SOAP: module has completed shutdown.");
   857     List *request_headers = NULL, *response_headers = NULL;
   858     List *cgivars = NULL;
   859     Octstr *client_ip = NULL, *request_uri = NULL, *request_body = NULL;
   860     Octstr *response_body = NULL;
   862     int http_response_status;
   864     debug(
"bb.soap.server",0,
"SOAP[%s]: Server starting", 
   876                               &client_ip, &request_uri, &request_headers, 
   877                               &request_body, &cgivars))) {
   879             debug(
"bb.soap.server",0,
"SOAP[%s]: server got a request for "   887                 if ((http_response_status = 
   890                     error(0,
"SOAP[%s]: fatal error parsing MO", 
   897                 if ((http_response_status = 
   900                     error(0,
"SOAP[%s]: fatal error parsing DLR", 
   930             http_send_reply(remote_client,http_response_status,response_headers, response_body);
   948     debug(
"bb.soap.server",0,
"SOAP[%s]: server going down", 
   970     debug(
"bb.soap.client",0,
"SOAP[%s]: client - entering", 
   983             debug(
"bb.soap.client",0,
"SOAP[%s]: client - failed to format message for sending", 
   990         debug(
"bb.soap.client",0,
"SOAP[%s]: client - Sending message <%s>",
   993             debug(
"bb.soap.client",0,
"SOAP[%s]: data dump: %s",
  1019     int curly_enclose = 0;
  1032         if (c == 
'{' && 
start == t) { 
  1040             (curly_enclose && (c == 
'}')) 
  1042             (!curly_enclose && !((c >= 
'a' && c <= 
'z') || (c >= 
'A' && c <= 
'Z') || 
  1043                                  (c >= 
'0' && c <= 
'9') || c == 
'_'))) {
  1052                 error(0,
"SOAP: format_xml - failed to format token %s using message",
  1082     List *requestHeaders;
  1090         http_header_add(requestHeaders, 
"Content-Type", 
"application/x-www-form-urlencoded");
  1093         http_header_add(requestHeaders, 
"Content-Type", 
"multipart/form-data, boundary=AaB03x");
  1095                                  "content-disposition: form-data; name=\"%S\"\r\n\r\n%S",
  1122     Octstr *responseBody, *responseURL;
  1123     List* responseHeaders;
  1147     if (responseStatus == -1) {
  1148         debug(
"bb.soap.read_response",0,
"SOAP[%s]: HTTP connection failed - blame the server (requeing msg)",
  1157     debug(
"bb.soap.read_response",0,
"SOAP[%s]: got a response %d= %s",
  1173         sprintf(tmpid,
"%lld",msgID);
  1207     long long msgID = -1;
  1208     long responseStatus = -1;
  1209     xmlDocPtr responseDoc;
  1212     char* 
keywords[] = { 
"id", 
"result" };
  1213     char* sscans[] = { 
"%lld", 
"%ld" };
  1214     void* pointers[] = { &msgID, &responseStatus };
  1221     if ( !(responseDoc = xmlParseDoc((xmlChar *)
octstr_get_cstr(xmlResponse))) ) {
  1222         error(0,
"SOAP[%s]: couldn't parse XML response [ %s ] in MT parsing",
  1228     if ( ! (root = xmlDocGetRootElement(responseDoc)) ) {
  1229         error(0,
"SOAP[%s]: couldn't get XML root element in MT parsing",
  1231         xmlFreeDoc(responseDoc);
  1240         error(0,
"SOAP[%s]: failed to map all the arguments from the XML data",
  1247     xmlFreeDoc(responseDoc);
  1250         if (responseStatus == 0) {   
  1251             warning(0, 
"SOAP[%s]: parse_response - the protocol does not support message ID",
  1256             error(0,
"SOAP[%s]: parse_response - response code isn't 0 ! (%ld)",
  1278     xmlDocPtr requestDoc;
  1287     char receiver[30], sender[30], msgtype[30], msgdata[255], 
date[30];
  1288     long long msgid = -1;
  1289     char* 
keywords[] = { 
"receiver", 
"sender", 
"msgtype", 
"msgdata", 
"date", 
"id" };
  1290     char* sscans[] = { 
"%s", 
"%s", 
"%s", 
"%s", 
"%s", 
"%lld" };
  1291     void* pointers[] = { &
receiver, &sender, &msgtype, &msgdata, &
date, &msgid };
  1293     receiver[0] = sender[0] = msgtype[0] = msgdata[0] = 
date[0] = 
'\0';
  1324     if ( !(requestDoc = xmlParseDoc((xmlChar *)
octstr_get_cstr(request))) ) {
  1330     if ( ! (root = xmlDocGetRootElement(requestDoc)) ) {
  1332         xmlFreeDoc(requestDoc);
  1342         error(0,
"SOAP[%s]: parse_mo failed to map all the arguments from the XML data",
  1347     xmlFreeDoc(requestDoc);
  1350         error(0,
"SOAP: parse_mo - failed to get receiver");
  1355     if (strlen(sender) == 0) {
  1356         error(0,
"SOAP: parse_mo - failed to get sender");
  1361     if (strlen(msgdata) == 0) {
  1362         error(0,
"SOAP: parse_mo - failed to get message content");
  1393             error(0,
"SOAP: parse_mo - failed to release all dependences");
  1403             msg->sms.time = time(NULL);
  1408         msg->sms.time = time(NULL);
  1477     if (!(
msg->sms.sender)
  1479             !(
msg->sms.msgdata)) {
  1486     if (
msg->sms.time <= 0)
  1487         msg->sms.time = time(NULL);
  1489     if (!
msg->sms.receiver)
  1492     if (!
msg->sms.smsc_id)
  1515     xmlDocPtr requestDoc;
  1522     char receiver[30], soapdate[30], msgid[30];
  1524     char* 
keywords[] = { 
"receiver", 
"soapdate", 
"id", 
"result" };
  1526     char* sscans[] = { 
"%s", 
"%s", 
"%s", 
"%ld" };
  1527     void* pointers[] = { &
receiver, &soapdate, &msgid, &result };
  1529     receiver[0] = soapdate[0] = msgid[0] = 
'\0';
  1560     if ( !(requestDoc = xmlParseDoc((xmlChar *)
octstr_get_cstr(request))) ) {
  1566     if ( ! (root = xmlDocGetRootElement(requestDoc)) ) {
  1569         xmlFreeDoc(requestDoc);
  1579         error(0,
"SOAP[%s]: parse_dlr failed to map all the arguments from the XML data",
  1587     xmlFreeDoc(requestDoc);
  1589     if (strlen(msgid) == 0) {
  1590         error(0,
"SOAP: parse_dlr - failed to get message ID");
  1597         error(0,
"SOAP: parse_dlr - failed to get delivery code");
  1681     xmlChar* nodeContent;
  1688     if (!(nodeContent = xmlNodeGetContent(cur))) {
  1689         error(0,
"SOAP: get_long - xml Node has content !");
  1694     *out = strtol((
char *)nodeContent,&endPointer,10);
  1695     xmlFree(nodeContent);
  1697     if (endPointer == (
char*)nodeContent) {
  1698         error(0,
"SOAP: get_long - node has non-numeric content <%s>", nodeContent);
  1714     xmlChar* nodeContent;
  1721     if (!(nodeContent = xmlNodeGetContent(cur))) {
  1722         error(0,
"SOAP: get_long - xml Node has content !");
  1728     *out = strtoll((
char *)nodeContent,&endPointer,10);
  1729     xmlFree(nodeContent);
  1731     if (endPointer == (
char*)nodeContent) {
  1732         error(0,
"SOAP: get_long - node has non-numeric content <%s>", nodeContent);
  1748     xmlChar* nodeContent;
  1754     if (!(nodeContent = xmlNodeGetContent(cur))) {
  1755         error(0,
"SOAP: get_octstr - xml Node has content !");
  1761     xmlFree(nodeContent);
  1789     while (count < 5 && pos < 
octstr_len(dateString) &&
  1795         debug(
"bb.soap.read_date",0,
"read_date failed parsing the date value <%s>", 
octstr_get_cstr(dateString));
  1799     stTime.
day = arTime[0];
  1800     stTime.
month = arTime[1];
  1801     stTime.
year = arTime[2];
  1802     stTime.
hour = arTime[3];
  1803     stTime.
minute = arTime[4];
  1816     struct tm date_parts;
  1825     gmtime_r(&
date, &date_parts);
  1828                         date_parts.tm_year + 1900, date_parts.tm_mon + 1, date_parts.tm_mday, date_parts.tm_hour, date_parts.tm_min);
  2020     for (index = 
gwlist_len(client_list) - 1; index >= 0; --index) {
  2050 #define INTEGER(fieldname) \  2051         if (!octstr_str_compare(name, #fieldname)) { \  2052                 sprintf(buf,"%ld", p->fieldname); \  2053                 return octstr_create(buf); \  2055 #define INT64(fieldname) \  2056         if (!octstr_str_compare(name, #fieldname)) { \  2057                 sprintf(buf,"%lld", p->fieldname); \  2058                 return octstr_create(buf); \  2060 #define OCTSTR(fieldname) \  2061         if (!octstr_str_compare(name, #fieldname)) \  2062                 return octstr_duplicate(p->fieldname);  2063 #define UUID(fieldname)   2064 #define VOID(fieldname)  2066 #define MSG(type, stmt) \  2067         case type: { struct type *p = &msg->type; stmt } break;  2069     switch (
msg->type) {
  2074             error(0, 
"SOAP: Internal error: unknown message type %d", 
msg->type);
  2090     List *parse_items, *out;
  2106             debug(
"bb.soap.parse_create_map",0,
"SOAP: broken spec file line <%s> in soap_create_map",
  2114         for (index = 0; index < count; ++index) {
  2122                 map->
store = storage[index];
  2164     Octstr *temp, *xml_path, *attr_name = NULL;
  2165     List* path_elements;
  2167     xmlNodePtr parent, node;
  2202                 if (!(node->xmlChildrenNode) && index < (
gwlist_len(path_elements)-1)) {
  2205                     debug(
"bb.soap.fetch_xml_data",0,
"SOAP: fetch_xml - error parsing XML, "  2206                           "looking for <%s>, but element <%s> has no children",
  2211                     node = node->xmlChildrenNode; 
  2217         } 
while ((node = node->next));
  2222             parent = node->parent;
  2227             if (!(node = node->next))
  2240         debug(
"bb.soap.map_xml_data",0,
"SOAP: fetch_xml - path <%s> cannot be traveled in input XML",
  2261         content = xmlNodeGetContent(parent);
  2284     int mapindex = 0, args = 0;
  2285     xmlNodePtr node, parent;
  2307                     if (!(node->xmlChildrenNode) && index < (
gwlist_len(path_elements)-1)) {
  2310                         debug(
"bb.soap.map_xml_data",0,
"SOAP: error parsing XML, looking for <%s>, but element <%s> has no children",
  2315                         node = node->xmlChildrenNode; 
  2320             } 
while ((node = node->next));
  2328                 parent = node->parent;
  2333                 if (!(node = node->next))
  2343             debug(
"bb.soap.map_xml_data",0,
"SOAP: didn't find element for keyword <%s> in XML data",
  2364             content = xmlNodeGetContent(parent);
  2382                 debug(
"bb.soap.map_xml_data",0,
"SOAP: failed to scan content '%s' for '%s' in xml parsing",
  2407     long i, j, key_index, key_deps_index, map_index;
  2409     List *issue_items, *header_item;
  2412     Octstr *header, *key, *key_deps;
  2413     Octstr *func_alias = NULL, *block;
  2430     char* funcs[][5] = {    
  2431                            {
"text",
"binary",
"unicode",
"default"},                     
  2432                            {
"set_iso",
"64_binary",
"hex_binary",
"unicode",
"default"}  
  2439         error(0, 
"SOAP: soap_release_dependences, empty or broken 'deps' file");
  2451             error(0, 
"SOAP: soap_release_dependences, broken file 'deps' can't find any definition for <key>");
  2463             error(0, 
"SOAP: soap_release_dependences, broken 'deps' file in <key> <key_deps> part");
  2475         if (key_index == -1 || key_deps_index == -1) {
  2486         for (j=0; j < 
gwlist_len(issue_items); ++j) {
  2498                 error(0, 
"SOAP: soap_release_dependences, \  2499                       can't find function_alias for <%s> in 'deps' file, set default", (
char*)map->
store);
  2505         key_func_index = -1;
  2507         for (k=0; k < 
sizeof(funcs[key_index])/
sizeof(funcs[key_index][0]); ++k)
  2514         if (key_func_index==-1)
  2515             error(0, 
"SOAP: soap_release_dependences, can't find function for alias <%s>", 
octstr_get_cstr(func_alias));
  2524             error(0, 
"SOAP: soap_release_dependences, error processing dependent value");
  2560     switch (key_func_index)
  2575             error(0, 
"SOAP: soap_msgtype_deps, unknown index %d", key_func_index);
  2587     switch (key_func_index)
  2603                 debug(
"bb.soap.msgdata_deps",0,
"SOAP[%s]: converting from %s to UCS-2BE",
  2609                     error(2,
"SOAP[%s]: Error converting MO data from %s to unicode",
  2613             else if (ret != 0) {
  2614                 debug(
"bb.soap.parse_mo",1,
"SOAP[%s]: charset_convert made %d irreversable transformations",
  2626             error(0, 
"SOAP: soap_msgdata_deps, unknown index %d", key_func_index);
  2643                           "bouyg_content", 
"mobitai_content",
  2644                           "o2o_msgdata", 
"msgdata",
  2645                           "o2o_validity30", 
"mobitai_validity_date", 
"bouyg_validity",
  2646                           "o2o_date", 
"mobitai_date", 
"rand",
  2647                           "o2o_dlrmask_smsc_yn", 
"o2o_dlrmask_success_01"  2650     for (i=0; i<
sizeof(aliasis)/
sizeof(aliasis[0]); ++i)
  2693             error(0,
"SOAP: soap_select_function can't find function");
  2720     Octstr *data, *res, *udhres;
  2726         debug(
"bb.soap.o2o_msgdata_attribute",0,
"SOAP: base 64 encoding");
  2728         res = 
octstr_format(
"<Control_Data>%S</Control_Data>", data);
  2733             debug(
"bb.soap.o2o_msgdata_attribute",0,
"SOAP: UDH base 64 encoding");
  2740             error(0, 
"SOAP: o2o_msgdata_attribute, UDH not defined");
  2753             error(0,
"SOAP: soap_o2o_msgdata_attribute, charset_convert failed");
  2758         debug(
"bb.soap.o2o_msgdata_attribute",0,
"SOAP: converting to HTML entities");
  2760         res = 
octstr_format(
"<Message_Text>%S</Message_Text>", data);
  2769             error(0,
"SOAP: soap_o2o_msgdata_attribute, charset_convert failed");
  2775         res = 
octstr_format(
"<Message_Text>%s</Message_Text>", data);
  2781         error(0,
"SOAP: soap_o2o_msgdata_attribute, unknown coding: %ld", 
msg->sms.coding);
  2809             error(0,
"SOAP: soap_msgdata_attribute, charset_convert failed");
  2814         debug(
"bb.soap.msgdata_attribute",0,
"SOAP: converting to HTML entities");
  2823             error(0,
"SOAP: soap_msgdata_attribute, charset_convert failed");
  2832         error(0,
"SOAP: soap_msgdata_attribute, unknown coding: %ld", 
msg->sms.coding);
  2896     char* funcs_deps[] = {
  2897                              "msgtype", 
"msgdata"  2906             for (j=0; j < 
sizeof(funcs_deps)/
sizeof(funcs_deps[0]); ++j) {
  2912     error(0, 
"SOAP: soap_get_index, broken 'deps' file, can't find key <%s> ", 
octstr_get_cstr(key));
 
static long soap_parse_mo(SMSCConn *conn, Octstr *request, Octstr **response)
 
void error(int err, const char *fmt,...)
 
static ClientData * soap_client_have_response(List *client_list)
 
void info(int err, const char *fmt,...)
 
static void soap_send_loop(SMSCConn *conn)
 
Msg * msg_duplicate(Msg *msg)
 
void bb_smscconn_connected(SMSCConn *conn)
 
static ClientData * soap_create_client_data()
 
static void soap_server_stop(PrivData *privdata)
 
#define SOAP_ERROR_NO_DLR_MESSAGE
 
#define SOAP_ERROR_NO_DATA_CODE
 
void http_header_add(List *headers, char *name, char *contents)
 
int soap_msgdata_deps(int key_func_index, Msg *msg, PrivData *privdata)
 
Octstr * soap_rand_attribute(Msg *msg)
 
Octstr * soap_mobitai_date_attribute(Msg *msg)
 
static Octstr * soap_convert_token(Msg *msg, Octstr *name, PrivData *privdata)
 
void http_caller_signal_shutdown(HTTPCaller *caller)
 
void gwlist_append(List *list, void *item)
 
void bb_smscconn_killed(void)
 
#define SOAP_MAX_MESSAGE_PER_ROUND
 
void octstr_append(Octstr *ostr1, const Octstr *ostr2)
 
#define DLR_IS_SUCCESS(dlr)
 
Octstr * soap_o2o_validity30_attribute(Msg *msg)
 
static void soap_server(void *arg)
 
void gwthread_join(long thread)
 
Octstr * date_create_iso(time_t unixtime)
 
long gwlist_len(List *list)
 
long soap_release_dependences(Octstr *deps, List *lstmaps, Msg *msg, PrivData *privdata)
 
#define SOAP_DEFAULT_MESSAGE
 
void * gwlist_get(List *list, long pos)
 
void(* stop_conn)(SMSCConn *conn)
 
int octstr_url_decode(Octstr *ostr)
 
void octstr_append_char(Octstr *ostr, int ch)
 
time_t soap_read_date(Octstr *dateString)
 
#define cfg_get(grp, varname)
 
void octstr_binary_to_base64(Octstr *ostr)
 
Octstr * soap_bouyg_validity_attribute(Msg *msg)
 
void uuid_generate(uuid_t out)
 
int soap_xmlnode_get_long(xmlNodePtr cur, long *out)
 
Octstr * soap_fetch_xml_data(xmlNodePtr xml, Octstr *path)
 
static void soap_listener(void *arg)
 
int soap_xmlnode_get_int64(xmlNodePtr cur, long long *out)
 
void octstr_convert_to_html_entities(Octstr *input)
 
void octstr_strip_blanks(Octstr *text)
 
Msg * dlr_find(const Octstr *smsc, const Octstr *ts, const Octstr *dst, int typ, int use_dst)
 
void dlr_add(const Octstr *smsc, const Octstr *ts, Msg *msg, int use_dst)
 
#define octstr_get_cstr(ostr)
 
#define octstr_copy(ostr, from, len)
 
void octstr_binary_to_hex(Octstr *ostr, int uppercase)
 
void(* start_conn)(SMSCConn *conn)
 
long octstr_search_char(const Octstr *ostr, int ch, long pos)
 
#define DLR_IS_ENABLED_SMSC(dlr)
 
static struct pid_list * found
 
static struct @117 keywords[]
 
static void soap_stop_cb(SMSCConn *conn)
 
smscconn_killed_t why_killed
 
void http_destroy_headers(List *headers)
 
void gwlist_unlock(List *list)
 
struct client_data ClientData
 
Octstr * soap_mobitai_content_attribute(Msg *msg)
 
void http_start_request(HTTPCaller *caller, int method, Octstr *url, List *headers, Octstr *body, int follow, void *id, Octstr *certkeyfile)
 
static void soap_start_cb(SMSCConn *conn)
 
void http_send_reply(HTTPClient *client, int status, List *headers, Octstr *body)
 
#define SOAP_ERROR_MALFORMED_DATA_MESSAGE
 
Octstr * octstr_imm(const char *cstr)
 
static long long soap_parse_response(PrivData *privdata, Octstr *xmlResponse)
 
int soap_xmlnode_get_octstr(xmlNodePtr cur, Octstr **out)
 
void * gwlist_extract_first(List *list)
 
void gwlist_delete(List *list, long pos, long count)
 
HTTPClient * http_accept_request(int port, Octstr **client_ip, Octstr **url, List **headers, Octstr **body, List **cgivars)
 
void http_close_port(int port)
 
void octstr_delete(Octstr *ostr1, long pos, long len)
 
long bb_smscconn_receive(SMSCConn *conn, Msg *sms)
 
static int soap_shutdown_cb(SMSCConn *conn, int finish_sending)
 
int uuid_is_null(const uuid_t uu)
 
List * http_create_empty_headers(void)
 
#define SOAP_ERROR_DLR_MESSAGE
 
Octstr * soap_o2o_dlrmask_smsc_yn_attribute(Msg *msg)
 
static void soap_send(PrivData *privdata, Octstr *xmlbuffer, Msg *msgid)
 
#define octstr_duplicate(ostr)
 
#define octstr_dump(ostr, level,...)
 
int octstr_case_compare(const Octstr *os1, const Octstr *os2)
 
#define SOAP_ERROR_MO_MESSAGE
 
void warning(int err, const char *fmt,...)
 
List * octstr_split_words(const Octstr *ostr)
 
Octstr * soap_o2o_date_attribute(Msg *msg)
 
Octstr * octstr_format(const char *fmt,...)
 
void octstr_destroy(Octstr *ostr)
 
#define SOAP_ERROR_MALFORMED_DATA_CODE
 
#define gwthread_create(func, arg)
 
#define octstr_create(cstr)
 
void octstr_destroy_item(void *os)
 
void gwthread_sleep(double seconds)
 
#define SMS_PARAM_UNDEFINED
 
static void soap_destroy_client_data(void *data)
 
void soap_destroy_map(void *item)
 
Octstr * soap_bouyg_content_attribute(Msg *msg)
 
volatile sig_atomic_t is_stopped
 
void octstr_base64_to_binary(Octstr *ostr)
 
int http_open_port(int port, int ssl)
 
static void soap_client_init_query(PrivData *privdata, List *headers, Octstr *data, Msg *msg)
 
void gwlist_lock(List *list)
 
#define http_receive_result(caller, status, final_url, headers, body)
 
Octstr * octstr_read_file(const char *filename)
 
int soap_lookup_function(Octstr *funcname)
 
#define SOAP_ERROR_DLR_CODE
 
int date_parse_iso(struct universaltime *ut, Octstr *os)
 
void octstr_strip_crlfs(Octstr *text)
 
long octstr_len(const Octstr *ostr)
 
static Octstr * soap_format_xml(Octstr *xml_file, Msg *msg, PrivData *privdata)
 
int cfg_get_bool(int *n, CfgGroup *grp, Octstr *varname)
 
#define SOAP_DEFAULT_CODE
 
void bb_smscconn_sent(SMSCConn *conn, Msg *sms, Octstr *reply)
 
#define SOAP_ERROR_MO_CODE
 
int(* shutdown)(SMSCConn *conn, int finish_sending)
 
Octstr * soap_mobitai_validity_date_attribute(Msg *msg)
 
void debug(const char *place, int err, const char *fmt,...)
 
int cfg_get_integer(long *n, CfgGroup *grp, Octstr *varname)
 
#define SOAP_DEFAULT_VALIDITY
 
void gwthread_wakeup(long thread)
 
int octstr_hex_to_binary(Octstr *ostr)
 
int octstr_str_compare(const Octstr *ostr, const char *str)
 
#define SOAP_ERROR_NO_DLR_CODE
 
Octstr * soap_o2o_msgdata_attribute(Msg *msg, PrivData *privdata)
 
long octstr_parse_long(long *nump, Octstr *ostr, long pos, int base)
 
HTTPCaller * http_caller_create(void)
 
Octstr * soap_select_function(int index, Msg *msg, PrivData *privdata)
 
#define SOAP_ERROR_NO_DATA_MESSAGE
 
long(* queued)(SMSCConn *conn)
 
Octstr * soap_o2o_dlrmask_success_01_attribute(Msg *msg)
 
Octstr * date_format_http(unsigned long unixtime)
 
int(* send_msg)(SMSCConn *conn, Msg *msg)
 
Octstr * soap_msgdata_attribute(Msg *msg, PrivData *privdata)
 
void bb_smscconn_send_failed(SMSCConn *conn, Msg *sms, int reason, Octstr *reply)
 
void http_caller_destroy(HTTPCaller *caller)
 
static int soap_add_msg_cb(SMSCConn *conn, Msg *sms)
 
int soap_map_xml_data(xmlNodePtr xml, List *maps)
 
long date_convert_universal(struct universaltime *t)
 
int soap_msgtype_deps(int key_func_index, Msg *msg)
 
static int response(List *push_headers, Octstr **username, Octstr **password)
 
static Octstr * soap_write_date(time_t date)
 
int octstr_get_char(const Octstr *ostr, long pos)
 
struct argument_map ArgumentMap
 
static long soap_parse_dlr(SMSCConn *conn, Octstr *request, Octstr **response)
 
List * soap_create_map(Octstr *spec, long count, char *keywords[], char *types[], void *storage[])
 
List * octstr_split(const Octstr *os, const Octstr *sep)
 
static void soap_read_response(SMSCConn *conn)
 
#define SOAP_DEFAULT_SENDER_STRING
 
static XMLRPCDocument * msg
 
int soap_get_index(List *where, Octstr *key, int map_index)
 
int soap_server_start(SMSCConn *conn)
 
static long soap_queued_cb(SMSCConn *conn)
 
int charset_convert(Octstr *string, char *charset_from, char *charset_to)
 
int soap_process_deps(int key_index, int key_func_ind, Msg *msg, PrivData *privdata)
 
int octstr_compare(const Octstr *ostr1, const Octstr *ostr2)
 
int smsc_soap_create(SMSCConn *conn, CfgGroup *cfg)
 
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)