Failed fax2mail, what is the source of FAXOPT(remotestationid)?

when I receive a fax, an email does not get sent. from looking at the log, I find this line:

[2025-01-06 14:41:25] VERBOSE[2393724][C-0000177f] pbx.c: Executing [h@ext-fax:5] System("PJSIP/CELLCOM-VRF-1-0099101a", "/var/lib/asterisk/bin/fax2mail.php --remotestationid "" --user "1" --dest "0322553499" --callerid "IjA0NjkyMDgzMSIgPDA0NjkyMDgzMT4=" --file /var/spool/asterisk/fax/1736167168.23858.tif --delete "true"") in new stack

Note that --remotestationid “” - meaning it’s empty.

Trying to run the shown command by myself, I get:

root@FreePBX17:/etc# /var/lib/asterisk/bin/fax2mail.php --remotestationid "" --user "1" --dest "0322553499" --callerid "IjA0NjkyMDgzMSIgPDA0NjkyMDgzMT4=" --file /var/spool/asterisk/fax/1736167168.23858.tif --delete "true"
Whoops\Exception\ErrorException: Uninitialized string offset 0 in file /var/www/html/admin/modules/fax/bin/fax2mail.php on line 216
Stack trace:
  1. Whoops\Exception\ErrorException->() /var/www/html/admin/modules/fax/bin/fax2mail.php:216
  2. Whoops\Run->handleError() /var/www/html/admin/modules/fax/bin/fax2mail.php:216
  3. get_opt() /var/www/html/admin/modules/fax/bin/fax2mail.php:28

However, if I add anything in the empty quotes, i.e --remotestationid “1”, the command runs just fine, and the mail gets sent.

My conclusion, is that FAXOPT(remotestationid) is somehow empty and should not be. So my question is, what is the source of this variable? how can I fill it or what configuration changes should I make for this to start working?

I guess I should take it as ‘nobody knows’ then?

The remote station ID is acquired as part of the actual fax negotiation. It’s a value from the remote side, not something you configure or touch. I’m not that familiar with fax at that level, but wouldn’t surprise me if it could indeed be empty in which case an issue should be filed to remove the assumption that the value is non-empty.

1 Like

Thanks for the reply.

The same problem happened in different cases from different sources, which makes me think there is a bug somewhere and the remotestationid parameter’s value gets lost.

Your reply made me look in the freepbx issue tracker, and there I found an issue describing the same problem. So it’s not just me at least.

The error indicates that $nextparm[0] is being accessed, but $nextparm is not a string or is empty, causing the Uninitialized string offset issue.
long story short is is a bug and $nextparam handling needs to be cleaned up. File a bug report at GitHub - FreePBX/issue-tracker: The unified FreePBX issue tracker.