Minor bug fix for dlr in mmsbox
This commit is contained in:
parent
5271c532c8
commit
7430986871
|
@ -773,8 +773,9 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
|
||||||
List *hdrs,
|
List *hdrs,
|
||||||
Octstr **err)
|
Octstr **err)
|
||||||
{
|
{
|
||||||
Octstr *id = NULL;
|
Octstr *id = NULL, *groupid = NULL;
|
||||||
|
int ret = 0;
|
||||||
|
unsigned long throughput = 0;
|
||||||
|
|
||||||
mutex_lock(mmc->mutex); { /* Grab a lock on it. */
|
mutex_lock(mmc->mutex); { /* Grab a lock on it. */
|
||||||
if (mmc->type == SOAP_MMSC)
|
if (mmc->type == SOAP_MMSC)
|
||||||
|
@ -784,22 +785,27 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
|
||||||
else
|
else
|
||||||
error(0, "MMC[%s] of unknown type, can't send!",
|
error(0, "MMC[%s] of unknown type, can't send!",
|
||||||
mmc->id ? octstr_get_cstr(mmc->id) : "");
|
mmc->id ? octstr_get_cstr(mmc->id) : "");
|
||||||
|
|
||||||
if (id && mmc->throughput > 0)
|
throughput = mmc->throughput;
|
||||||
gwthread_sleep(1.0/mmc->throughput);
|
groupid = mmc->group_id ? octstr_duplicate(mmc->group_id) : NULL;
|
||||||
|
|
||||||
} mutex_unlock(mmc->mutex); /* release lock */
|
} mutex_unlock(mmc->mutex); /* release lock */
|
||||||
|
|
||||||
if (id) {
|
if (id) {
|
||||||
if (dlr_url) /* remember the url's for reporting purposes. */
|
if (dlr_url) /* remember the url's for reporting purposes. */
|
||||||
mms_dlr_url_put(id, "delivery-report", mmc->group_id, dlr_url);
|
mms_dlr_url_put(id, "delivery-report", groupid, dlr_url);
|
||||||
if (rr_url)
|
if (rr_url)
|
||||||
mms_dlr_url_put(id, "read-report", mmc->group_id, rr_url);
|
mms_dlr_url_put(id, "read-report", groupid, rr_url);
|
||||||
|
|
||||||
octstr_destroy(id);
|
octstr_destroy(id);
|
||||||
return MMS_SEND_OK;
|
ret = MMS_SEND_OK;
|
||||||
} else
|
} else
|
||||||
return MMS_SEND_ERROR_TRANSIENT; /* don't kill entry, wait a little. */
|
ret = MMS_SEND_ERROR_TRANSIENT; /* don't kill entry, wait a little. */
|
||||||
|
|
||||||
|
octstr_destroy(groupid);
|
||||||
|
if (id && throughput > 0)
|
||||||
|
gwthread_sleep(1.0/throughput);
|
||||||
|
return ret;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Get the MMC that should handler this recipient. */
|
/* Get the MMC that should handler this recipient. */
|
||||||
|
|
Loading…
Reference in New Issue