You are here

function sms_muse_get_session_id in SMS Framework 5

Get the session ID

File

modules/sms_muse/sms_muse.module, line 191

Code

function sms_muse_get_session_id() {
  if (variable_get('sms_muse_session_id_timestamp', 0) < strtotime('-10 mins')) {
    if ($result = sms_muse_command()) {
      if ($result['status'] == 'OK') {
        variable_set('sms_muse_session_id', $result['data']);
        variable_set('sms_muse_session_id_timestamp', time());
        watchdog('sms', t('Muse session ID refreshed: ' . $result['data']));
      }
    }
  }
  return variable_get('sms_muse_session_id', 0);
}