help for voip

pls help me , i am confuse with all different configuration i seeing on d forum i want to configure a transparent traffic shaper that will just priorities traffic to voice equipment so that the traffic going to the equipment is always guarantee over other ip , any help for the right configuration i have not start anything yet i am using 2.9.29 note the voice is configured with public ipaddress
bdek

Mangle is used to distinguish different type of traffic and create priorities in MikroTik RouterOS.
There are not special matchers dedicated exactly to the VoIP traffic, but you are able to use very different matchers for traffic prioritizing. Some bandwidth management examples are given in the Wiki pages,
http://wiki.mikrotik.com/wiki/Bandwidth_Managment_and_Queues
Information about mangle matchers is given in documentation.

Try something similar to these\

/ip firewall mangle add chain=prerouting tos=184
action=mark-packet new-packet-mark=voip

/ip firewall mangle
add chain=prerouting src-address=x.x.x.6 action=mark-connection
new-connection-mark=voip passthrough=yes comment=“” disabled=no
add chain=prerouting dst-address=x.x.x.6 action=mark-connection
new-connection-mark=voip passthrough=yes comment=“” disabled=no
add chain=prerouting connection-mark=voip action=mark-packet
new-packet-mark=voip passthrough=no comment=“” disabled=no


where x.x.x.6 is say the address of your internal Asterisk box, or VOIP
manager. Then add a custom queue tree for the marked packets

/queue tree add name=“voip” parent=global-in packet-mark=voip
limit-at=0 queue=default priority=1 max-limit=0 burst-limit=0
burst-threshold=0 burst-time=0s


You need to know some of the VOIP TOS/DSCP variables.
such as for Cisco etc With Asterisk change its TOS variable in sip.conf
to 0xb8

EF DiffServ decimal: 184
EF DiffServ hexadecimal: 0xb8
EF DiffServ binary: 10111000

EF DSCP decimal: 46
EF DSCP hexadecimal: 0x2e
EF DSCP binary: 101110

The DSCP field is contained within the 6 first bits of the DiffServ byte.

But many manufacturers use different values.

If any doubt, use a sniffer such as Ethereal. If settings are correct, it will show the Differentiated Services Field in any of the RTP packets, whith a value of 0xb8 (DSCP 0x2e: Expedited Forwarding: ECN: 0x00).

Then run some voice calls to see if your traffic counts increment in the
mangle rules and queue.