playSMS Forum

{PSMS_USER} No longer parses when forwarding inbound SMS

Hi All,

Since updating from version 1.4.2 to 1.4.3 forwarding no longer works at it used to.

Under Settings > Route Incoming SMS > Post Rules I have the following settings:

Route all sandbox SMS with matched sender ID = yes
Route all sandbox SMS to users =
Forward All sandbox to SMS to a URL = /pushNotice/playsms2url/?ID={SANDBOX_DATETIME}&Timestamp={SANDBOX_DATETIME}&OriginatingAddress={SANDBOX_SENDER}&Message={SANDBOX_MESSAGE}&Recipients={SANDBOX_RECEIVER}&Network={SANDBOX_SMSC}&smsc={SANDBOX_SMSC}&psms_user={PSMS_USER}

In Settings > Route Incoming SMS > Settings:

Leave a copy in sandbox SMS page = yes
Match with all approved sender ID = yes

Before the update, {PSMS_USER} would parse to the user receiving the text. After the update, playsms attempts to forward the message but the final keypair remains “&psms_user={PSMS_USER}”. The intent of forwarding this URL is to forward texts to different locations dependant on the user.

Was this intended? Has there been an update to the syntax of the PSMS_USER? or a change in variable name? I’m unsure if this is a misconfiguration or if this variable has suddenly gone missing from this portion of the system.

I hope this is all the information required.

Thanks,

Andrew

I’ve located and checked the relevant portion of php code. In version 1.4.2 the sandbox forward URL includes a line for PSMS_USER:

$url = str_replace(’{PSMS_USER}’, urlencode($username), $url);

1.4.3 does not include this portion of code at all. I can only assume it has been consciously removed, although I’m not sure if this was for security reasons. Whatever the reason I have managed to add {PSMS_USER} back into the list of variables by editing /plugin/feature/incoming/fn.php and updating the forward to url section to be as follows:

if ($url = trim($post_rules[‘forward_to_url’])) {
$payload = array(
‘datetime’ => core_get_datetime(),
‘sms_datetime’ => $sms_datetime,
‘sms_sender’ => $sms_sender,
‘message’ => $message,
‘sms_receiver’ => $sms_receiver,
‘smsc’ => $smsc,
);
$json = json_encode($payload);
$psms_user = user_uid2username($uid); //custom value
$url = str_replace(’{SANDBOX_PAYLOAD}’, urlencode($json), $url);
$url = str_replace(’{SANDBOX_DATETIME}’, urlencode($sms_datetime), $url);
$url = str_replace(’{SANDBOX_SENDER}’, urlencode($sms_sender), $url);
$url = str_replace(’{SANDBOX_MESSAGE}’, urlencode($message), $url);
$url = str_replace(’{SANDBOX_RECEIVER}’, urlencode($sms_receiver), $url);
$url = str_replace(’{SANDBOX_SMSC}’, urlencode($smsc), $url);
$url = str_replace(’{PSMS_USER}’, urlencode($psms_user), $url); //custom value
_log(“sandbox forward to URL start url:[” . $url . “]”, 3, ‘incoming recvsms_intercept_after’);
$response = @file_get_contents($url);
_log(“sandbox forward to URL end response:[” . $response . “]”, 3, ‘incoming recvsms_intercept_after’);
}

Hi, @Andrew_Brough and @anton Are you able to received send sms from your mobile to playsms inbox? Or how i can configure to get sms in playsms inbox?

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.