mmsbox mm1 bug fix from piotr
This commit is contained in:
parent
eba4e9e09d
commit
67d8049f1b
|
@ -1,3 +1,5 @@
|
|||
2011-01-04 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* mm1 mmsbox plugin fix Thanks to Piotr Isajew (pki at ex.com.pl)
|
||||
2011-01-03 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
* Don't forget to call dlr URL even for failed transmit (with no retry). Thanks to Piotr Isajew (pki at ex.com.pl)
|
||||
2010-12-09 P. A. Bagyenda <bagyenda@dsmagic.com>
|
||||
|
|
|
@ -344,11 +344,15 @@ static Octstr *send_msg(void *data, Octstr *from, Octstr *to,
|
|||
mms_info(0, "mmsbox-mm1", NULL, "sent message, type=%s, result=%s",
|
||||
mms_message_type_to_cstr(mms_messagetype(m)), r->error ? octstr_get_cstr(r->error) : "(none)");
|
||||
/* destroy the structure. */
|
||||
if(r->error && (octstr_compare(r->error, octstr_imm("Error-service-denied")) == 0 ||
|
||||
octstr_compare(r->error, octstr_imm("Error-permanent-failure")) == 0))
|
||||
*retry = 0;
|
||||
else
|
||||
*retry = 1;
|
||||
|
||||
pthread_cond_destroy(&r->cond);
|
||||
pthread_mutex_destroy(&r->mutex);
|
||||
gw_free(r);
|
||||
*retry = 1; /* always retry ?? */
|
||||
|
||||
return id;
|
||||
}
|
||||
|
@ -491,9 +495,17 @@ static void handle_mm1(MM1Settings *mm1)
|
|||
mms_warning(0, "mmsbox-mm1", NULL,"No send-conf returned by operator");
|
||||
|
||||
if (m == NULL ||
|
||||
(r->result = mms_get_header_value(m, octstr_imm("Message-ID"))) == NULL) {
|
||||
(r->result = mms_get_header_value(m, octstr_imm("Message-ID"))) == NULL ||
|
||||
octstr_compare(mms_get_header_value(m, octstr_imm("X-Mms-Response-Status")),
|
||||
octstr_imm("Ok")) != 0
|
||||
) {
|
||||
Octstr *err = m ? mms_get_header_value(m, octstr_imm("X-Mms-Response-Text")) : NULL;
|
||||
Octstr *status = m ? mms_get_header_value(m, octstr_imm("X-Mms-Response-Status")) : NULL;
|
||||
if(status && (octstr_compare(status, octstr_imm("Error-service-denied")) == 0 ||
|
||||
octstr_compare(status, octstr_imm("Error-permanent-failure")) == 0)) {
|
||||
r->error = octstr_duplicate(status);
|
||||
}
|
||||
r->result = NULL; /* indicate failure to bearerbox */
|
||||
mms_error(0, "mmsbox-mm1", NULL, "Sending failed: %s, %s!",
|
||||
err ? octstr_get_cstr(err) : "(none)",
|
||||
status ? octstr_get_cstr(status) : "(none)");
|
||||
|
|
Loading…
Reference in New Issue