Hello Nikolaj,
you should do the following:
mark the VoIP packets with IP precedence 5 using a policy-map applied inbound to the LAN interface
on the ATM interface you can apply a service-policy outbound that provides an LLQ for packets with IP precedence 5.
A better setup for the ATM interface is that of using a two levels policy:
the parent policy-map shape all traffic just below the line rate.
a child policy implements LLQ and CBWFQ for traffic
access-list 111 permit udp lan-subnet lan-wildcard any range 16635 16635
class voip_inbound
match access-group 111
policy-map mark_voip
class voip_inbound
set ip prec 5
policy-map shape_all_traffic
class default
shape peak 2000000 (*)
service-policy out llq-cbwfq
class voice_outbound
match ip prec 5
policy-map llq-cbwfq
class voice_outbound
priority 256 (*)
class class-default
fair-queue
int atm0
service-policy out shape_all_traffic
(*) rates are only placeholders you need to identify the right values for your case
This works also if it is GRE over IPsec and it is based on the fact that the TOS of carried packet is copied to the external header
the command qos-preclassify can help too.
Hope to help
Giuseppe