Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[Callweaver-users] System() call sporadically failing after RxFAX


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> CallWeaver Users
View previous topic :: View next topic  
Author Message
isis at isisdesign.com
Guest





PostPosted: Fri Dec 12, 2008 2:55 pm    Post subject: [Callweaver-users] System() call sporadically failing after Reply with quote

Hi CallWeaver Users!

Running CallWeaver 1.2.0.1 on PowerMac with 10.4.11.

So i have incoming T.38 working and am using RxFAX() to receive faxes
and email the converted tif as pdf by doing a System() call to run a
script after seeing if RxFAX() received any pages.

But a strange thing has started to occur. Sometimes the script
"rxfaxdeliver" is not successfully called by CallWeaver but apparently
without rhyme nor reason as to when it works and when it doesn't.

Below are two console grabs (i've been leaving console open to watch
when faxes come in). One is where CW successfully called rxfaxdeliver
script and one where it didn't.

Good:

-- Executing [fax@incoming-did:13] System("SIP/516567524-edf9",
"FAXFILE="pbx-isis-1229103591.48.tif" FAXPATH="/usr/local/callweaver/
var/spool/callweaver/rxfax/" REMOTESTATIONID="6179450496 "
FAXPAGES="1" FAXRESOLUTION="7700" FAXSENDER="+13238609370 "
MYFAX="unknown1" /usr/local/bin/rxfaxdeliver")
-- Executing [fax@incoming-did:14] Verbose("SIP/516567524-edf9",
"Return from System call SYSTEMSTATUS="SUCCESS"")
Return from System call SYSTEMSTATUS=SUCCESS


Bad:

-- Executing [fax@incoming-did:13] System("SIP/516567524-98f7",
"FAXFILE="pbx-isis-1229100346.34.tif" FAXPATH="/usr/local/callweaver/
var/spool/callweaver/rxfax/" REMOTESTATIONID="Via Fax "
FAXPAGES="1" FAXRESOLUTION="3850" FAXSENDER="+17325423012 "
MYFAX="unknown1" /usr/local/bin/rxfaxdeliver")
-- Executing [fax@incoming-did:14] Verbose("SIP/516567524-98f7",
"Return from System call SYSTEMSTATUS="APPERROR"")
Return from System call SYSTEMSTATUS=APPERROR


I have tried running the script from the command line as if it was
called from CW and it ran fine:

FAXFILE="pbx-isis-1229100346.35.tif" FAXPATH="/usr/local/callweaver/
var/spool/callweaver/rxfax/" REMOTESTATIONID="Via Fax "
FAXPAGES="1" FAXRESOLUTION="3850" FAXSENDER="+17325423012 "
MYFAX="unknown1" /usr/local/bin/rxfaxdeliver

I checked the syslog and i see this message for an earlier failed
message (but not for the "Bad" one above:

callweaver[17190]: WARNING[17190]: app_system.c:101 in
system_exec_helper: Unable to execute 'FAXFILE=pbx-
isis-1229089538.21.tif FAXPATH=/usr/local/callweaver/var/spool/
callweaver/rxfax/ REMOTESTATIONID=Corp Travel dept FAXPAGES=1
FAXRESOLUTION=3850 FAXSENDER=+0000000000 MYFAX=unknown1 /usr/local/
bin/rxfaxdeliver'\n

Is there any way to get more info as to what is the actual error when
System() returns SYSTEMSTATUS=APPERROR?

Anyone have any clues as to what could be causing this intermittent
failure of the System() feature?

The only thing i see is that the one that failed from CW but ran ok
from command line has a REMOTESTAIONID that is multiword with
whitespace. Could CW be messing up not leaving quotes in the string
when passed to system()?

Peace,
Dan




_______________________________________________
Callweaver-users mailing list
Callweaver-users@callweaver.org
http://lists.callweaver.org/mailman/listinfo/callweaver-users
Back to top
william.suffill at gma...
Guest





PostPosted: Sat Dec 13, 2008 12:45 pm    Post subject: [Callweaver-users] System() call sporadically failing after Reply with quote

You would need to quote it correctly when using the system command to
make sure it isn't handled different by the shell since arguments are
separated by spaces unless quoted. That's all that jumped out at me
after looking at it briefly perhaps someone else will have something
more detailed to add.

-- William
_______________________________________________
Callweaver-users mailing list
Callweaver-users@callweaver.org
http://lists.callweaver.org/mailman/listinfo/callweaver-users
Back to top
isis at isisdesign.com
Guest





PostPosted: Sat Dec 13, 2008 2:03 pm    Post subject: [Callweaver-users] System() call sporadically failing after Reply with quote

On Dec 13, 2008, at 12:43 PM, William Suffill wrote:

Quote:
You would need to quote it correctly when using the system command to
make sure it isn't handled different by the shell since arguments are
separated by spaces unless quoted. That's all that jumped out at me
after looking at it briefly perhaps someone else will have something
more detailed to add.

-- William

Thanks William. I agree about the spaces in an environment var that is
being set before the call to the script could screw up the shell's
parsing the command line. In particular the REMOTESTATIONID env var
being set can have an arbitrary string with spaces as returned from
RxFAX().

I forgot to put in the System() call from extensions.conf. Here it is
(most of the env vars have the same name as the CHANNEL vars - got
this from someone else):

exten => fax,n,System(FAXFILE="${FAXFILE}.tif" FAXPATH="${FAXPATH}"
REMOTESTATIONID="${REMOTESTATIONID} " FAXPAGES="${OFAXPAGES}"
FAXRESOLUTION="${FAXRESOLUTION}" FAXSENDER="${CID} " MYFAX="$
{MYFAX}1" /usr/local/bin/rxfaxdeliver)

Perhaps i should replace the double quotes with single? Will that keep
CW from doing var substitution on the command line before calling
System()? The only reason to switch to single from double quotes is if
CW is throwing away the double quotes and wouldn't with single. I
would guess that CW is not throwing away the double quotes as the
console output seems to indicate as seen from my previous post:

-- Executing [fax@incoming-did:13] System("SIP/516567524-edf9",
"FAXFILE="pbx-isis-1229103591.48.tif" FAXPATH="/usr/local/callweaver/
var/spool/callweaver/rxfax/" REMOTESTATIONID="6179450496 "
FAXPAGES="1" FAXRESOLUTION="7700" FAXSENDER="+13238609370"
MYFAX="unknown1" /usr/local/bin/rxfaxdeliver")

Peace,
Dan


_______________________________________________
Callweaver-users mailing list
Callweaver-users@callweaver.org
http://lists.callweaver.org/mailman/listinfo/callweaver-users
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> CallWeaver Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services