Jump to content
Server Maintenance This Week. ×

Terminating PHP session


This topic is 1670 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I've got a FMSv16 (can't upgrade yet due to Windows 2k8R2), and am using CWP to send data to the server using php.

The server sends out SMS's via an online SMS Gateway and gets results back via php. This happens sometimes in a burst where hundreds of SMS's are send out, and the incoming results can overwhelm the server (in terms of connections, not CPU or memory resources). I've set the allowed CWP sessions to 1000, but I'd like to be able to terminate a session after the script has run.

I've tried calling a FM script with 'close database' and 'exit application' at the end of the php script, and unsetting the $fm variable in the php script, but it doesn't terminate the session to FM. The sessions automatically terminate after 3 mins or so, but that is sometimes too long.

Does anyone know how to end a session from either a FM script or within the php script?

Link to comment
Share on other sites

I assume from your description that the CWP session stays open longer than you want to?  Perhaps that is due to the script that you're calling from the PHP call?  Why not just let it create a record and not call a FM script?  Build a queue and let a FMS script schedule do the logic of what your PHP-called script does.  That should allow the CWP sessions to be much shorter in duration and 'weight'.

Link to comment
Share on other sites

  • 3 weeks later...
On 9/14/2019 at 3:38 AM, Wim Decorte said:

I assume from your description that the CWP session stays open longer than you want to?  Perhaps that is due to the script that you're calling from the PHP call?  Why not just let it create a record and not call a FM script?  Build a queue and let a FMS script schedule do the logic of what your PHP-called script does.  That should allow the CWP sessions to be much shorter in duration and 'weight'.

Thanks Wim. I've been trying to find time to modify my setup and see if your suggestion would work better, but for the moment I'm going to have to keep it the way it is, just don't have enough time.

I'll come back to this though, or not if I move to v18's data API before then.

The script that gets invoked when an incoming SMS is delivered to FM, does a few things depending on the SMS. Customers can request a balance update by SMSing "Balance" to a designated mobile number.  If the sending mobile number is found in our DB, it sends the remaining balance back.

Customers can also unsubscribe when they've been send a marketing SMS, as well as a few other actions. I'm thinking your suggestion may well work better.

Link to comment
Share on other sites

This topic is 1670 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.