Jump to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Terminating PHP session

Featured Replies

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?

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'.

  • 3 weeks later...
  • Author
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.

Create an account or sign in to comment

Important Information

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

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.