playSMS Forum

Credit subtracted when sent failed

Any solution with 1.4.3 ?

I’m using kannel and even if a sent was failed the credit always comes subtracted.

When status sent received playsms will deduct credit. When later received another dlr with status failed then playsms will refund the deducted credit.


If I look into the my sent messages I can see a red square near to the failed sms.

Why the credit was deducted? Probably I have a wrong DLR string?

Into kannel.conf I have

group = sms-service
keyword = default
omit-empty = true
max-messages = 0
get-url = “http://mydomain/index.php?app=call&cat=gateway&plugin=kannel&access=geturl&t=%t&q=%q&a=%a&Q=%Q&smsc=%i

Sincerely I don’t understand the get-url parameter. Probably the string is wrong ?

Does this happens for all gateways? Some providers charge full or partial amount even when SMS fails. Is it configurable?

Looking at the code again, I made a mistake, apparently if the billing have been finalized then the refund will not happen.

Here is the flow:

After receiving DLR, playSMS process it, and the DLR will arrive first in simplebilling_hook_setsmsdeliverystatus:

When the DLR status is 1 (sent) or 3 (delivered) then the billing is finalized, meaning no more changes, no refund etc, even when later receiving failed status.

If the received DLR is 2 (failed), then this function called, simplerate_hook_setsmsdeliverystatus:

Only if the billing status have not finalized, meaning not receiving sent/delivered before, then the refund called.

So, yes, by default all failed SMS will be refunded, unless its already finalized (previously set as sent/delivered).

I suppose if you want no-refund at all, then just comment all codes inside simplerate_hook_setsmsdeliverystatus(). Dont forget to restart playSMS daemon after code changes.


Actually, that makes more sense to me. If the provider sets “sent” and then afterwards, sends “failed”, it should probably be charged anyways. If it sends “Failed” immediately, there is probably a problem with the gateway (upstream funds, maintenance, etc) and probably should be refunded.

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.