Setting DSCP (ToS) bits on your voice packets

Found this on freepbx.org (Setting DSCP (ToS) bits on your voice packets ) to prioritise your VOIP packets.

Provided you are running Asterisk/Trixbox with 'standard' ports - otherwise alter applicable, insert following into your startup (/etc/rc.d/rc.local or the like:
/sbin/iptables -A OUTPUT -t mangle -p udp -m udp --sport 4569 -j DSCP --set-dscp-class ef 
/sbin/iptables -A OUTPUT -t mangle -p udp -m udp --sport 10000:20000 -j DSCP --set-dscp-class ef
/sbin/iptables -A OUTPUT -t mangle -p udp -m udp --sport 5060 -j DSCP --set-dscp-class ef

Incoming Fax Server

I found this great set of instructions on setting up an incoming fax server (via an IVR) for Trixbox:


Fax Server

My example will focus to a single extension, from here you can create your own.

Ext 101 -

This email address is being protected from spambots. You need JavaScript enabled to view it.

1. Create your call flow for the IVR. You must have a sequence on the call flow where an option to send fax.
2. On that IVR, put the ext # (101) on the digits menu then enter custom context to the Custom App (ex. custom-fax101,101,1).
Uncheck Enable Direct Dial on IVR menu
3. Create a custom context in extensions_customs.conf
to make it easy, here is an example:

[custom-fax101]
exten => 101,1,Answer
exten => 101,2,Goto(in_fax1,1)
exten => in_fax1,1,StopPlayTones
exten => in_fax1,2,GotoIf($["${FAX_RX}" = "system"]?3:analog_fax,1)
exten => in_fax1,3,Macro(faxreceive)
exten => in_fax1,4,system(/var/lib/asterisk/bin/fax-process.pl --to

This email address is being protected from spambots. You need JavaScript enabled to view it.

--from ${FAX_RX_FROM} --subject "Fax Received ${CALLERID(number)} ${CALLERID(name)}" --attachment ${CALLERID(number)}fax.pdf --type application/pdf --file ${FAXFILE});
exten => in_fax1,5,Hangup
exten => analog_fax,1,GotoIf($["${FAX_RX}" = "disabled"]?4:2) ;if fax is disabled, just hang up
exten => analog_fax,2,Set(DIAL=${DB(DEVICE/${FAX_RX}/dial)});
exten => analog_fax,3,Dial(${DIAL},20,d)
exten => analog_fax,4,Hangup

*this is my own set-up, you must look-up to the field with my defined extension & email address (101 &

This email address is being protected from spambots. You need JavaScript enabled to view it.

)
You can also do some adjustments in sendmail if you have another email server, but by default trixbox will just send the fax in pdf to the specified email. (You must have an internet access)

4. On the General Settings (freepbx), leave blank on the email address to have faxes emailed to & create an email address (mine is

This email address is being protected from spambots. You need JavaScript enabled to view it.

) to the field faxes appear to come from. This can be non existing email address.
5. On Inbound routes (freepbx), select system to Fax Extension, then your general email add to the Fax email. This is where your common fax messages will be sent, assuming all inbound fax must be forwarded to as emails.

Now, if somebody calls-in & the IVR is set to handle the call, then he has an option to call my extension or send a fax to me. He can also send fax to our general email address.
Keep in mind that if somebody will send you fax using PC/modem/auto fax, this will be automatically routed to the general email for receiving fax.
I hope everything is clear, with just some experiments you can built your own inbound fax server.