Asterisk
Open Source Communications Framework
Asterisk is one of the most widely deployed SIP switching platforms in the world, and is known to work very well with Power-T.38. In fact, some of our largest service provider customers have built their businesses on Asterisk and related Open Source telephony tools! The features available and configuration you will need varies widely by release, as we will detail in the sections below.
Read MoreAsterisk T.38 Support by Version
Before continuing with this guide, please review our Asterisk Design Guide for considerations that affect all Asterisk-based deployments.
- add_circle Asterisk 15
This version supports both T.38 passthrough and T.38 termination. We have configuration instructions for both chan_sip and chan_pjsip, be sure that you're using the right configuration!
- Chan_SIP:
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax.com with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_sip.so and res_rtp_asterisk.so.
If you do not have both modules, you must recompile asterisk. Here are the commands:
# Asterisk-13 cd /usr/src curl -L -o asterisk-13.cur.tar.gz https://hubs.ly/H097_fC0 tar xvfz asterisk-13.cur.tar.gz rm -rf asterisk-13.cur.tar.gz cd asterisk-13.* # Configure Asterisk. # To Configure Asterisk on 32 bit run: ./configure ./configure --libdir=/usr/lib64 make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk make && make install
3. Modify your sip.conf file (/etc/asterisk/sip.conf).
Add the following to the [general] section of your sip.conf file:
; sip.conf [general] directmedia=no t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a [t38fax] user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax port=5080 qualify=yes qualifyfreq=30 defaultexpiry=300 insecure=port,invite host=sip.t38fax.com realm=sip.t38fax.com secret=SIP_PASSWORD defaultuser=SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a user definition for your ATA to register as. Add this after the [t38fax] definition in your sip.conf file:
[ATA_SIP_USERNAME] type=friend context=outboundT38Fax qualify=yes qualifyfreq=30 host=dynamic defaultexpiry=300 secret=ATA_SIP_PASSWORD defaultuser=ATA_SIP_USERNAME callerid="John Doe" <"CALLERID-NUMBER">
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account. Additionally, depending on your deployment & network topology, you may need to add nat=yes to both of the definitions above. Ask your Network Administrator if you are using NAT Traversal.
help SIP_USERNAME
help SIP_PASSWORD
help ATA_SIP_USERNAME
help ATA_SIP_PASSWORD
4. Add the following to your udptl.conf file (/etc/asterisk/udptl.conf):
; udptl.conf udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
5. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38Fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(SIP/DIDX1) ; If you have more than one DID, you can add additional ; definitions to route them as well: exten => DIDX2,1,Dial(SIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,NoOp(caught 11 digits ${EXTEN}) exten => _1NXXNXXXXXX!,n,Dial(SIP/${EXTEN}@t38fax)
6. Configure your ATA to connect to Asterisk.
As an Example, to configure a Cisco SPA-112:
- 1. Follow the steps found here: Cisco SPA-112 Configuration Guide
- 2. Navigate to "Voice -> Line 1".
- 3. Enter your Asterisk Server's address/hostname in the "Proxy" field.
- 4. Enter the context you created in Step 2 in the "Display Name" and "User ID" fields. (Likely your T38Fax DID if you followed this guide).
- 5. Enter the password for the context you created in Step 3 in the "Password" Field.
- 6. Click Submit, and the SPA112 should reload it's configuration.
- 7. In the Asterisk CLI (asterisk -r) you should now be able to see the device register. Enter: sip show peer SIP_USERNAME (You'll want to look for "Status: OK" and "Addr -> IP" to show an IP address. Remember to replace SIP_USERNAME with your T38Fax.com DID!)
- T.38 Termination Support:
T.38 Termination Support
Coming soon!
- T.38 Passthrough Support:
- Chan_PJSIP:
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_pjsip.so and res_pjsip.so.
If you do not have both modules, you must recompile asterisk. You will also need to download and compile pjproject. Here are the instructions:
Download & Compile pjproject:
# PJProject cd /usr/src curl -L -o pjproject-2.4.tar.bz2 http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2 tar -xjvf pjproject-2.4.tar.bz2 rm -rf pjproject-2.4.tar.bz2 cd pjproject-2.* # See https://wiki.asterisk.org/wiki/display/AST/PJSIP-pjproject # for additional options you may wish to configure. Note: # This command must be modified when using a 32-bit # operating system. Simply remove the --libdir=/usr/lib64 # option from the command. ./configure CFLAGS="-DNDEBUG" --prefix=/usr --libdir=/usr/lib64 --enable-shared make dep make make install ldconfig # Verify that the PJSIP libraries have been dynamically # linked by running: ldconfig -p | grep pj
Then, recompile Asterisk with the PJSIP Modules:
# Asterisk-13 cd /usr/src curl -L -o asterisk-13.cur.tar.gz https://hubs.ly/H097_fC0 tar xvfz asterisk-13.cur.tar.gz rm -rf asterisk-13.cur.tar.gz cd asterisk-13.* # Run the following to install prerequisities: ./contrib/scripts/install_prereq install # Configure Asterisk. # To Configure Asterisk on 32 bit run: ./configure ./configure --libdir=/usr/lib64 make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_pjsip # Resource Modules/res_pjsip make && make install
3. Modify your pjsip.conf file (/etc/asterisk/pjsip.conf):
This configuration guide assumes that you have configured your network correctly and understand it's setup. We do not include NAT or Transport specifications as each deployment will be different.
Setup your Transport. Use the UDP Protocol, and configure the transport as your network requires. An example transport is defined below:
; === Transports [system-udp] type=transport protocol=udp bind=0.0.0.0:5080 local_net=172.31.25.0/20 local_net=127.0.0.1/32 external_media_address=52.70.17.6 ; Public IP external_signaling_address=52.70.17.6 ; This allows the Transport to be "reloaded" ; (No restart required) allow_reload=yes
Add a trunk section to define your T38Fax SIP Trunk, its configuration is below. Be sure to add in your account specific information!
; === Trunks [t38fax] type=registration transport=SIP_TRANSPORT outbound_auth=t38fax server_uri=sip:sip.t38fax.com:5080 client_uri=sip:[email protected]:5080 retry_interval=60 contact_user=SIP_USERNAME [t38fax] type=auth auth_type=userpass password=SIP_PASSWORD username=SIP_USERNAME [t38fax] type=aor contact=sip:[email protected]:5080 [t38fax] type=endpoint context=inboundT38Fax disallow=all allow=ulaw outbound_auth=t38fax aors=t38fax direct_media=no t38_udptl=yes t38_udptl_maxdatagram=400 t38_udptl_ec=redundancy t38_udptl_nat=yes from_domain=sip.t38fax.com [t38fax] type=identify endpoint=t38fax match=sip.t38fax.com
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
help SIP_TRANSPORT
Finally, add a "Devices" definition after your trunk section to define configuration options for your ATA so it can register using a PJSIP channel. A configuration example is below:
; === Devices [ATA_SIP_USERNAME] type=endpoint transport=SIP_TRANSPORT context=outboundT38Fax force_rport=yes rtp_symmetric=yes direct_media=no aors=ATA_SIP_USERNAME auth=ATA_SIP_USERNAME callerid="T38Fax CallerID" disallow=all allow=ulaw t38_udptl=yes t38_udptl_ec=redundancy t38_udptl_nat=yes [ATA_SIP_USERNAME] type=aor max_contacts=2 remove_existing=yes [ATA_SIP_USERNAME] type=auth auth_type=userpass username=ATA_SIP_USERNAME password=ATA_SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help ATA_SIP_USERNAME
help ATA_SIP_PASSWORD
help SIP_TRANSPORT
4. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(PJSIP/DIDX1) ; If you have more than one DID, you can add additional ; definitions to route them as well: exten => DIDX2,1,Dial(PJSIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,Set(CALLERID(all)="T38Fax" ) same => n,NoOp(caught 11 digits ${EXTEN}) same => n,Dial(PJSIP/${EXTEN}@t38fax)
5. Add the following to the [general] section of your udptl.conf file (/etc/asterisk/udptl.conf):
; updtl.conf [general] udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
6. Configure your ATA to connect to Asterisk.
You should now be able to register your ATA to Asterisk, and to make and receive fax calls using T.38! If you have any trouble, please open a ticket and one of our Support Engineers will assist you in getting set up.
- T.38 Termination Support:
T.38 Termination Support
Coming Soon!
- T.38 Passthrough Support:
- Chan_SIP:
- add_circle Asterisk 14
This version supports both T.38 passthrough and T.38 termination. We have configuration instructions for both chan_sip and chan_pjsip, be sure that you're using the right configuration!
- Chan_SIP:
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax.com with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_sip.so and res_rtp_asterisk.so.
If you do not have both modules, you must recompile asterisk. Here are the commands:
# Asterisk-13 cd /usr/src curl -L -o asterisk-13.cur.tar.gz https://hubs.ly/H097_fC0 tar xvfz asterisk-13.cur.tar.gz rm -rf asterisk-13.cur.tar.gz cd asterisk-13.* # Configure Asterisk. # To Configure Asterisk on 32 bit run: ./configure ./configure --libdir=/usr/lib64 make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk make && make install
3. Modify your sip.conf file (/etc/asterisk/sip.conf).
Add the following to the [general] section of your sip.conf file:
; sip.conf [general] directmedia=no t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a [t38fax] user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax port=5080 qualify=yes qualifyfreq=30 defaultexpiry=300 insecure=port,invite host=sip.t38fax.com realm=sip.t38fax.com secret=SIP_PASSWORD defaultuser=SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a user definition for your ATA to register as. Add this after the [t38fax] definition in your sip.conf file:
[ATA_SIP_USERNAME] type=friend context=outboundT38Fax qualify=yes qualifyfreq=30 host=dynamic defaultexpiry=300 secret=ATA_SIP_PASSWORD defaultuser=ATA_SIP_USERNAME callerid="John Doe" <"CALLERID-NUMBER">
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account. Additionally, depending on your deployment & network topology, you may need to add nat=yes to both of the definitions above. Ask your Network Administrator if you are using NAT Traversal.
help SIP_USERNAME
help SIP_PASSWORD
help ATA_SIP_USERNAME
help ATA_SIP_PASSWORD
4. Add the following to your udptl.conf file (/etc/asterisk/udptl.conf):
; udptl.conf udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
5. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38Fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(SIP/DIDX1) ; If you have more than one DID, you can add additional ; definitions to route them as well: exten => DIDX2,1,Dial(SIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,NoOp(caught 11 digits ${EXTEN}) exten => _1NXXNXXXXXX!,n,Dial(SIP/${EXTEN}@t38fax)
6. Configure your ATA to connect to Asterisk.
As an Example, to configure a Cisco SPA-112:
- 1. Follow the steps found here: Cisco SPA-112 Configuration Guide
- 2. Navigate to "Voice -> Line 1".
- 3. Enter your Asterisk Server's address/hostname in the "Proxy" field.
- 4. Enter the context you created in Step 2 in the "Display Name" and "User ID" fields. (Likely your T38Fax DID if you followed this guide).
- 5. Enter the password for the context you created in Step 3 in the "Password" Field.
- 6. Click Submit, and the SPA112 should reload it's configuration.
- 7. In the Asterisk CLI (asterisk -r) you should now be able to see the device register. Enter: sip show peer SIP_USERNAME (You'll want to look for "Status: OK" and "Addr -> IP" to show an IP address. Remember to replace SIP_USERNAME with your T38Fax.com DID!)
- T.38 Termination Support:
T.38 Termination Support
Coming soon!
- T.38 Passthrough Support:
- Chan_PJSIP:
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_pjsip.so and res_pjsip.so.
If you do not have both modules, you must recompile asterisk. You will also need to download and compile pjproject. Here are the instructions:
Download & Compile pjproject:
# PJProject cd /usr/src curl -L -o pjproject-2.4.tar.bz2 http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2 tar -xjvf pjproject-2.4.tar.bz2 rm -rf pjproject-2.4.tar.bz2 cd pjproject-2.* # See https://wiki.asterisk.org/wiki/display/AST/PJSIP-pjproject # for additional options you may wish to configure. Note: # This command must be modified when using a 32-bit # operating system. Simply remove the --libdir=/usr/lib64 # option from the command. ./configure CFLAGS="-DNDEBUG" --prefix=/usr --libdir=/usr/lib64 --enable-shared make dep make make install ldconfig # Verify that the PJSIP libraries have been dynamically # linked by running: ldconfig -p | grep pj
Then, recompile Asterisk with the PJSIP Modules:
# Asterisk-13 cd /usr/src curl -L -o asterisk-13.cur.tar.gz https://hubs.ly/H097_fC0 tar xvfz asterisk-13.cur.tar.gz rm -rf asterisk-13.cur.tar.gz cd asterisk-13.* # Run the following to install prerequisities: ./contrib/scripts/install_prereq install # Configure Asterisk. # To Configure Asterisk on 32 bit run: ./configure ./configure --libdir=/usr/lib64 make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_pjsip # Resource Modules/res_pjsip make && make install
3. Modify your pjsip.conf file (/etc/asterisk/pjsip.conf):
This configuration guide assumes that you have configured your network correctly and understand it's setup. We do not include NAT or Transport specifications as each deployment will be different.
Setup your Transport. Use the UDP Protocol, and configure the transport as your network requires. An example transport is defined below:
; === Transports [system-udp] type=transport protocol=udp bind=0.0.0.0:5080 local_net=172.31.25.0/20 local_net=127.0.0.1/32 external_media_address=52.70.17.6 ; Public IP external_signaling_address=52.70.17.6 ; This allows the Transport to be "reloaded" ; (No restart required) allow_reload=yes
Add a trunk section to define your T38Fax SIP Trunk, its configuration is below. Be sure to add in your account specific information!
; === Trunks [t38fax] type=registration transport=SIP_TRANSPORT outbound_auth=t38fax server_uri=sip:sip.t38fax.com:5080 client_uri=sip:[email protected]:5080 retry_interval=60 contact_user=SIP_USERNAME [t38fax] type=auth auth_type=userpass password=SIP_PASSWORD username=SIP_USERNAME [t38fax] type=aor contact=sip:[email protected]:5080 [t38fax] type=endpoint context=inboundT38Fax disallow=all allow=ulaw outbound_auth=t38fax aors=t38fax direct_media=no t38_udptl=yes t38_udptl_maxdatagram=400 t38_udptl_ec=redundancy t38_udptl_nat=yes from_domain=sip.t38fax.com [t38fax] type=identify endpoint=t38fax match=sip.t38fax.com
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
help SIP_TRANSPORT
Finally, add a "Devices" definition after your trunk section to define configuration options for your ATA so it can register using a PJSIP channel. A configuration example is below:
; === Devices [ATA_SIP_USERNAME] type=endpoint transport=SIP_TRANSPORT context=outboundT38Fax force_rport=yes rtp_symmetric=yes direct_media=no aors=ATA_SIP_USERNAME auth=ATA_SIP_USERNAME callerid="T38Fax CallerID" disallow=all allow=ulaw t38_udptl=yes t38_udptl_ec=redundancy t38_udptl_nat=yes [ATA_SIP_USERNAME] type=aor max_contacts=2 remove_existing=yes [ATA_SIP_USERNAME] type=auth auth_type=userpass username=ATA_SIP_USERNAME password=ATA_SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help ATA_SIP_USERNAME
help ATA_SIP_PASSWORD
help SIP_TRANSPORT
4. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(PJSIP/DIDX1) ; If you have more than one DID, you can add additional ; definitions to route them as well: exten => DIDX2,1,Dial(PJSIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,Set(CALLERID(all)="T38Fax" ) same => n,NoOp(caught 11 digits ${EXTEN}) same => n,Dial(PJSIP/${EXTEN}@t38fax)
5. Add the following to the [general] section of your udptl.conf file (/etc/asterisk/udptl.conf):
; updtl.conf [general] udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
6. Configure your ATA to connect to Asterisk.
You should now be able to register your ATA to Asterisk, and to make and receive fax calls using T.38! If you have any trouble, please open a ticket and one of our Support Engineers will assist you in getting set up.
- T.38 Termination Support:
T.38 Termination Support
Coming Soon!
- T.38 Passthrough Support:
- Chan_SIP:
- add_circle Asterisk 13 (LTS)
This version supports both T.38 passthrough and T.38 termination. We have configuration instructions for both chan_sip and chan_pjsip, be sure that you're using the right configuration!
- Chan_SIP:
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax.com with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_sip.so and res_rtp_asterisk.so.
If you do not have both modules, you must recompile asterisk. Here are the commands:
# Asterisk-13 cd /usr/src curl -L -o asterisk-13.cur.tar.gz https://hubs.ly/H097_fC0 tar xvfz asterisk-13.cur.tar.gz rm -rf asterisk-13.cur.tar.gz cd asterisk-13.* # Configure Asterisk. # To Configure Asterisk on 32 bit run: ./configure ./configure --libdir=/usr/lib64 make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk make && make install
3. Modify your sip.conf file (/etc/asterisk/sip.conf).
Add the following to the [general] section of your sip.conf file:
; sip.conf [general] directmedia=no t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a [t38fax] user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax port=5080 qualify=yes qualifyfreq=30 defaultexpiry=300 insecure=port,invite host=sip.t38fax.com realm=sip.t38fax.com secret=SIP_PASSWORD defaultuser=SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a user definition for your ATA to register as. Add this after the [t38fax] definition in your sip.conf file:
[ATA_SIP_USERNAME] type=friend context=outboundT38Fax qualify=yes qualifyfreq=30 host=dynamic defaultexpiry=300 secret=ATA_SIP_PASSWORD defaultuser=ATA_SIP_USERNAME callerid="John Doe" <"CALLERID-NUMBER">
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account. Additionally, depending on your deployment & network topology, you may need to add nat=yes to both of the definitions above. Ask your Network Administrator if you are using NAT Traversal.
help SIP_USERNAME
help SIP_PASSWORD
help ATA_SIP_USERNAME
help ATA_SIP_PASSWORD
4. Add the following to your udptl.conf file (/etc/asterisk/udptl.conf):
; udptl.conf udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
5. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38Fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(SIP/DIDX1) ; If you have more than one DID, you can add additional ; definitions to route them as well: exten => DIDX2,1,Dial(SIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,NoOp(caught 11 digits ${EXTEN}) exten => _1NXXNXXXXXX!,n,Dial(SIP/${EXTEN}@t38fax)
6. Configure your ATA to connect to Asterisk.
As an Example, to configure a Cisco SPA-112:
- 1. Follow the steps found here: Cisco SPA-112 Configuration Guide
- 2. Navigate to "Voice -> Line 1".
- 3. Enter your Asterisk Server's address/hostname in the "Proxy" field.
- 4. Enter the context you created in Step 2 in the "Display Name" and "User ID" fields. (Likely your T38Fax DID if you followed this guide).
- 5. Enter the password for the context you created in Step 3 in the "Password" Field.
- 6. Click Submit, and the SPA112 should reload it's configuration.
- 7. In the Asterisk CLI (asterisk -r) you should now be able to see the device register. Enter: sip show peer SIP_USERNAME (You'll want to look for "Status: OK" and "Addr -> IP" to show an IP address. Remember to replace SIP_USERNAME with your T38Fax.com DID!)
- T.38 Termination Support:
T.38 Termination Support
Coming soon!
- T.38 Passthrough Support:
- Chan_PJSIP:
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_pjsip.so and res_pjsip.so.
If you do not have both modules, you must recompile asterisk. You will also need to download and compile pjproject. Here are the instructions:
Download & Compile pjproject:
# PJProject cd /usr/src curl -L -o pjproject-2.4.tar.bz2 http://www.pjsip.org/release/2.4/pjproject-2.4.tar.bz2 tar -xjvf pjproject-2.4.tar.bz2 rm -rf pjproject-2.4.tar.bz2 cd pjproject-2.* # See https://wiki.asterisk.org/wiki/display/AST/PJSIP-pjproject # for additional options you may wish to configure. Note: # This command must be modified when using a 32-bit # operating system. Simply remove the --libdir=/usr/lib64 # option from the command. ./configure CFLAGS="-DNDEBUG" --prefix=/usr --libdir=/usr/lib64 --enable-shared make dep make make install ldconfig # Verify that the PJSIP libraries have been dynamically # linked by running: ldconfig -p | grep pj
Then, recompile Asterisk with the PJSIP Modules:
# Asterisk-13 cd /usr/src curl -L -o asterisk-13.cur.tar.gz https://hubs.ly/H097_fC0 tar xvfz asterisk-13.cur.tar.gz rm -rf asterisk-13.cur.tar.gz cd asterisk-13.* # Run the following to install prerequisities: ./contrib/scripts/install_prereq install # Configure Asterisk. # To Configure Asterisk on 32 bit run: ./configure ./configure --libdir=/usr/lib64 make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_pjsip # Resource Modules/res_pjsip make && make install
3. Modify your pjsip.conf file (/etc/asterisk/pjsip.conf):
This configuration guide assumes that you have configured your network correctly and understand it's setup. We do not include NAT or Transport specifications as each deployment will be different.
Setup your Transport. Use the UDP Protocol, and configure the transport as your network requires. An example transport is defined below:
; === Transports [system-udp] type=transport protocol=udp bind=0.0.0.0:5080 local_net=172.31.25.0/20 local_net=127.0.0.1/32 external_media_address=52.70.17.6 ; Public IP external_signaling_address=52.70.17.6 ; This allows the Transport to be "reloaded" ; (No restart required) allow_reload=yes
Add a trunk section to define your T38Fax SIP Trunk, its configuration is below. Be sure to add in your account specific information!
; === Trunks [t38fax] type=registration transport=SIP_TRANSPORT outbound_auth=t38fax server_uri=sip:sip.t38fax.com:5080 client_uri=sip:[email protected]:5080 retry_interval=60 contact_user=SIP_USERNAME [t38fax] type=auth auth_type=userpass password=SIP_PASSWORD username=SIP_USERNAME [t38fax] type=aor contact=sip:[email protected]:5080 [t38fax] type=endpoint context=inboundT38Fax disallow=all allow=ulaw outbound_auth=t38fax aors=t38fax direct_media=no t38_udptl=yes t38_udptl_maxdatagram=400 t38_udptl_ec=redundancy t38_udptl_nat=yes from_domain=sip.t38fax.com [t38fax] type=identify endpoint=t38fax match=sip.t38fax.com
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
help SIP_TRANSPORT
Finally, add a "Devices" definition after your trunk section to define configuration options for your ATA so it can register using a PJSIP channel. A configuration example is below:
; === Devices [ATA_SIP_USERNAME] type=endpoint transport=SIP_TRANSPORT context=outboundT38Fax force_rport=yes rtp_symmetric=yes direct_media=no aors=ATA_SIP_USERNAME auth=ATA_SIP_USERNAME callerid="T38Fax CallerID" disallow=all allow=ulaw t38_udptl=yes t38_udptl_ec=redundancy t38_udptl_nat=yes [ATA_SIP_USERNAME] type=aor max_contacts=2 remove_existing=yes [ATA_SIP_USERNAME] type=auth auth_type=userpass username=ATA_SIP_USERNAME password=ATA_SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help ATA_SIP_USERNAME
help ATA_SIP_PASSWORD
help SIP_TRANSPORT
4. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(PJSIP/DIDX1) ; If you have more than one DID, you can add additional ; definitions to route them as well: exten => DIDX2,1,Dial(PJSIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,Set(CALLERID(all)="T38Fax" ) same => n,NoOp(caught 11 digits ${EXTEN}) same => n,Dial(PJSIP/${EXTEN}@t38fax)
5. Add the following to the [general] section of your udptl.conf file (/etc/asterisk/udptl.conf):
; updtl.conf [general] udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
6. Configure your ATA to connect to Asterisk.
You should now be able to register your ATA to Asterisk, and to make and receive fax calls using T.38! If you have any trouble, please open a ticket and one of our Support Engineers will assist you in getting set up.
- T.38 Termination Support:
T.38 Termination Support
Coming Soon!
- T.38 Passthrough Support:
- Chan_SIP:
- add_circle Asterisk 12 (STD)
In Asterisk 12, a new SIP channel driver (chan_pjsip) was introduced.
- add_circle Asterisk 11 (LTS)
This version supports both T.38 passthrough and T.38 termination.
- T.38 Passthrough Support:
T.38 Passthrough Support
To integrate T38Fax.com with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_sip.so and res_rtp_asterisk.so.
If you do not have both modules, you must recompile asterisk. Here are the commands:
# Asterisk 11 cd /usr/local/src wget -O asterisk-11.cur.tar.gz https://hubs.ly/H0981kw0 tar xvfz asterisk-11.cur.tar.gz rm -rf asterisk-11.cur.tar.gz cd asterisk-11.* ./configure make menuselect # Ensure that the following modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk make install
3. Modify your sip.conf file (/etc/asterisk/sip.conf):
Add the following to the [general] section of your sip.conf file:
; sip.conf directmedia=no t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a [t38fax] user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax qualify=yes qualifyfreq=30 defaultexpiry=300 insecure=port,invite host=sip.t38fax.com realm=sip.t38fax.com defaultuser=SIP_USERNAME secret=SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help SIP_USERNAME
help SIP_PASSWORD
Add a user definition for your ATA to register as. Add this after the [t38fax] definition in your sip.conf file:
[SIP_USERNAME] type=friend context=outboundT38Fax qualify=yes qualifyfreq=30 host=dynamic defaultexpiry=300 defaultuser=SIP_USERNAME callerid="John Doe" secret=YOUR_ATA_PWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account. Additionally, depending on your deployment & network topology, you may need to add nat=yes to both of the definitions above. Ask your Network Administrator if you are using NAT Traversal.
help SIP_USERNAME
help SIP_PASSWORD
help ATA_SIP_PASSWORD
Add the following to your udptl.conf file (/etc/asterisk/udptl.conf):
; udptl.conf udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
4. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. exten => DIDX1,1,Dial(SIP/DIDX1) ; If you have more than one DID, you can add additional definitions to ; route them as well: exten => DIDX2,1,Dial(SIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,NoOp(caught 11 digits ${EXTEN}) exten => _1NXXNXXXXXX!,n,Dial(SIP/${EXTEN}@t38fax)
5. Configure your ATA to connect to Asterisk:
As an Example, to configure a Cisco SPA-112:
- 1. Follow the steps found here: Cisco SPA-112 Configuration Guide
- 2. Navigate to "Voice -> Line 1".
- 3. Enter your Asterisk Server's address/hostname in the "Proxy" field.
- 4. Enter the context you created in Step 2 in the "Display Name" and "User ID" fields. (Likely your T38Fax.com DID if you followed this guide).
- 5. Enter the password for the context you created in Step 3 in the "Password" Field.
- 6. Click Submit, and the SPA112 should reload it's configuration.
- 7. In the Asterisk CLI (asterisk -r) you should now be able to see the device register. Enter: sip show peer SIP_USERNAME (You'll want to look for "Status: OK" and "Addr -> IP" to show an IP address. Remember to replace SIP_USERNAME with your T38Fax.com DID!)
- T.38 Termination Support:
T.38 Termination Support
To integrate T38fax.com with Asterisk so that Asterisk itself is able to receive and send faxes directly, follow the steps below.
1. Sign up for a free trial here: Free Trial Signup
2. Prepare your system to handle FAX/TIFF messages.
Install Perl and other basic utilities:
CentOS 7.x/6.x:
# CentOS 7.x/6.x yum -y install perl cpan libyaml perl-YAML perl-Time-HiRes libwww-perl
Install tools to handle TIFF files:
CentOS 7.x:
# CentOS 7.x yum -y install libtiff-tools
CentOS 6.x:
# CentOS 6.x yum -y install libtiff libtiff-devel
3. Install support tools for mime-construct:
# Mime-Construct PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install Proc::WaitStat" PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install MIME::Types"
4. Install mime-construct utility for e-mailing processed fax images:
cd /usr/local/src wget http://search.cpan.org/CPAN/authors/id/R/RO/ROSCH/mime-construct-1.11.tar.gz tar xvfz mime-construct-1.11.tar.gz rm -rf mime-construct-1.11.tar.gz cd mime-construct-1.11 perl Makefile.PL make install
5. Install spandsp:
# Inst. SpanDSP cd /usr/local/src wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.6.tar.gz tar xvfz spandsp-0.0.6.tar.gz rm -rf spandsp-0.0.6.tar.gz cd spandsp-0.0.6 ./configure --prefix=/usr make make install
6. Check astmoddir (/usr/lib/asterisk/modules) for four modules: chan_sip.so, res_rtp_asterisk.so, res_fax.so, res_fax_spandsp.so
If you do not have all four of those modules, you must recompile asterisk. Here are the commands:
# Asterisk 11 cd /usr/local/src wget -O asterisk-11.cur.tar.gz https://hubs.ly/H0981kw0 tar xvfz asterisk-11.cur.tar.gz rm -rf asterisk-11.cur.tar.gz cd asterisk-11.* ./configure make menuselect # ensure the following four modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk # Resource Modules/res_fax # Resource Modules/res_fax_spandsp make install
7. Modify your sip.conf file (/etc/asterisk/sip.conf):
Add the following to the [general] section of your sip.conf file:
; sip.conf t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
Add a T38fax user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax qualify=yes qualifyfreq=300 defaultexpiry=600 insecure=port,invite host=sip.t38fax.com realm=sip.t38fax.com defaultuser=SIP_USERNAME secret=SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
8. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Add the following to the [globals] section:
[globals] VSA=/var/spool/asterisk [email protected]
Make sure you have a “exten => s” in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the call to the fax context. exten => s,n,Goto(fax,rx,1)
Create the [fax] context to send/receive faxes:
[fax] ; This is so Asterisk handles the fax as a t38 client. exten => rx,1,NoOp( ** RECEIVING FAX ** ) exten => rx,n,Answer exten => rx,n,StopPlaytones exten => rx,n,Set(FAXFILEBASE=${VSA}/fax/${CALLERID(num)}-${EPOCH}) exten => rx,n,Set(FAXFILE=${FAXFILEBASE}.tif) exten => rx,n,Wait(1) exten => rx,n,ReceiveFAX(${FAXFILE}) exten => tx,1,NoOp( ** SENDING FAX ** ) exten => tx,n,Wait(6) exten => tx,n,Set(FAXOPT(localstationid)=SIP_USERNAME) exten => tx,n,SendFAX(${VSA}/fax/channel-001.tiff,dfz) exten => h,1,Noop(FAX ${FAXOPT(status)} from ${CALLERID(all)}: ${FAXOPT(error)}) exten => h,n,System(/usr/local/script/fax2mail -p --cid-name ${CALLERID(name)} --cid-number ${CALLERID(num)} --dest-exten ${DNID} --dest-email ${FAXRCPT} -f ${FAXFILEBASE}) exten => h,n,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)}) exten => h,n,NoOp(FAXOPT(filename) : ${FAXOPT(filename)}) exten => h,n,NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)}) exten => h,n,NoOp(FAXOPT(localstationid) : ${FAXOPT(localstationid)}) exten => h,n,NoOp(FAXOPT(maxrate) : ${FAXOPT(maxrate)}) exten => h,n,NoOp(FAXOPT(minrate) : ${FAXOPT(minrate)}) exten => h,n,NoOp(FAXOPT(pages) : ${FAXOPT(pages)}) exten => h,n,NoOp(FAXOPT(rate) : ${FAXOPT(rate)}) exten => h,n,NoOp(FAXOPT(remotestationid) : ${FAXOPT(remotestationid)}) exten => h,n,NoOp(FAXOPT(resolution) : ${FAXOPT(resolution)}) exten => h,n,NoOp(FAXOPT(status) : ${FAXOPT(status)}) exten => h,n,NoOp(FAXOPT(statusstr) : ${FAXOPT(statusstr)}) exten => h,n,NoOp(FAXOPT(error) : ${FAXOPT(error)}) exten => _[it],1,Hangup()
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
9. Install fax2mail script to convert the raw fax image into a PDF file and email it:
mkdir -p /usr/local/script cd /usr/local/script wget -O fax2mail https://bitbucket.org/T38Guru/fax2mail/raw/78ea18ee5b1f9273e4062010750c8e08bd20770a/fax2mail chmod ugo+x fax2mail
10. Make the fax directory:
mkdir /var/spool/asterisk/fax
× infoPlease Note:
tiff (original source) files will accumulate in /var/spool/asterisk/fax Use cron or any other desired method to periodically remove these files.
- T.38 Passthrough Support:
- add_circle Asterisk 10 (Standard)
This was the first release that included T.38 Fax Gateway Support.
https://wiki.asterisk.org/wiki/display/AST/T.38+Fax+Gateway - add_circle Asterisk 1.8
- T.38 Passthrough Support:
T.38 Passthrough Support:
To integrate T38Fax.com with Asterisk to connect a fax machine to a T.38 capable ATA. This will allow a fax machine to send and receive calls via T38Fax.com with Asterisk in the middle.
1. Sign up for a free trial here: Free Trial Signup
2. Check astmoddir (/usr/lib/asterisk/modules) for two standard modules: chan_sip.so and res_rtp_asterisk.so.
If you do not have both modules, you must recompile asterisk. Here are the commands:
# Asterisk 1.8 cd /usr/src wget -O asterisk-1.8.cur.tar.gz https://hubs.ly/H0981pZ0 tar xvfz asterisk-1.8.cur.tar.gz rm -rf asterisk-1.8.cur.tar.gz cd asterisk-1.8.* ./configure make menuselect # Ensure that the following two modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk make install
3. Modify your sip.conf file (/etc/asterisk/sip.conf):
Add the following to the [general] section of your sip.conf file:
; sip.conf directmedia=no t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
Add a T38fax user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax qualify=yes defaultexpiry=600 insecure=port,invite host=sip.t38fax.com realm=sip.t38fax.com defaultuser=SIP_USERNAME secret=SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
Add a user definition for your ATA to register as. Add this after the [t38fax] definition in your sip.conf file:
[SIP_USERNAME] type=friend context=outboundT38Fax qualify=yes qualifyfreq=600 host=dynamic defaultexpiry=600 defaultuser=SIP_USERNAME callerid="John Doe" secret=ATA_SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account. Additionally, depending on your deployment & network topology, you may need to add nat=yes to both of the definitions above. Ask your Network Administrator if you are using NAT Traversal.
help SIP_USERNAME
help SIP_PASSWORD
help ATA_SIP_PASSWORD
Add the following to your udptl.conf file (/etc/asterisk/udptl.conf):
; udptl.conf udptlstart=10000 udptlend=10999 T38FaxUdpEC=t38UDPRedundancy
4. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Make sure you have a "exten => s" in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the incoming call to the SIP user. Duplicate ; this line for as many DIDs that you wish to configure. exten => DIDX1,1,Dial(SIP/DIDX1) ; If you have more than one DID, you can add additional definitions ; to route them as well: exten => DIDX2,1,Dial(SIP/DIDX2)
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help DIDX1
help DIDX2
Create your [outboundT38Fax] context:
[outboundT38Fax] ; Add support for 11 digit dialing (adds the leading 1). exten => _1NXXNXXXXXX!,1,NoOp(caught 11 digits ${EXTEN}) exten => _1NXXNXXXXXX!,n,Dial(SIP/${EXTEN}@t38fax)
5. Configure your ATA to connect to Asterisk:
As an Example, to configure a Cisco SPA-112:
- 1. Follow the steps found here: Cisco SPA-112 Configuration Guide
- 2. Navigate to "Voice -> Line 1".
- 3. Enter your Asterisk Server's address/hostname in the "Proxy" field.
- 4. Enter the context you created in Step 2 in the "Display Name" and "User ID" fields. (Likely your T38Fax.com DID if you followed this guide).
- 5. Enter the password for the context you created in Step 3 in the "Password" Field.
- 6. Click Submit, and the SPA112 should reload it's configuration.
- 7. In the Asterisk CLI (asterisk -r) you should now be able to see the device register. Enter: sip show peer SIP_USERNAME (You'll want to look for "Status: OK" and "Addr -> IP" to show an IP address. Remember to replace SIP_USERNAME with your T38Fax.com DID!)
- T.38 Termination Support:
T.38 Termination Support
To integrate T38fax.com with Asterisk so that Asterisk itself is able to receive and send faxes directly, follow the steps below.
1. Sign up for a free trial here: Free Trial Signup
2. Prepare your system to handle FAX/TIFF messages.
Install Perl and other basic utilities:
CentOS 7.x/6.x:
# CentOS 7.x/6.x yum -y install perl cpan libyaml perl-YAML perl-Time-HiRes libwww-perl
Install tools to handle TIFF files:
CentOS 7.x:
# CentOS 7.x yum -y install libtiff-tools
CentOS 6.x:
# CentOS 6.x yum -y install libtiff
3. Install support tools for mime-construct:
# Mime-Construct PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install Proc::WaitStat" PERL_MM_USE_DEFAULT=1 perl -MCPAN -e "install MIME::Types"
4. Install mime-construct utility for e-mailing processed fax images:
cd /usr/local/src wget http://search.cpan.org/CPAN/authors/id/R/RO/ROSCH/mime-construct-1.11.tar.gz tar xvfz mime-construct-1.11.tar.gz rm -rf mime-construct-1.11.tar.gz cd mime-construct-1.11 perl Makefile.PL make install
5. Install spandsp:
# SpanDSP cd /usr/src wget http://www.soft-switch.org/downloads/spandsp/spandsp-0.0.6.tar.gz tar xvfz spandsp-0.0.6.tar.gz rm -rf spandsp-0.0.6.tar.gz cd spandsp-0.0.6 ./configure --prefix=/usr make make install
6. Check astmoddir (/usr/lib/asterisk/modules) for four modules: chan_sip.so, res_rtp_asterisk.so, res_fax.so, res_fax_spandsp.so
If you do not have all four of those modules, you must recompile asterisk. Here are the commands:
# Asterisk 1.8 cd /usr/src wget -O asterisk-1.8.cur.tar.gz https://hubs.ly/H0981pZ0 tar xvfz asterisk-1.8.cur.tar.gz rm -rf asterisk-1.8.cur.tar.gz cd asterisk-1.8.* ./configure make menuselect # Ensure the following four modules are enabled [*] # Channel Drivers/chan_sip # Resource Modules/res_rtp_asterisk # Resource Modules/res_fax # Resource Modules/res_fax_spandsp make install
7. Modify your sip.conf file (/etc/asterisk/sip.conf):
Add the following to the [general] section of your sip.conf file:
; sip.conf t38pt_udptl=yes,redundancy register=SIP_USERNAME:[email protected]/SIP_USERNAME
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
Add a T38fax user definition to the bottom of your sip.conf file as follows:
[t38fax] type=peer context=inboundT38Fax qualify=yes qualifyfreq=30 insecure=port,invite defaultexpiry=300 host=sip.t38fax.com realm=sip.t38fax.com defaultuser=SIP_USERNAME secret=SIP_PASSWORD
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
8. Modify/Create your extensions.conf file (/etc/asterisk/extensions.conf):
Add the following to the [globals] section:
[globals] VSA=/var/spool/asterisk [email protected]
Make sure you have a “exten => s” in your [default] context. This allows for proper replies to T38fax SIP monitoring.
[default] ; This ensures we reply 200 OK to OPTIONS messages. exten => s,1,NoOp( got in default/S )
Create your [inboundT38Fax] context:
[inboundT38Fax] ; The following sends the call to the fax context. exten => s,n,Goto(fax,rx,1)
Create the [fax] context to send/receive faxes:
[fax] ; For Asterisk to handle a Fax as a T.38 client. exten => rx,1,NoOp( ** RECEIVING FAX ** ) exten => rx,n,Answer exten => rx,n,StopPlaytones exten => rx,n,Set(FAXFILEBASE=${VSA}/fax/${CALLERID(num)}-${EPOCH}) exten => rx,n,Set(FAXFILE=${FAXFILEBASE}.tif) exten => rx,n,Wait(1) exten => rx,n,ReceiveFAX(${FAXFILE}) exten => tx,1,NoOp( ** SENDING FAX ** ) exten => tx,n,Wait(6) exten => tx,n,Set(FAXOPT(localstationid)=SIP_USERNAME) exten => tx,n,SendFAX(${VSA}/fax/channel-001.tiff,dfz) exten => h,1,Noop(FAX ${FAXOPT(status)} from ${CALLERID(all)}: ${FAXOPT(error)}) exten => h,n,System(/usr/local/script/fax2mail -p --cid-name ${CALLERID(name)} --cid-number ${CALLERID(num)} --dest-exten ${DNID} --dest-email ${FAXRCPT} -f ${FAXFILEBASE}) exten => h,n,NoOp(FAXOPT(ecm) : ${FAXOPT(ecm)}) exten => h,n,NoOp(FAXOPT(filename) : ${FAXOPT(filename)}) exten => h,n,NoOp(FAXOPT(headerinfo) : ${FAXOPT(headerinfo)}) exten => h,n,NoOp(FAXOPT(localstationid) : ${FAXOPT(localstationid)}) exten => h,n,NoOp(FAXOPT(maxrate) : ${FAXOPT(maxrate)}) exten => h,n,NoOp(FAXOPT(minrate) : ${FAXOPT(minrate)}) exten => h,n,NoOp(FAXOPT(pages) : ${FAXOPT(pages)}) exten => h,n,NoOp(FAXOPT(rate) : ${FAXOPT(rate)}) exten => h,n,NoOp(FAXOPT(remotestationid) : ${FAXOPT(remotestationid)}) exten => h,n,NoOp(FAXOPT(resolution) : ${FAXOPT(resolution)}) exten => h,n,NoOp(FAXOPT(status) : ${FAXOPT(status)}) exten => h,n,NoOp(FAXOPT(statusstr) : ${FAXOPT(statusstr)}) exten => h,n,NoOp(FAXOPT(error) : ${FAXOPT(error)}) exten => _[it],1,Hangup()
× infoPlease Note:
Please ensure that you've replaced the following "generic" values with the associated account information for your T38Fax.com account.
help SIP_USERNAME
help SIP_PASSWORD
9. Install fax2mail script to convert the raw fax image into a PDF file and email it:
mkdir -p /usr/local/script cd /usr/local/script wget -O fax2mail https://bitbucket.org/T38Guru/fax2mail/raw/78ea18ee5b1f9273e4062010750c8e08bd20770a/fax2mail chmod ugo+x fax2mail
10. Make the fax directory:
mkdir /var/spool/asterisk/fax
× infoPlease Note:
tiff (original source) files will accumulate in /var/spool/asterisk/fax Use cron or any other desired method to periodically remove these files.
- T.38 Passthrough Support:
- add_circle Asterisk 1.6
T.38 Passthrough & T.38 Termination (receives faxes via ReceiveFax)
- add_circle Asterisk 1.4
T.38 Passthrough Only. T.38 Passthrough allows Asterisk to carry T.38 UDPTL from one T.38-speaking endpoint to another T.38-speaking endpoint. Asterisk does not modify the media.
- add_circle Asterisk 1.2
No T.38 capability at all.
Why 5080? Learn More
Enter your SIP Username here. (This should be a DID assigned to your account that is available for registration. IE: 18043027000)
Still Confused? Learn More!
Enter the SIP Password for the SIP Username you entered above.
Still Confused? Learn More!
Create & Enter a username for your ATA (Extension Number).
Still Confused? Learn More!
Create & Enter a new, secure password for your ATA.
Still Confused? Learn More!
Enter your first DID here. Ensure that the "Dial/DIDX1" string points to the correct context.
Enter your second DID here. Ensure that the "Dial/DIDX2" string points to the correct context.