[SR-Users] Routing logic and record-routing

DURECU, OLIVIER (OLIVIER) olivier.durecu at alcatel-lucent.com
Wed Jun 11 12:48:00 CEST 2014


Hello all,

There is something I can't understand using Kamailio as proxy to route SUBSCRIBE/NOTIFY dialogs between a client and a server

I do record_route() on the first SUBSCRIBE received by Kamailio
The next SUBSCRIBE is well handled by Kamailio in the [WITHIN_DIALOG] bloc but the 200/OK no more contains record-route header
So the 3rd SUBSCRIBE no more sets a relevant route and Kamailio rejets it with a 404 ?

How to proceed so that 200/Ok within dialog still contains Record-route header ?


Here are the piece of routing logic involved

        if (is_method("PUBLISH|SUBSCRIBE")) {
                record_route();
  $ru = "sip:192.168.0.250:6070";
  route(RELAY);
  exit;
      }

And the as-is route[WITHINDLG] function

route[WITHINDLG] {
        if (has_totag()) {
                # sequential request withing a dialog should
                # take the path determined by record-routing
                if (loose_route()) {
#!ifdef WITH_WEBSOCKETS
                        if ($du == "") {
                                if (!handle_ruri_alias()) {
                                        xlog("L_ERR", "Bad alias <$ru>\n");
                                        sl_send_reply("400", "Bad Request");
                                        exit;
                                }
                        }
#!endif
                        route(RELAY);
                }

Thanks for your help

Olivier


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20140611/35a2ad9a/attachment.html>


More information about the sr-users mailing list