Jump to content
Sign in to follow this  
OlgerDiekstra

Terminating PHP session

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?

Share this post


Link to post
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'.

Share this post


Link to post
Share on other sites
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.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

Sign in to follow this  

×
×
  • Create New...

Important Information

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