Fax-process.pl not executing under 1.6.2.2

I keep getting a failure in the processing of fax-process.pl in the log. The log says:

WARNING[7926] app_system.c: Unable to execute

I’m sure it is something simple keeping this from working. Any suggestions? I’m running 2.7 beta 1.3 but I don’t think this has anything to do with the command freepbx is generating.

rob

I meant to put in here that I can run the command find as the asterisk user.

I did some more research into this issue and it appears to me that the ast_safe_system function in app_system.c must be returning a -1. I’m going to post this issue over at the digium forums since it doesn’t appear to have anything to do with FreePBX. I’ve seen other bugs reported in 1.6.2 related to similar issues. Just an FYI in case anyone else runs into the issue.

Symptoms:

  • fax-process.pl returns “WARNING[7926] app_system.c: Unable to execute” in the asterisk log
  • email of faxes does not occur
  • command runs fine at the asterisk command prompt using ! in front of it meaning that the forking appears to work correctly.

do all System() commands in Asterisk 1.6.2 fail, or is it just this one?

I inserted a basic system(ls -l /tmp) command and it ran fine. The command was NOT quoted in the dialplan.

[Feb 16 10:56:24] VERBOSE[26287] pbx.c: – Executing [mynum@from-trunk:2] ^[[1;36mSystem^[[0m("^[[1;35mSIP/DefaultOut-00000048^[[0m", “^[[1;35mls -l /tmp^[[0m”) in new stack

When I did quote the command it did not run which is what I think the issue is since the command using fax-process.pl is quoted with single quotes. It is probably another 1.6.2 syntax issue? Why would that change?

I’m going to test a fax using the unquoted system command to see if that works. I’ll post back on the results. If it does work I’ll open a ticket for it.

So when I removed the quotes the command worked properly. I did open a ticket but I’m not sure that removing the quotes is correct. I think this tracks back to a bug in ast_safe_system where the line below was added to app_system.c. It encodes the passed string so apparently the quotes are not required?

    ast_str_get_encoded_str(&buf, 0, (char *) data);

Skip what I asked (post erased) checking with devs, per my comment in the ticket, I think this may be a bug on our part and in any event works fine with no quotes in 1.4.x so … (don’t know about 1.2)

I was just creating the issue in asterisk tracker but will leave it alone per your request.

ip-rob,

give that it works on 1.4 but not on 1.6, it may be worth pursuing with them anyhow in case it really is a bug. There may be dialplan out there that worked and is now broken. They may claim it was always a bug to do that or maybe not. For our case, I’ve chosen to remove the quotes and I think it is fine but as a general Asterisk issue, from what you have uncovered, it is worth at least bringing up with them.

ID 0016842. Not sure if anything will happen.

The bug has been acknowledged in asterisk so hopefully this will be fixed. In the meantime not quoting works.

kartaka,

it would still be very helpful for you to provide us with more lines of your warning above (which should still be available in the log file).

The new module was a ‘workaround’ to the issue suspected to be an Asterisk issue but true resolution has not been determined.

Your message above is a real issue and we would like to know where it came from so we can determine what is providing bad syntax which may also point to root cause of the other issue.

I’m glad that your fax is working but please go dig up that information requested and provide it to us so we can see what that was about and determine if it was relate or another un-reported bug.

Thanks.

I have the same issue. I am running Asterisk 1.6.2.3 and went ahead and got Fax For Asterisk (single user free license) from Digium. The system will receive a fax just fine and store it in the folder as a TIF file but the file never gets emailed out of that directory.

the quotes around the system() call were removed. Is it still failing? If so, has there been any attempt at manipulating the format of the System() call to see if there is something we could produce that would work around the issue?

to the person who solved the issue:
i have the same problem with asterisk 1.6.2.4
could you tell me which file i should edit and at which point to make it work?
thanks

I know the quotes were an issue but there is clearly some other problem. I think it is something else in 1.6.2.2 (and apparently 1.6.2.3). I was going to try updating to 1.6.2.4 and see if that fixed it.

I can run the command at the asterisk prompt (prefixed by !) and the thing runs fine. The system call code in * seems to be problematic and I suspect it is in the fork process. For example, I can put a system call such as system(ls -l /tmp > /usr/src/temp.txt) and nothing happens with that either. There is no error in the asterisk log but no execution is happening at all.

I’ll update to 1.6.2.4 and test…if the problem persists then I’ll open another issue at digium.

ID 0016905 since the system() function appears to not work at all in 1.6.2.4.

Rob

I closed the ticket at asterisk because I was able to get the command to execute in asterisk. What I did was take the command that failed from the full log, created a new step in a dialplan to execute the command, and it did it fine.

This meant there must be something else wrong with the dialplan. I went through the generated line again and I believe there is an extra ) at the end of the line.

I’ll open a ticket. I should have caught that when I look at this earlier.

ip-rob could you please tell which files and how exactly to modify to make it work?
thanks a lot

kartaka

I haven’t found a way to make the generated dialplan work. I have been able to successfully get fax-process.pl to work by removing the ExecIf statement and calling the script as system() in a test setup only.