Accounting Callback Response

Accounting Callback Response SearchSearch
Author Message
Siumafua Moala
New member
Username: Smoala

Post Number: 3
Registered: 05-2010
Posted on Thursday, May 27, 2010 - 10:27 am:   

Hello

If I do this

if ( PreAuth == Yes )
do stuff
else
SendSMS(to content provider)
charge recipient
end

1. it will not forward the message to the recipient
2. The message to the content provider will be replicated 1000s times filling up the output queue until i restart the service
3. If I remove the sendsms statement, everything works ok
4. If I put the sendsms in the PreAuth part it would do the same thing.

What I want to do is when a message is blocked, be able to inform the content provider and/or customer the reason(s) the message was blocked.

I couldn't find any documentation on this so I am looking for information on what possible to do here apart from charging the customer, etc.

Thanks for your help in advance.
Des - NowSMS Support
Board Administrator
Username: Desosms

Post Number: 2170
Registered: 08-2008
Posted on Thursday, May 27, 2010 - 11:29 am:   

Hi,

Considering your actions, it is working exactly as I would expect it to.

The SmsSend accounting callback is informing you that a message has been submitted, so that you can charge for it.

If you call sendsms.php, then you are submitting a new message ... and there will be additional accounting callbacks generated for this new message that you are submitting.

This is called an "infinite loop".

I can see no reason that you would want to do this.

If I understand your scenario correctly, in the PreAuth callback, if you wish to block a message, then you return a PreAuth=Deny response.

If you want to inform the customer as to why the message was blocked, you can include RejectMessage=xxxx in the HTTP response, which will generate text that is included in the HTTP response received by the customer.

And you can use SMPPErrorCode=## to generate an error code that is returned to customers that are using SMPP.

If you want to generate a text message to inform them, you could also do that. However, you need to include logic in your notifications to make sure that you do not notify them too many times. Keep in mind that the customer might continue to attempt to submit messages ... possibly thousands of them ... before they react to this notification. So you do not want your error notification to become a problem.

--
Des
NowSMS Support