execute_on_fax_success/failure
I am using excute_on_fax_success to call a script when a fax is received, the script converts the fax to pdf and emails it, Is there a way to pass the number of pages received, ie, a variable created by spandsp. Everything works, but I do not seem to be able to pass the variables. <condition field="destination_number" expression="^1(\d{10})$|(\d{10})$"> <action application="set" data="faxtempdirectory=/faxfiles/${caller_id_number}"/> <action application="system" data="mkdir ${faxtempdirectory}"/> <action application="set" data="faxDirection=outbound"/> <action application="set" data="emailAddress=$1$2@${fax2net_server}"/> <action application="set" data="faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}"/> <action application="set" data="execute_on_fax_success=system /./var/mail/sentfaxes/fax2mail.sh ${faxFile} $1$2@${fax2net_server} ${fax_security_code} ${fromRc} fax2net_orig=${fax_email}= ${fax_transfer_rate}"/> <action application="answer"/> <action application="playback" data="silence_stream://2000"/> <action application="set" data="fax_enable_t38_request=true"/> <action application="set" data="fax_enable_t38=true"/> <action application="rxfax" data="${faxFile}.tif"/> <action application="hangup"/> </condition> Thanks Darcy Primrose
You news to pass fax_document_total_pages to your script. Please read the spandsp page on the wiki (search spandsp). Also by looking at your script you might be able to polish up your dialplan so that its not so complicated. On May 6, 2012 11:06 AM, "Darcy Primrose" <darcyp@voice2net.ca> wrote:
** I am using excute_on_fax_success to call a script when a fax is received, the script converts the fax to pdf and emails it, Is there a way to pass the number of pages received, ie, a variable created by spandsp. Everything works, but I do not seem to be able to pass the variables.
<condition field="destination_number" expression="^1(\d{10})$|(\d{10})$"> <action application="set" data="faxtempdirectory=/faxfiles/${caller_id_number}"/> <action application="system" data="mkdir ${faxtempdirectory}"/> <action application="set" data="faxDirection=outbound"/> <action application="set" data=" emailAddress=$1$2@${fax2net_server}"/> <action application="set" data="faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}"/> <action application="set" data="execute_on_fax_success=system /./var/mail/sentfaxes/fax2mail.sh ${faxFile} $1$2@${fax2net_server} ${fax_security_code} ${fromRc} fax2net_orig=${fax_email}= ${fax_transfer_rate}"/> <action application="answer"/> <action application="playback" data="silence_stream://2000"/> <action application="set" data="fax_enable_t38_request=true"/> <action application="set" data="fax_enable_t38=true"/> <action application="rxfax" data="${faxFile}.tif"/> <action application="hangup"/> </condition> Thanks Darcy Primrose
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
I did do that, however, if lists fax_document_total_pages as NA, and when I try to pass that parameter, I get a blank field. The dialplan below is not our production, it is merely a test platfrom we use to allow us to ensure your data flow is correct. Darcy ----- Original Message ----- From: Brian Foster To: FreeSWITCH Users Help Sent: Sunday, May 06, 2012 1:39 PM Subject: Re: [Freeswitch-users] execute_on_fax_success/failure You news to pass fax_document_total_pages to your script. Please read the spandsp page on the wiki (search spandsp). Also by looking at your script you might be able to polish up your dialplan so that its not so complicated. On May 6, 2012 11:06 AM, "Darcy Primrose" <darcyp@voice2net.ca> wrote: I am using excute_on_fax_success to call a script when a fax is received, the script converts the fax to pdf and emails it, Is there a way to pass the number of pages received, ie, a variable created by spandsp. Everything works, but I do not seem to be able to pass the variables. <condition field="destination_number" expression="^1(\d{10})$|(\d{10})$"> <action application="set" data="faxtempdirectory=/faxfiles/${caller_id_number}"/> <action application="system" data="mkdir ${faxtempdirectory}"/> <action application="set" data="faxDirection=outbound"/> <action application="set" data="emailAddress=$1$2@${fax2net_server}"/> <action application="set" data="faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}"/> <action application="set" data="execute_on_fax_success=system /./var/mail/sentfaxes/fax2mail.sh ${faxFile} $1$2@${fax2net_server} ${fax_security_code} ${fromRc} fax2net_orig=${fax_email}= ${fax_transfer_rate}"/> <action application="answer"/> <action application="playback" data="silence_stream://2000"/> <action application="set" data="fax_enable_t38_request=true"/> <action application="set" data="fax_enable_t38=true"/> <action application="rxfax" data="${faxFile}.tif"/> <action application="hangup"/> </condition> Thanks Darcy Primrose _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org ------------------------------------------------------------------------------ _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Make sure you're escaping the variable with ///. This variable works in my setup. Admittedly I'm using api_hangup_hook and letting my script decipher whether or not the fax was successful or not. You can also use fax_document_transferred_pages. The difference between that and ...total_pages is that transferred pages shows how many pages made it and total_pages shows how many should have made it. -BDF On May 6, 2012 7:02 PM, "Darcy Primrose" <darcyp@voice2net.ca> wrote:
** I did do that, however, if lists fax_document_total_pages as NA, and when I try to pass that parameter, I get a blank field. The dialplan below is not our production, it is merely a test platfrom we use to allow us to ensure your data flow is correct.
Darcy
----- Original Message ----- *From:* Brian Foster <bdfoster@endigotech.com> *To:* FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> *Sent:* Sunday, May 06, 2012 1:39 PM *Subject:* Re: [Freeswitch-users] execute_on_fax_success/failure
You news to pass fax_document_total_pages to your script. Please read the spandsp page on the wiki (search spandsp).
Also by looking at your script you might be able to polish up your dialplan so that its not so complicated. On May 6, 2012 11:06 AM, "Darcy Primrose" <darcyp@voice2net.ca> wrote:
** I am using excute_on_fax_success to call a script when a fax is received, the script converts the fax to pdf and emails it, Is there a way to pass the number of pages received, ie, a variable created by spandsp. Everything works, but I do not seem to be able to pass the variables.
<condition field="destination_number" expression="^1(\d{10})$|(\d{10})$"> <action application="set" data="faxtempdirectory=/faxfiles/${caller_id_number}"/> <action application="system" data="mkdir ${faxtempdirectory}"/> <action application="set" data="faxDirection=outbound"/> <action application="set" data=" emailAddress=$1$2@${fax2net_server}"/> <action application="set" data="faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}"/> <action application="set" data="execute_on_fax_success=system /./var/mail/sentfaxes/fax2mail.sh ${faxFile} $1$2@${fax2net_server} ${fax_security_code} ${fromRc} fax2net_orig=${fax_email}= ${fax_transfer_rate}"/> <action application="answer"/> <action application="playback" data="silence_stream://2000"/> <action application="set" data="fax_enable_t38_request=true"/> <action application="set" data="fax_enable_t38=true"/> <action application="rxfax" data="${faxFile}.tif"/> <action application="hangup"/> </condition> Thanks Darcy Primrose
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
------------------------------
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Sorry you should be escaping with \\\ not ///. All vars from spandsp need to be escaped with this. The others you shouldn't have to do that. -BDF On May 6, 2012 7:37 PM, "Brian Foster" <bdfoster@endigotech.com> wrote:
Make sure you're escaping the variable with ///. This variable works in my setup. Admittedly I'm using api_hangup_hook and letting my script decipher whether or not the fax was successful or not. You can also use fax_document_transferred_pages. The difference between that and ...total_pages is that transferred pages shows how many pages made it and total_pages shows how many should have made it.
-BDF On May 6, 2012 7:02 PM, "Darcy Primrose" <darcyp@voice2net.ca> wrote:
** I did do that, however, if lists fax_document_total_pages as NA, and when I try to pass that parameter, I get a blank field. The dialplan below is not our production, it is merely a test platfrom we use to allow us to ensure your data flow is correct.
Darcy
----- Original Message ----- *From:* Brian Foster <bdfoster@endigotech.com> *To:* FreeSWITCH Users Help <freeswitch-users@lists.freeswitch.org> *Sent:* Sunday, May 06, 2012 1:39 PM *Subject:* Re: [Freeswitch-users] execute_on_fax_success/failure
You news to pass fax_document_total_pages to your script. Please read the spandsp page on the wiki (search spandsp).
Also by looking at your script you might be able to polish up your dialplan so that its not so complicated. On May 6, 2012 11:06 AM, "Darcy Primrose" <darcyp@voice2net.ca> wrote:
** I am using excute_on_fax_success to call a script when a fax is received, the script converts the fax to pdf and emails it, Is there a way to pass the number of pages received, ie, a variable created by spandsp. Everything works, but I do not seem to be able to pass the variables.
<condition field="destination_number" expression="^1(\d{10})$|(\d{10})$"> <action application="set" data="faxtempdirectory=/faxfiles/${caller_id_number}"/> <action application="system" data="mkdir ${faxtempdirectory}"/> <action application="set" data="faxDirection=outbound"/> <action application="set" data=" emailAddress=$1$2@${fax2net_server}"/> <action application="set" data="faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}"/> <action application="set" data="execute_on_fax_success=system /./var/mail/sentfaxes/fax2mail.sh ${faxFile} $1$2@${fax2net_server} ${fax_security_code} ${fromRc} fax2net_orig=${fax_email}= ${fax_transfer_rate}"/> <action application="answer"/> <action application="playback" data="silence_stream://2000"/> <action application="set" data="fax_enable_t38_request=true"/> <action application="set" data="fax_enable_t38=true"/> <action application="rxfax" data="${faxFile}.tif"/> <action application="hangup"/> </condition> Thanks Darcy Primrose
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
------------------------------
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
_________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com
FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com
Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com
FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
Brian, thank you so much for taking time to go thru this and explain it, works like a charm, so many little things the freeswitch does, I understand why the wiki documentation is so important. I do see in spandsp where it tells you to escape with \\\, it just never lit the light bulb. Thanks Again Darcy ----- Original Message ----- From: Brian Foster To: FreeSWITCH Users Help Sent: Sunday, May 06, 2012 7:40 PM Subject: Re: [Freeswitch-users] execute_on_fax_success/failure Sorry you should be escaping with \\\ not ///. All vars from spandsp need to be escaped with this. The others you shouldn't have to do that. -BDF On May 6, 2012 7:37 PM, "Brian Foster" <bdfoster@endigotech.com> wrote: Make sure you're escaping the variable with ///. This variable works in my setup. Admittedly I'm using api_hangup_hook and letting my script decipher whether or not the fax was successful or not. You can also use fax_document_transferred_pages. The difference between that and ...total_pages is that transferred pages shows how many pages made it and total_pages shows how many should have made it. -BDF On May 6, 2012 7:02 PM, "Darcy Primrose" <darcyp@voice2net.ca> wrote: I did do that, however, if lists fax_document_total_pages as NA, and when I try to pass that parameter, I get a blank field. The dialplan below is not our production, it is merely a test platfrom we use to allow us to ensure your data flow is correct. Darcy ----- Original Message ----- From: Brian Foster To: FreeSWITCH Users Help Sent: Sunday, May 06, 2012 1:39 PM Subject: Re: [Freeswitch-users] execute_on_fax_success/failure You news to pass fax_document_total_pages to your script. Please read the spandsp page on the wiki (search spandsp). Also by looking at your script you might be able to polish up your dialplan so that its not so complicated. On May 6, 2012 11:06 AM, "Darcy Primrose" <darcyp@voice2net.ca> wrote: I am using excute_on_fax_success to call a script when a fax is received, the script converts the fax to pdf and emails it, Is there a way to pass the number of pages received, ie, a variable created by spandsp. Everything works, but I do not seem to be able to pass the variables. <condition field="destination_number" expression="^1(\d{10})$|(\d{10})$"> <action application="set" data="faxtempdirectory=/faxfiles/${caller_id_number}"/> <action application="system" data="mkdir ${faxtempdirectory}"/> <action application="set" data="faxDirection=outbound"/> <action application="set" data="emailAddress=$1$2@${fax2net_server}"/> <action application="set" data="faxFile=$1$2-${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)-Success}"/> <action application="set" data="execute_on_fax_success=system /./var/mail/sentfaxes/fax2mail.sh ${faxFile} $1$2@${fax2net_server} ${fax_security_code} ${fromRc} fax2net_orig=${fax_email}= ${fax_transfer_rate}"/> <action application="answer"/> <action application="playback" data="silence_stream://2000"/> <action application="set" data="fax_enable_t38_request=true"/> <action application="set" data="fax_enable_t38=true"/> <action application="rxfax" data="${faxFile}.tif"/> <action application="hangup"/> </condition> Thanks Darcy Primrose _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org ------------------------------------------------------------------------ _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org ------------------------------------------------------------------------------ _________________________________________________________________________ Professional FreeSWITCH Consulting Services: consulting@freeswitch.org http://www.freeswitchsolutions.com FreeSWITCH-powered IP PBX: The CudaTel Communication Server http://www.cudatel.com Official FreeSWITCH Sites http://www.freeswitch.org http://wiki.freeswitch.org http://www.cluecon.com FreeSWITCH-users mailing list FreeSWITCH-users@lists.freeswitch.org http://lists.freeswitch.org/mailman/listinfo/freeswitch-users UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users http://www.freeswitch.org
On Sun, May 6, 2012 at 6:29 PM, Darcy Primrose <darcyp@voice2net.ca> wrote:
Brian, thank you so much for taking time to go thru this and explain it, works like a charm, so many little things the freeswitch does, I understand why the wiki documentation is so important. I do see in spandsp where it tells you to escape with \\\, it just never lit the light bulb.
Does this need more clarification on the wiki? Does it need mentioned in other places? If so, you might consider updating it to help the next time you or someone else goes looking for it ;) Gabe
I am receiving a transferred call. Is it possible to obtain in dialplan variables all numbers - sip_refer_to and sip_h_referred-by? Thank you. -- Nikolay
participants (4)
-
Brian Foster
-
Darcy Primrose
-
Gabriel Gunderson
-
Nikolay Rogoshchenkov