Hi guys.
I've a scenario here where I'm receiving inbound traffic from a Mitel PBX on a LAN environment with a bunch of router hops between kamailio and the Mitel. Sometimes, not always, I get traffic from the MItel PBX where the source port is changed in transit (some kind of NAT, still don't know where exactly) from 5060 to a dynamic port different from 5060. Every INVITE comes with rport in via header as:
.. Via: SIP/2.0/UDP 10.21.252.35:5060 ;branch=z9hG4bK-524287-1---d6bac01809527627*;rport* ..
when this happens kamailio sends all the replies to the $si:$sp symmetrically (force_rport behavior) and I would like to force the opposite instead, making it asymmetric and sending the traffic to $si:5060 everytime.
I'm having a hard time forcing the *unforce*_rport() behavior. Does anyone have a good suggestion for this? Looking forward to hear from you.
Cheers,
-- Nuno Miguel Reis Departamento de Engenharia Informática Faculdade de Ciências e Tecnologia Universidade de Coimbra
Hi again.
While experimenting a bit here, I ended up using this kind of dirty trick:
... remove_hf_value("Via[-1].rport"); msg_apply_changes(); ...
but I still find it useful having something like unforce_rport() or ignore_rport() to be available just to trigger the ignore 'rport' param if present in Via header. Looking forward to hear from you all.
Cheers, -- Nuno Miguel Reis Departamento de Engenharia Informática Faculdade de Ciências e Tecnologia Universidade de Coimbra
On Sat, Dec 11, 2021 at 4:04 AM Nuno Miguel Reis nmreis@student.dei.uc.pt wrote:
Hi guys.
I've a scenario here where I'm receiving inbound traffic from a Mitel PBX on a LAN environment with a bunch of router hops between kamailio and the Mitel. Sometimes, not always, I get traffic from the MItel PBX where the source port is changed in transit (some kind of NAT, still don't know where exactly) from 5060 to a dynamic port different from 5060. Every INVITE comes with rport in via header as:
.. Via: SIP/2.0/UDP 10.21.252.35:5060 ;branch=z9hG4bK-524287-1---d6bac01809527627*;rport* ..
when this happens kamailio sends all the replies to the $si:$sp symmetrically (force_rport behavior) and I would like to force the opposite instead, making it asymmetric and sending the traffic to $si:5060 everytime.
I'm having a hard time forcing the *unforce*_rport() behavior. Does anyone have a good suggestion for this? Looking forward to hear from you.
Cheers,
-- Nuno Miguel Reis Departamento de Engenharia Informática Faculdade de Ciências e Tecnologia Universidade de Coimbra