[SR-Users] Modify DMQ 200OK in on_reply route

Julien Chavanton jchavanton at gmail.com
Mon Jun 17 21:07:08 CEST 2019


Did you set them to the public IP address (elastic IP or whatever) on each
of them.

Since you are natted, I guess you are using the listen=udp x.x.x.x
advertise x.x.x.x
parameter.

similar IP preset is needed in this case.

On Mon, Jun 17, 2019 at 12:00 PM Julien Chavanton <jchavanton at gmail.com>
wrote:

> Can you share the settings you are using :
>
> modparam("dmq", "server_address", "?")
> modparam("dmq", "notification_address", "?")
>
> On Mon, Jun 17, 2019 at 11:30 AM <jenus at cyberchaos.nl> wrote:
>
>> Hi all,
>>
>> Is there any other way to filter DMQ peers? I now have a issue with
>> dmq_usrloc when running in a docker container. When the node comes
>> online the peer is sending the KDMQ usrloc packet (with the registered
>> contacts) to the internal container ip and not the actual external ip.
>> Both ip's show up as DMQ peers, after a few keepalive failures the dmq
>> peer with the internal container ip becomes inactive and no updates are
>> sent to that peer. But the usrloc sync seems to happen before the peer
>> is inactive.
>>
>> I tried to strip the peers with the internal container ip's, this works
>> for the requests, but i'm not able to fix this for the responses.
>>
>> Thanks,
>>
>> Jan
>>
>> jenus at cyberchaos.nl schreef op 2019-05-02 08:59:
>> > Hi all,
>> >
>> > I'm trying to run a kamailio DMQ node inside a docker container. All
>> > works fine but i have one issue with DMQ. Since the kamailio process
>> > inside the container is behind a nat i have set the advertise address
>> > to the external ip, this works fine for the via headers but DMQ keeps
>> > sending the internal interface in the KDMQ notification_peer messages.
>> > The external ip is in there as well. Example:
>> >
>> > SIP/2.0 200 OK
>> > Via: SIP/2.0/UDP
>> > 10.10.10.13;branch=z9hG4bK2dcb.c6326de2000000000000000000000000.0
>> > To:
>> > <sip:notification_peer at 10.10.10.94:5060
>> >;tag=616b7acb681ed5e9cbc485b3faa09d62.0a3d
>> > From:
>> > <sip:notification_peer at 10.10.10.13:5060
>> >;tag=e8f29c06c4b85a188f6533f08d60feb6-ff29
>> > CSeq: 10 KDMQ
>> > Call-ID: 17042656602ca532-23367 at x.x.x.x
>> > Content-Type: text/plain
>> > Server: kamailio (5.1.4 (x86_64/linux))
>> > Content-Length: 222
>> >
>> > sip:10.10.10.13:5060;status=active
>> > sip:10.10.10.12:5060;status=active
>> > sip:10.10.10.92:5060;status=active
>> > sip:10.10.10.93:5060;status=active
>> > sip:10.10.10.94:5060;status=active   <-- entry for container external
>> > ip
>> > sip:172.17.0.2:5060;status=disabled  <-- entry for container internal
>> > ip
>> >
>> >
>> > I tried to strip this entry using the replace_body_atonce in the
>> > tm:local-request route. This works fine for the KDMQ request, but when
>> > i try to remove the same line from 200OK responses that are send out
>> > as a response to incomming KDMQ messages this seems to fail. I use the
>> > following code:
>> >
>> > # Working code (for outgoing KDMQ requests):
>> > event_route [tm:local-request]
>> > {
>> >   if(is_method("KDMQ") && $rU == "notification_peer")
>> >         replace_body_atonce("sip:172.17.0.*:5060;status=.*", "");
>> > }
>> >
>> > # Failing code (for 200OK responses):
>> > reply_route
>> > {
>> >   xlog("L_ALERT", "REPLY: Sending out reply, tU is $tU  rs is $rs\n");
>> >   if ($rs == "200" && $tU == "notification_peer")
>> >   {
>> >         replace_body_atonce("sip:172.17.0.*:5060;status=.*", "");
>> >   }
>> > }
>> >
>> >
>> > I'm running kamailio 5.1.4. Is there a way to strip a line from the
>> > body of a local generated 200OK response? Or is there a way to avoid
>> > that DMQ inserts the internal container ip in the first place.
>> >
>> >
>> > Thanks,
>> >
>> > Jan Hazenberg
>> >
>> >
>> > _______________________________________________
>> > Kamailio (SER) - Users Mailing List
>> > sr-users at lists.kamailio.org
>> > https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>> _______________________________________________
>> Kamailio (SER) - Users Mailing List
>> sr-users at lists.kamailio.org
>> https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users
>>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-users/attachments/20190617/a70706e6/attachment.html>


More information about the sr-users mailing list