1
0
Fork 0

Minor bug fix for dlr in mmsbox

This commit is contained in:
bagyenda 2007-05-02 07:30:16 +00:00
parent 5271c532c8
commit 7430986871
1 changed files with 15 additions and 9 deletions

View File

@ -773,8 +773,9 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
List *hdrs,
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. */
if (mmc->type == SOAP_MMSC)
@ -784,22 +785,27 @@ static int mms_sendtommsc(MmscGrp *mmc, Octstr *from, Octstr *to, Octstr *transi
else
error(0, "MMC[%s] of unknown type, can't send!",
mmc->id ? octstr_get_cstr(mmc->id) : "");
if (id && mmc->throughput > 0)
gwthread_sleep(1.0/mmc->throughput);
throughput = mmc->throughput;
groupid = mmc->group_id ? octstr_duplicate(mmc->group_id) : NULL;
} mutex_unlock(mmc->mutex); /* release lock */
if (id) {
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)
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);
return MMS_SEND_OK;
ret = MMS_SEND_OK;
} 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. */