74 #include "../smsc_http_p.h" 114 if(sms->sms.coding ==
DC_8BIT) {
116 }
else if(sms->sms.coding ==
DC_UCS2) {
140 debug(
"smsc.http.clickatell", 0,
"HTTP[%s]: Sending request <%s>",
206 error(0,
"HTTP[%s]: Message was malformed or error was returned. SMSC response `%s'.",
213 error(0,
"HTTP[%s]: Message was rejected. SMSC response `%s'.",
226 Octstr *apimsgid, *
status, *timestamp, *retmsg, *dest, *charge;
247 debug(
"smsc.http.clickatell", 0,
"HTTP[%s]: Received a request",
250 if (api_id != NULL &&
from != NULL && to != NULL && timestamp != NULL &&
text != NULL &&
charset != NULL && udh != NULL) {
252 debug(
"smsc.http.clickatell", 0,
"HTTP[%s]: Received MO message from %s: <%s>",
255 momsg->sms.sms_type =
mo;
273 }
else if (apimsgid == NULL ||
status == NULL || timestamp == NULL || dest == NULL) {
274 error(0,
"HTTP[%s]: Insufficient args.",
312 if (dlrmsg != NULL) {
326 error(0,
"HTTP[%s]: got DLR but could not find message or was not interested " 327 "in it id<%s> dst<%s>, type<%d>",
337 debug(
"smsc.http.clickatell", 0,
"HTTP[%s]: Sending reply `%s'.",
Dict * dict_create(long size_hint, void(*destroy_value)(void *))
static void clickatell_receive_sms(SMSCConn *conn, HTTPClient *client, List *headers, Octstr *body, List *cgivars)
void error(int err, const char *fmt,...)
void octstr_replace(Octstr *haystack, Octstr *needle, Octstr *repl)
void http_header_add(List *headers, char *name, char *contents)
int(* send_sms)(SMSCConn *conn, Msg *msg)
void dict_put(Dict *dict, Octstr *key, void *value)
long gwlist_len(List *list)
static void client(int port)
struct smsc_http_fn_callbacks smsc_http_clickatell_callback
void uuid_unparse(const uuid_t uu, char *out)
void octstr_append_cstr(Octstr *ostr, const char *cstr)
Msg * dlr_find(const Octstr *smsc, const Octstr *ts, const Octstr *dst, int typ, int use_dst)
static Dict * clickatell_parse_body(Octstr *body)
void dlr_add(const Octstr *smsc, const Octstr *ts, Msg *msg, int use_dst)
#define octstr_get_cstr(ostr)
Octstr * http_cgi_variable(List *list, char *name)
void http_destroy_headers(List *headers)
void http_start_request(HTTPCaller *caller, int method, Octstr *url, List *headers, Octstr *body, int follow, void *id, Octstr *certkeyfile)
void http_send_reply(HTTPClient *client, int status, List *headers, Octstr *body)
Octstr * octstr_imm(const char *cstr)
void * gwlist_extract_first(List *list)
time_t gw_mktime(struct tm *tm)
void * dict_get(Dict *dict, Octstr *key)
long bb_smscconn_receive(SMSCConn *conn, Msg *sms)
List * http_create_empty_headers(void)
#define octstr_duplicate(ostr)
static int clickatell_send_sms(SMSCConn *conn, Msg *sms)
List * octstr_split_words(const Octstr *ostr)
Octstr * octstr_format(const char *fmt,...)
void octstr_destroy(Octstr *ostr)
#define octstr_create(cstr)
#define SMS_PARAM_UNDEFINED
static void clickatell_parse_reply(SMSCConn *conn, Msg *msg, int status, List *headers, Octstr *body)
long octstr_len(const Octstr *ostr)
void dict_destroy(Dict *dict)
void bb_smscconn_sent(SMSCConn *conn, Msg *sms, Octstr *reply)
void debug(const char *place, int err, const char *fmt,...)
void octstr_format_append(Octstr *os, const char *fmt,...)
void bb_smscconn_send_failed(SMSCConn *conn, Msg *sms, int reason, Octstr *reply)
#define DLR_IS_ENABLED_DEVICE(dlr)
static XMLRPCDocument * msg
int octstr_compare(const Octstr *ostr1, const Octstr *ostr2)
void gwlist_destroy(List *list, gwlist_item_destructor_t *destructor)