You are on page 1of 5

<pre>

<configuration name="spandsp.conf" description="Fax example">


<fax-settings>
<param name="use-ecm" value="true"/>
<param name="verbose" value="true"/>
<param name="disable-v17" value="false"/>
<param name="enable-t38" value="false"/>
<param name="enable-t38-request" value="false"/>
<param name="ident" value="SpanDSP Fax Ident"/>
<param name="header" value="SpanDSP Fax Header"/>
<param name="spool-dir" value="/tmp"/>
<param name="file-prefix" value="faxrx"/>
</fax-settings>
</configuration>
</pre>
====Outbound Direction: T.38->TDM====
<pre>
Fax_A->ATA_B->SIP->t38_gateway->FreeSWITCH->mod_openzap->ISDN/PRI E1->Fax
</pre>
<pre>
<extension name="Fax_test2">
<condition field="caller_id_number" expression="^(4919)$"/>
<condition field="destination_number" expression="^(.*)$"/>
<action application="set" data="absolute_codec_string=PCMA"/>
<action application="set" data="fax_enable_t38=true"/>
<action application="set" data="fax_enable_t38_request=true"/>
<action application="answer"/>
<action application="t38_gateway" data="self"/>
<action application="bridge" data="openzap/1/a/$1"/>
<action application="hangup"/>
</condition>
</extension>
</pre>
====Inbound Direction: TDM->T.38====
<pre>
Fax_B->ISDN/PRI E1->mod_openzap->FreeSWITCH->t38_gateway->SIP->ATA_A->Fax_A (4919)
</pre>

<pre>
if (dialed_ext == "4919") then
session:setAutoHangup(false)
session:execute("export", "nolocal:fax_enable_t38=true")
session:execute("export", "nolocal:fax_enable_t38_request=true")
session:execute("export", "nolocal:execute_on_answer=t38_gateway self")
session:execute("export", "nolocal:absolute_codec_string=PCMA")
session:execute("bridge", "user/".."4919@"..sip_domain)
return
end
</pre>
====Internal T.38 to T.38====
<pre>
Fax_A (4919)->ATA_A->SIP->FreeSWITCH->SIP->ATA (same as ATA_A)->Fax_B (2799)
</pre>
<pre>
<extension name="Fax_test t.38 to t.38 via t38-passthru">
<condition field="caller_id_number" expression="^(4919)$"/ break="on-true"/>
<condition field="destination_number" expression="^(2799)$">
<action application="set" data="absolute_codec_string=PCMA"/>
<action application="set" data="proxy_media=true"/>
<action application="set" data="bypass_media=false"/>
<action application="bridge" data="user/2799@<sipdoamin>"/>
<action application="hangup"/>
</condition>
</extension>
</pre>
====Results====
<pre>
Fax_A <-> ATA_A <-> SIP/UDP <-> t38_gateway <-> FreeSWITCH <-> mod_openzap <---->
ISDN/PRI E1 --|
---------------------------- |
/ \ Ayaya-PBX
/\|
Fax_B <-> ATA_B <-> SIP/UDP/G711a <-----/ \<-> ISDN/PRI E1 --|
</pre>

==Events==
===spandsp::rxfaxpageresult===
===spandsp::txfaxpageresult===
===spandsp::rxfaxnegociateresult===
===spandsp::txfaxnegociateresult===
===Channel Variables===
==== [[Variable_dtmf_verbose | dtmf_verbose]] ====
{{:Variable_dtmf_verbose}}
==== [[Variable_min_dup_digit_spacing_ms | min_dup_digit_spacing_ms]] ====
{{:Variable_min_dup_digit_spacing_ms}}
==== [[Variable_spandsp_dtmf_rx_threshold | spandsp_dtmf_rx_threshold]] ====
{{:Variable_spandsp_dtmf_rx_threshold}}
==== [[Variable_spandsp_dtmf_rx_twist | spandsp_dtmf_rx_twist]] ====
{{:Variable_spandsp_dtmf_rx_twist}}
==== [[Variable_spandsp_dtmf_rx_reverse_twist | spandsp_dtmf_rx_reverse_twist]] ====
{{:Variable_spandsp_dtmf_rx_reverse_twist}}
==== [[Variable_spandsp_dtmf_rx_filter_dialtone | spandsp_dtmf_rx_filter_dialtone]] ====
{{:Variable_spandsp_dtmf_rx_filter_dialtone}}
===Dialplan Applications===
====spandsp_start_dtmf====
<action application="spandsp_start_dtmf"/>
====spandsp_stop_dtmf====
<action application="spandsp_stop_dtmf"/>
===Configuration===
<pre>
<configuration name="spandsp.conf" description="Tone detector descriptors">
<descriptors debug-level="0">
<descriptor name="1">
<tone name="CED_TONE" description="ANS / ANSam">
<element freq1="2100" freq2="0" min="700" max="0"/>

</tone>
<tone name="SIT" description="Special Information Tone">
<element freq1="950" freq2="0" min="256" max="400"/>
<element freq1="1400" freq2="0" min="256" max="400"/>
<element freq1="1800" freq2="0" min="256" max="400"/>
</tone>
<tone name="RING_TONE" description="North America ring">
<element freq1="440" freq2="480" min="1200" max="0"/>
</tone>
<tone name="REORDER_TONE" description="North America reorder">
<element freq1="480" freq2="620" min="224" max="316"/>
<element freq1="0" freq2="0" min="168" max="352"/>
<element freq1="480" freq2="620" min="224" max="316"/>
</tone>
<tone name="BUSY_TONE" description="North America busy">
<element freq1="480" freq2="620" min="464" max="536"/>
<element freq1="0" freq2="0" min="464" max="572"/>
<element freq1="480" freq2="620" min="464" max="536"/>
</tone>
</descriptor>
</descriptors>
</configuration>
</pre>
=== Dialplan Applications ===
====start_tone_detect====
<pre>
<action application="start_tone_detect" data="1"/>
</pre>
====stop_tone_detect====
<action application="stop_tone_detect"/>
===APIs===
====start_tone_detect====
<pre>
start_tone_detect <uuid> <descriptor name>
</pre>

====stop_tone_detect====
<pre>
stop_tone_detect <uuid>
</pre>
===Events===
====DETECTED_TONE====

You might also like