Question about fax tone detection
Hi, I have implemented the solution for tone detection in wiki, and also answer the channel before detecting the tone: <condition field="destination_number" expression="^(055138419992)$"> <action application="answer"/> <action application="tone_detect" data="fax 1100 r +15000 transfer fax XML default"/> <extension name="fax"> <condition field="destination_number" expression="^fax$"> <action application="answer" /> <action application="sleep" data="1000"/> <action application="rxfax" data="/usr/local/freeswitch/storage/fax/${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)}.tiff"/> <action application="set" data="fax_mode=recv"/> <action application="hangup"/> </condition> </extension> But FS cannot recognize the tone, and therefore cannot move to fax extension. Below are the error in FS: 2009-10-12 10:57:16.702287 [NOTICE] switch_channel.c:602 New Channel sofia/external/anonymous@anonymous.invalid [c431f0a3-9231-4724-ba39-9e4ef7edfca2] 2009-10-12 10:57:16.703413 [INFO] mod_dialplan_xml.c:315 Processing Anonymous->055138419992 in context public 2009-10-12 10:57:16.719288 [NOTICE] switch_ivr.c:1349 Transfer sofia/external/anonymous@anonymous.invalid to XML[055138419992@default] 2009-10-12 10:57:16.719288 [INFO] mod_dialplan_xml.c:315 Processing Anonymous->055138419992 in context default 2009-10-12 10:57:16.722289 [NOTICE] mod_dptools.c:649 Channel [sofia/external/anonymous@anonymous.invalid] has been answered 2009-10-12 10:57:16.722289 [NOTICE] mod_dptools.c:1324 Enabling tone detection 'fax' '1100' 2009-10-12 10:57:16.723302 [NOTICE] switch_core_state_machine.c:179 Hangup sofia/external/anonymous@anonymous.invalid [CS_EXECUTE] [NORMAL_CLEARING] 2009-10-12 10:57:16.740285 [NOTICE] switch_core_session.c:1086 Session 1 (sofia/external/anonymous@anonymous.invalid) Ended 2009-10-12 10:57:16.740285 [NOTICE] switch_core_session.c:1088 Close Channel sofia/external/anonymous@anonymous.invalid [CS_DESTROY] And the trace for SIP messages: http://pastebin.com/m4e47e7d9 If anyone has any idea, tell me please. Thanks. -- View this message in context: http://n2.nabble.com/Question-about-fax-tone-detection-tp3807298p3807298.htm... Sent from the freeswitch-users mailing list archive at Nabble.com.
On Mon, Oct 12, 2009 at 4:01 AM, homqua <ngay01042005@gmail.com> wrote:
Hi, I have implemented the solution for tone detection in wiki, and also answer the channel before detecting the tone: <condition field="destination_number" expression="^(055138419992)$"> <action application="answer"/> <action application="tone_detect" data="fax 1100 r +15000 transfer fax XML default"/>
<extension name="fax"> <condition field="destination_number" expression="^fax$"> <action application="answer" /> <action application="sleep" data="1000"/> <action application="rxfax"
data="/usr/local/freeswitch/storage/fax/${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)}.tiff"/> <action application="set" data="fax_mode=recv"/> <action application="hangup"/> </condition> </extension>
But FS cannot recognize the tone, and therefore cannot move to fax extension. Below are the error in FS:
2009-10-12 10:57:16.702287 [NOTICE] switch_channel.c:602 New Channel sofia/external/anonymous@anonymous.invalid [c431f0a3-9231-4724-ba39-9e4ef7edfca2] 2009-10-12 10:57:16.703413 [INFO] mod_dialplan_xml.c:315 Processing Anonymous->055138419992 in context public 2009-10-12 10:57:16.719288 [NOTICE] switch_ivr.c:1349 Transfer sofia/external/anonymous@anonymous.invalid to XML[055138419992@default] 2009-10-12 10:57:16.719288 [INFO] mod_dialplan_xml.c:315 Processing Anonymous->055138419992 in context default 2009-10-12 10:57:16.722289 [NOTICE] mod_dptools.c:649 Channel [sofia/external/anonymous@anonymous.invalid] has been answered 2009-10-12 10:57:16.722289 [NOTICE] mod_dptools.c:1324 Enabling tone detection 'fax' '1100' 2009-10-12 10:57:16.723302 [NOTICE] switch_core_state_machine.c:179 Hangup sofia/external/anonymous@anonymous.invalid [CS_EXECUTE] [NORMAL_CLEARING] 2009-10-12 10:57:16.740285 [NOTICE] switch_core_session.c:1086 Session 1 (sofia/external/anonymous@anonymous.invalid) Ended 2009-10-12 10:57:16.740285 [NOTICE] switch_core_session.c:1088 Close Channel sofia/external/anonymous@anonymous.invalid [CS_DESTROY]
And the trace for SIP messages: http://pastebin.com/m4e47e7d9
If anyone has any idea, tell me please. Thanks.
I think the trouble here is that you don't have anything else in the dialplan after the tone_detect. The tone_detect app is non-block, which means that it doesn't sit there and wait for a tone. If you want the dialplan to sit and wait then do a sleep app after your tone_detect. The other question I would have is this: what happens if the incoming call is not a fax? What do you want to do then? -MC
This is what I have in my dialplan and the fax is detected beautifully. Note that in my case, extension 1000 will ring for a second or two before the fax is detected. So in your example, the fax does not have time to be detected, the dialplan exists and the call is hungup. When the fax is detected, the call is transferred to the receivefax extension in context features. The extension 1000 does not have to be answered for the transfer to occur. <extension name="Local_1000s"> <condition field="destination_number" expression="^(10[01][0-9])$"> <action application="set" data="dialed_extension=$1"/> <action application="export" data="dialed_extension=$1"/> <action application="set" data="ringback=${au-ring}"/> <action application="tone_detect" data="fax 1100 r +5000 transfer 'receivefax XML features' 1" /> <action application="set" data="hangup_after_bridge=true"/> <action application="set" data="continue_on_fail=true"/> <action application="bridge" data="user/${dialed_extension}@${domain}"/> <action application="answer"/> <action application="sleep" data="1000"/> <action application="voicemail" data="default ${domain_name} ${dialed_extension}"/> </condition> </extension> and in the features context I have <extension name="receivefax"> <condition field="destination_number" expression="^receivefax$"> <action application="answer" /> <action application="playback" data="silence_stream://2000"/> <action application="rxfax" data="//usr//local//freeswitch//storage//${caller_id_number}-${uuid}.rxfax.tiff"/> <action application="system" data="/usr/local/freeswitch/scripts/emailfax.sh /usr/local/freeswitch/storage/${caller_id_number}-${uuid}.rxfax.tiff"/> <action application="hangup"/> </condition> </extension> On Tue, Oct 13, 2009 at 5:00 AM, Michael Collins <msc@freeswitch.org> wrote:
On Mon, Oct 12, 2009 at 4:01 AM, homqua <ngay01042005@gmail.com> wrote:
Hi, I have implemented the solution for tone detection in wiki, and also answer the channel before detecting the tone: <condition field="destination_number" expression="^(055138419992)$"> <action application="answer"/> <action application="tone_detect" data="fax 1100 r +15000 transfer fax XML default"/>
<extension name="fax"> <condition field="destination_number" expression="^fax$"> <action application="answer" /> <action application="sleep" data="1000"/> <action application="rxfax"
data="/usr/local/freeswitch/storage/fax/${caller_id_number}-${strftime(%Y-%m-%d-%H-%M-%S)}.tiff"/> <action application="set" data="fax_mode=recv"/> <action application="hangup"/> </condition> </extension>
But FS cannot recognize the tone, and therefore cannot move to fax extension. Below are the error in FS:
2009-10-12 10:57:16.702287 [NOTICE] switch_channel.c:602 New Channel sofia/external/anonymous@anonymous.invalid [c431f0a3-9231-4724-ba39-9e4ef7edfca2] 2009-10-12 10:57:16.703413 [INFO] mod_dialplan_xml.c:315 Processing Anonymous->055138419992 in context public 2009-10-12 10:57:16.719288 [NOTICE] switch_ivr.c:1349 Transfer sofia/external/anonymous@anonymous.invalid to XML[055138419992@default] 2009-10-12 10:57:16.719288 [INFO] mod_dialplan_xml.c:315 Processing Anonymous->055138419992 in context default 2009-10-12 10:57:16.722289 [NOTICE] mod_dptools.c:649 Channel [sofia/external/anonymous@anonymous.invalid] has been answered 2009-10-12 10:57:16.722289 [NOTICE] mod_dptools.c:1324 Enabling tone detection 'fax' '1100' 2009-10-12 10:57:16.723302 [NOTICE] switch_core_state_machine.c:179 Hangup sofia/external/anonymous@anonymous.invalid [CS_EXECUTE] [NORMAL_CLEARING] 2009-10-12 10:57:16.740285 [NOTICE] switch_core_session.c:1086 Session 1 (sofia/external/anonymous@anonymous.invalid) Ended 2009-10-12 10:57:16.740285 [NOTICE] switch_core_session.c:1088 Close Channel sofia/external/anonymous@anonymous.invalid [CS_DESTROY]
And the trace for SIP messages: http://pastebin.com/m4e47e7d9
If anyone has any idea, tell me please. Thanks.
I think the trouble here is that you don't have anything else in the dialplan after the tone_detect. The tone_detect app is non-block, which means that it doesn't sit there and wait for a tone. If you want the dialplan to sit and wait then do a sleep app after your tone_detect. The other question I would have is this: what happens if the incoming call is not a fax? What do you want to do then?
-MC
_______________________________________________ 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
participants (3)
-
homqua
-
Mark Campbell-Smith
-
Michael Collins