Termination Rate > Origination Rate allows calls

There might be a bug in the dialplan. ASTPP is not supposed to process any call where the termination rate (cost) is higher than the origination rate as you would be losing money that way. However, in my tests, it completely ignores the high termination cost. Is there a special setting that I missed? Has anyone else noticed that?

In the code I see two lua scripts used for the same rate check. Both /scripts/astpp.dialplan.lua and
astpp.callingcard.functions.lua check if the termination rate is > origination rate. Which one do we use to block the call if the rate is too high? Why would it not work for me? Are there any special settings that I missed?

You should actually test it. You can look a what FreeSwitch is doing live. You can copy that output or look in the log.

OK. It works. It’s just using weird logic for the presentation because Astpp first announces the “cost of the call” and the “minutes available” and then, after the end user thinks the call will be processed, it suddenly rejects the calls with the message “No termination rates found!!”

I think I’ll switch the order around in astpp.callingcard.functions.lua to reject the call straight out instead of announcing that we will process it first and then reject it.