Ticket #4099 (closed Bugs: fixed)

Opened 3 years ago

Last modified 3 years ago

Fax is not being sent by email

Reported by: hmronline Assigned to: p_lindheimer
Priority: minor Milestone: 2.8
Component: Core Version: 2.7-branch
Keywords: fax email Cc:
Confirmation: Unreviewed Distro:
Backend Engine: Asterisk 1.6 Distro Ver:
Backend Ver: 1.6.2.2 SVN Revision (if applicable):

Description

Inside [ext-fax] context, at hangup extension, priority two, we are getting a false-positive which makes GotoIf jump to "end" label thus avoiding sending FAX through email:

exten => h,1,GotoIf($["${FAXSTATUS:0:6}" = "FAILED"]?failed)
exten => h,n(process),GotoIf($["${FAX_RX_EMAIL}" = ""]?end)

By removing the surrounding quotes around FAX_RX_EMAIL it started to work:

exten => h,1,GotoIf($["${FAXSTATUS:0:6}" = "FAILED"]?failed)
exten => h,n(process),GotoIf($[${FAX_RX_EMAIL} = ""]?end)

This might be caused by the fact the destination email is set like this: Set(FAX_RX_EMAIL="asterisk@localhost") So no additional quotes should be necessary.

Thanks, Hernán.-

Change History

03/08/10 11:20:55 changed by p_lindheimer

nope wouldn't be that, would need to see a trace and it may be a 1.6.x issue in the way somethings have been changing. Will probably just change to:

${LEN(${FAX_RX_EMAIL})} = 0

03/08/10 11:26:15 changed by p_lindheimer

ahh - looking closer, yeah should not be quotes around teh setting of the destination would be the issue, I wonder if it was having issues with @ on 1.4 and that is why it was quoted, will have to look. In any event, the following is a better test but will have a look at the Set() command initially.

Index: functions.inc.php
===================================================================
--- functions.inc.php	(revision 9092)
+++ functions.inc.php	(working copy)
@@ -265,7 +265,7 @@
     }
     $exten = 'h';
 		$ext->add($context, $exten, '', new ext_gotoif('$["${FAXSTATUS:0:6}" = "FAILED"]', 'failed'));
-    $ext->add($context, $exten, 'process', new ext_gotoif('$["${FAX_RX_EMAIL}" = ""]','end'));
+    $ext->add($context, $exten, 'process', new ext_gotoif('$[${LEN(${FAX_RX_EMAIL})} = 0]','end'));
     $ext->add($context, $exten, '', new ext_system('${ASTVARLIBDIR}/bin/fax-process.pl --to ${FAX_RX_EMAIL} --from "'.$sender_address['0'].'" --dest "${FROM_DID}" --subject "New fax from ${URIENCODE(${CALLERID(name)})} ${URIENCODE(<${CALLERID(number)}>)}" --attachment fax_${URIENCODE(${CALLERID(number)})}.pdf --type application/pdf --file ${ASTSPOOLDIR}/fax/${UNIQUEID}.tif'));
 
 	  $ext->add($context, $exten, 'end', new ext_macro('hangupcall'));

03/08/10 11:30:21 changed by p_lindheimer

  • status changed from new to closed.
  • resolution set to fixed.

(In [9097]) fixes #4099 don't put double quotes around Set() assignments. Please test patch and respond if possible before we publish

03/08/10 15:47:51 changed by hmronline

I've tested it and can confirm it does work properly after applying that change.

Thanks! Hernán.-

03/11/10 21:10:38 changed by p_lindheimer

(In [9137]) Merged revisions 9075-9111,9113-9122,9124-9136 via svnmerge from http://svn.freepbx.org/modules/branches/2.7

........

r9079 | p_lindheimer | 2010-03-04 14:17:04 -0800 (Thu, 04 Mar 2010) | 1 line

fixes #4102, fixes #4104, fixes #4105 global variables not exposed and label typo

........

r9080 | p_lindheimer | 2010-03-04 14:17:36 -0800 (Thu, 04 Mar 2010) | 1 line

Module Publish Script: callforward 2.7.0.2

........

r9083 | p_lindheimer | 2010-03-05 15:29:27 -0800 (Fri, 05 Mar 2010) | 1 line

Auto Check-in of any outstanding patches

........

r9084 | p_lindheimer | 2010-03-05 15:29:47 -0800 (Fri, 05 Mar 2010) | 1 line

Module Publish Script: music 2.7.0.3

........

r9085 | p_lindheimer | 2010-03-05 16:37:14 -0800 (Fri, 05 Mar 2010) | 1 line

fixes #4102 check if set before checking value

........

r9092 | p_lindheimer | 2010-03-07 16:17:42 -0800 (Sun, 07 Mar 2010) | 1 line

fixes #4101 - hang up instead of goto h,1 no feedback on ticket so I hope it fixes it, fixes #4112 - forget all the commas in the goto target label, replace them with and then use CUT for each part in the goto, works on 1.4 needs confirming on 1.6, fixes #4113 adds option to force detection part of dialplan, ext-fax will still not be generated since that requires native detection and instead external sources will have to supply an equivalent.

........

r9093 | p_lindheimer | 2010-03-07 16:18:23 -0800 (Sun, 07 Mar 2010) | 1 line

Module Publish Script: fax 2.7.0.16

........

r9096 | p_lindheimer | 2010-03-08 08:16:47 -0800 (Mon, 08 Mar 2010) | 1 line

fixes #4100 use CUT() exclusively in parsing recordings, also unrelated puts Macro(user-callerid) back into pri 1 of all outbound routes which won't be executed but for custom code and maybe custom contexts out there using these routes it retains previous behavior while not affecting anything in the main dialplan

........

r9097 | p_lindheimer | 2010-03-08 08:30:21 -0800 (Mon, 08 Mar 2010) | 1 line

fixes #4099 don't put double quotes around Set() assignments. Please test patch and respond if possible before we publish

........

r9098 | p_lindheimer | 2010-03-08 09:10:21 -0800 (Mon, 08 Mar 2010) | 1 line

fixes 105 again where DEVSTATE was not made global and worked by accident from previous declarations

........

r9105 | mickecarlsson | 2010-03-09 22:57:50 -0800 (Tue, 09 Mar 2010) | 1 line

Fixed small typo in queues, updated all langauges

........

r9111 | p_lindheimer | 2010-03-10 09:53:22 -0800 (Wed, 10 Mar 2010) | 1 line

don't put faxdetect into sip configuration if no detection is enabled, part of solution but not final fix re #4117

........

r9113 | p_lindheimer | 2010-03-10 09:57:20 -0800 (Wed, 10 Mar 2010) | 1 line

Module Publish Script: queues 2.7.0.1

........

r9118 | mickecarlsson | 2010-03-10 10:47:17 -0800 (Wed, 10 Mar 2010) | 1 line

Re #4120, fixed typo

........

r9119 | p_lindheimer | 2010-03-10 10:49:32 -0800 (Wed, 10 Mar 2010) | 1 line

Module Publish Script: queues 2.7.0.2

........

r9120 | p_lindheimer | 2010-03-10 11:12:48 -0800 (Wed, 10 Mar 2010) | 1 line

fixes #4117 add faxdetect=no to all extensions

........

04/16/10 17:38:37 changed by dtobal@beoit.com.br

Hi All!

I tried to fix the ext-fax creating an ext-fax-custom with the changes above, but I still got problem receiving faxes. The system is not being called to send emails.

Anyone has "the tip" ?

Asterisk 1.6.2.6 Fax Module 2.7.0.19 Core 2.7.0.6 Digium Fax Module CentOS 5.4

Thanks!

The Log:

[Apr 16 18:18:36] VERBOSE[8168] res_fax_digium.c: -- FAX handle 0: [ 059.130222 ], STAT_EVT_HW_CLOSE st: WT_HW_CLS rt: WCLSNCLS [Apr 16 18:18:36] VERBOSE[8168] res_fax_digium.c: -- FAX handle 0: [ 059.130328 ], STAT_SES_COMPLETE [Apr 16 18:18:36] DEBUG[8164] dsp.c: tone 1100, Ew=1.61E+08, Et=2.32E+11, s/n= 0.00 [Apr 16 18:18:36] DEBUG[8167] res_fax_digium.c: FAX handle 0: event: EVN_COMPLETE (0x3E9), event data: 0x0 [Apr 16 18:18:36] VERBOSE[8167] res_fax_digium.c: -- Channel 'SIP/192.168.1.254-00000033' FAX session '9' is complete, result: 'SUCCESS' (FAX_SUCCESS), error: 'NO_ERROR', pages: 1, resolution: '204x196', transfer rate: '14400', remoteSID: [Apr 16 18:18:36] DEBUG[8164] res_fax.c: channel 'SIP/192.168.1.254-00000033' - event loop stopped { timeout: 10000, ms: 994, res: 0 } [Apr 16 18:18:36] DEBUG[8164] res_fax_digium.c: FAX handle 0: freeing document queue. [Apr 16 18:18:36] DEBUG[8164] res_fax_digium.c: FAX handle 0: closing [Apr 16 18:18:36] DEBUG[8164] res_fax_digium.c: FAX handle 0: closed the G.711 link. [Apr 16 18:18:36] DEBUG[8164] channel.c: Set channel SIP/192.168.1.254-00000033 to read format ulaw [Apr 16 18:18:36] DEBUG[8164] channel.c: Set channel SIP/192.168.1.254-00000033 to write format ulaw [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'pstn2' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'NO_ERROR' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Expression result is '0' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Launching 'ExecIf?' [Apr 16 18:18:36] VERBOSE[8164] pbx.c: -- Executing [s@ext-fax-custom:5] ExecIf?("SIP/192.168.1.254-00000033", "0?Set(FAXSTATUS=FAILED LICENSE EXCEEDED)") in new stack [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'NO_ERROR' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'NO_ERROR' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Expression result is '0' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'NO_ERROR' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'SUCCESS' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Function result is 'FAX_SUCCESS' [Apr 16 18:18:36] DEBUG[8164] pbx.c: Launching 'ExecIf?' [Apr 16 18:18:36] VERBOSE[8164] pbx.c: -- Executing [s@ext-fax-custom:6] ExecIf?("SIP/192.168.1.254-00000033", "0?Set(FAXSTATUS="FAILED FAXOPT: error: NO_ERROR status: SUCCESS statusstr: FAX_SUCCESS")") in new stack [Apr 16 18:18:36] DEBUG[8164] pbx.c: Launching 'Hangup' [Apr 16 18:18:36] VERBOSE[8164] pbx.c: -- Executing [s@ext-fax-custom:7] Hangup("SIP/192.168.1.254-00000033", "") in new stack [Apr 16 18:18:36] DEBUG[8164] pbx.c: Spawn extension (ext-fax-custom,s,7) exited non-zero on 'SIP/192.168.1.254-00000033' [Apr 16 18:18:36] VERBOSE[8164] pbx.c: == Spawn extension (ext-fax-custom, s, 7) exited non-zero on 'SIP/192.168.1.254-00000033' [Apr 16 18:18:36] DEBUG[8164] channel.c: Soft-Hanging up channel 'SIP/192.168.1.254-00000033' [Apr 16 18:18:36] DEBUG[8164] channel.c: Hanging up channel 'SIP/192.168.1.254-00000033' [Apr 16 18:18:36] DEBUG[8164] chan_sip.c: Hangup call SIP/192.168.1.254-00000033, SIP callid be63c21b-1cbef962@192.168.1.247