mm1 improvements
This commit is contained in:
parent
037183a65a
commit
d62e733178
|
@ -1,3 +1,5 @@
|
|||
2009-01-16 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor update to mmsc mm1 notifier: cleanup
|
||||
2009-01-12 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Minor fixes: Output from admin interfaces always valid XML
|
||||
* Minor fixes: admin module
|
||||
|
|
|
@ -19,11 +19,11 @@
|
|||
#define WAPPUSH_PORT 2948
|
||||
|
||||
|
||||
static MmsEnvelope *update_env_success(MmsEnvelope *e, MmsEnvelopeTo *xto)
|
||||
static MmsEnvelope *update_env(MmsEnvelope *e, MmsEnvelopeTo *xto, int success)
|
||||
{
|
||||
time_t tnow = time(NULL);
|
||||
|
||||
if (xto && !(e->msgtype == MMS_MSGTYPE_SEND_REQ ||
|
||||
if (success && xto && !(e->msgtype == MMS_MSGTYPE_SEND_REQ ||
|
||||
e->msgtype == MMS_MSGTYPE_RETRIEVE_CONF))
|
||||
xto->process = 0; /* No more processing. */
|
||||
else {
|
||||
|
@ -46,6 +46,7 @@ static MmsEnvelope *update_env_success(MmsEnvelope *e, MmsEnvelopeTo *xto)
|
|||
return e;
|
||||
}
|
||||
|
||||
#if 0
|
||||
static MmsEnvelope *update_env_failed(MmsEnvelope *e)
|
||||
{
|
||||
|
||||
|
@ -58,6 +59,7 @@ static MmsEnvelope *update_env_failed(MmsEnvelope *e)
|
|||
e = NULL;
|
||||
return e;
|
||||
}
|
||||
#endif
|
||||
|
||||
static void do_mm1_push(Octstr *rcpt_to, int isphonenum, MmsEnvelope *e, MmsMsg *msg)
|
||||
{
|
||||
|
@ -110,12 +112,12 @@ static void do_mm1_push(Octstr *rcpt_to, int isphonenum, MmsEnvelope *e, MmsMsg
|
|||
mms_error(0, "MM1", NULL, " Push[%s] from %s, to %s, failed, HTTP code => %d", e->xqfname,
|
||||
octstr_get_cstr(e->from), octstr_get_cstr(to), status);
|
||||
|
||||
e = update_env_failed(e);
|
||||
e = update_env(e,xto,0);
|
||||
} else { /* Successful push. */
|
||||
|
||||
mms_log2("Notify", octstr_imm("system"), to,
|
||||
-1, e ? e->msgId : NULL, NULL, NULL, "MM1", NULL,NULL);
|
||||
e = update_env_success(e, xto);
|
||||
e = update_env(e, xto, 1);
|
||||
}
|
||||
|
||||
http_destroy_headers(pheaders);
|
||||
|
@ -137,9 +139,9 @@ static void do_mm1_push(Octstr *rcpt_to, int isphonenum, MmsEnvelope *e, MmsMsg
|
|||
mms_log2("Notify", octstr_imm("system"), to,
|
||||
-1, e ? e->msgId : NULL,
|
||||
NULL, NULL, "MM1", NULL,NULL);
|
||||
e = update_env_success(e, xto);
|
||||
e = update_env(e, xto, 1);
|
||||
} else {
|
||||
e = update_env_failed(e);
|
||||
e = update_env(e, NULL, 0);
|
||||
mms_error(0, "MM1", NULL, "push to %s:%d failed: %s", octstr_get_cstr(to), WAPPUSH_PORT, strerror(errno));
|
||||
}
|
||||
octstr_destroy(addr);
|
||||
|
|
Loading…
Reference in New Issue