Callback issue | Search |
NowSMS Support Forums ⬆ NowSMS Support - SMS Issues ⬆ Archive through April 08, 2009 ⬆ |
◄ ► |
Author | Message | |||
juri New member Username: Vanya11 Post Number: 4 Registered: 10-2006 |
hello according to technical bulletins, it is possible not to allow message to be sent via accoubting callbacks. I have configured SMSAccountingURL=http://localhost/smsaccount.php under [SMSGW]. When message is stored in Q folder i get the following query string to my script: Type=SMSOut&To=111XXXXXXX&MessageID=48B6E2F2.req&SubmitIP=172.1.41.151&Text=call back&SMSCMsgId=ad4943ca&SMSCName=SMPP%20-%20XXX.1.1.1:5016&Status=OK and message is sent. So, what i need is to stop message with MessageID=48B6E2F2.req being sent to SMSC. Since for example, user subscription is over. Could you please provide me example of callback script, should be executed to prevent message to be sent ever to operator SMSC. Any idea? thanks | |||
juri New member Username: Vanya11 Post Number: 5 Registered: 10-2006 |
...and here is content of smsaccoun.php: if($_GET['MessageID'] == "48B6E2F2.req") { header("HTTP/1.1 500 error"); header("PreAuth=Deny"); header("SMSOut=Deny"); echo "PreAuth=Deny"; error_log("not allowed"); exit; and message is sent anyway!!! | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 372 Registered: 08-2008 |
Hi Juri, The message can only be blocked in the "PreAuth" callback. The "PreAuth" callback includes the parameter "PreAuth=Yes". When an SMS message is submitted, there will be at least 3 different callbacks that occur. The first callback is the "PreAuth". At this stage, a MessageID has not yet been assigned. If you return "PreAuth=Deny" somewhere in the response for this callback, then NowSMS will not queue the message. The second callback is the "SmsSend" (without the "PreAuth=Yes"). This callback informs you that NowSMS has accepted the message, and tells you the MessageID that was assigned. Any response to this callback is ignored. If the message was addressed to multiple recipients or requires multiple parts, the callback is repeated for each recipient and part (the PreAuth callback only occurs once and has a "MsgCount=" parameter that specifies how many messages would be generated if the message is accepted). The third callback is "SmsOut". This callback informs you that NowSMS has routed the message to the upstream SMSC. Any response to this callback is ignored. I hope that clarifies the behaviour you are seeing. -- Des NowSMS Support | |||
juri New member Username: Vanya11 Post Number: 6 Registered: 10-2006 |
hello Des, thanks for answer. Strange, when i send it over php, using your sample, how to send messages, i receive only last callback. i tried now from web interface, and really, saw 3 callbacks. But my problem is following, i need to deny sending of delayed message. And as i understand, that is not possible. I mean, if i know MessageID then it means that callback at this stage will ignore any limits. Is that right? So, means NO any possibility to deny sendng at those stages!? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 375 Registered: 08-2008 |
Hi Juri, There's no way to stop a delayed message via a callback. The callback only occurs at submission time. As for the missing callbacks in your test ... do you have "Require Authentication for Web Interface" checked in the configuration settings ("Web" page of the dialog)? Some accounting callbacks are skipped if user authentication is not enabled. -- Des NowSMS Support | |||
juri New member Username: Vanya11 Post Number: 7 Registered: 10-2006 |
Des i aded new user and enabled authentication. And seems anyway i get one callback! Anyway thanks for your support. | |||
juri New member Username: Vanya11 Post Number: 8 Registered: 10-2006 |
Des another small question. Is that possible to change ROUTE for sms, after SmsSend or SmsOut callback issue? | |||
Des - NowSMS Support Board Administrator Username: Desosms Post Number: 386 Registered: 08-2008 |
Hi Juri, We did recently add support for the "SmsSend" callback to override the SMS routing. This exists in NowSMS 2008.11.05 and later ... for the latest version download http://www.nowsms.com/download/nowsms2009.zip. NowSMS will now check the response from the "SMSSend" accounting callback. If this response includes the text "SMSCRoute=xxxxx", then NowSMS will apply this route for the message. The "xxxxx" value can either be the name of a particular SMSC connection (e.g., "SMPP - host:port"), or it can be the value of "RouteName=" attribute. (For more information on the "RouteName=" attribute, see http://blog.nowsms.com/2008/07/routing-sms-messages-to-specifc-smsc.html). -- Des NowSMS Support |