<p>Hello Daniel,</p>
<p>Here's the requested info, unedited.</p>
<p>Kamailio's config:</p>
<p>(I added that <code>if($du==$null){</code> because when $du it's not set kamailio just sends it to itself creating a loop)</p>
<pre><code>route[DISPATCH] {
#!ifdef WITH_DISPATCHER

    dp_match("1", "$ru");

    if(ds_select_routes("1=10;11=9", "d", "0"))
    {
        xlog("L_ERR", "[DISPATCH] $ci: ds_select_routes was succesful (ruri: $ru - du: <$du> xavp_dsdst: <$xavp(_dsdst_=>attr)>)\n");
        pv_xavp_print();
        if($du==$null){
            send_reply("404", "No destination - failed");
            exit;
        }
    } else {
        xlog("L_ERR", "[DISPATCH] $ci: did NOT find a gateway to use!\n");
        send_reply("404", "No destination");
        exit;
    }
    xlog("L_DBG", "[DISPATCH] $ci: going to <$ru> via <$du>\n");
    t_on_failure("RTF_DISPATCH");
    route(RELAY);
    exit;
}
</code></pre>
<p>rpc command output:</p>
<pre><code>kamctl rpc dispatcher.list
{
  "jsonrpc":  "2.0",
  "result": {
    "NRSETS": 5,
    "RECORDS":  [{
        "SET":  {
          "ID": 1,
          "TARGETS":  [{
              "DEST": {
                "URI":  "sip:54.209.229.198:5080",
                "FLAGS":  "AP",
                "PRIORITY": 0,
                "ATTRS":  {
                  "BODY": "weight=100;maxload=2;duid=cuore_2",
                  "DUID": "cuore_2",
                  "MAXLOAD":  2,
                  "WEIGHT": 100,
                  "RWEIGHT":  0,
                  "SOCKET": ""
                },
                "RUNTIME":  {
                  "DLGLOAD":  0
                }
              }
            }, {
              "DEST": {
                "URI":  "sip:34.201.28.49:5080",
                "FLAGS":  "AP",
                "PRIORITY": 0,
                "ATTRS":  {
                  "BODY": "weight=100;maxload=2;duid=cuore_1",
                  "DUID": "cuore_1",
                  "MAXLOAD":  2,
                  "WEIGHT": 100,
                  "RWEIGHT":  0,
                  "SOCKET": ""
                },
                "RUNTIME":  {
                  "DLGLOAD":  0
                }
              }
            }]
        }
      }, {
        "SET":  {
          "ID": 11,
          "TARGETS":  [{
              "DEST": {
                "URI":  "sip:35.170.67.206:5080",
                "FLAGS":  "AP",
                "PRIORITY": 0,
                "ATTRS":  {
                  "BODY": "weight=100;maxload=2;duid=cuore_3",
                  "DUID": "cuore_3",
                  "MAXLOAD":  2,
                  "WEIGHT": 100,
                  "RWEIGHT":  0,
                  "SOCKET": ""
                },
                "RUNTIME":  {
                  "DLGLOAD":  0
                }
              }
            }]
        }
      }]
  },
  "id": 9046
}
</code></pre>
<p>Scenario:</p>
<p>I'm sending exactly 5 calls to kamailio, it should do the following according to the config:</p>
<ul>
<li>call 1: Send to setid 1 node A (maxload=2)</li>
<li>call 2: Send to setid 1 node B (maxload=2)</li>
<li>call 3: Send to setid 1 node A (maxload=2)</li>
<li>call 4: Send to setid 1 node B (maxload=2)</li>
<li>call 5: Send to setid 11 node A</li>
</ul>
<p>The logs:</p>
<p>I'm pasting the logs for call 4 (in which the destination is set properly on $du) and call 5 where $du is not set:</p>
<p>Call 4:</p>
<pre><code>ERROR: <script>: [DISPATCH] 4-7723@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <sip:34.201.28.49:5080> xavp_dsdst: <<null>>)
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1070 a=24 n=pv_xavp_print
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441b4358 ((nil)) (level=0)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d441b4358) XAVP name: _dsctx_
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427193258
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6
INFO: <core> [core/xavp.c:571]: xavp_print_list_content():      XAVP value: <xavp:0x7f1d441b42b0>
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441b42b0 (0x7f1d441b4378) (level=1)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b42b0) XAVP name: cnt
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7279890
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1
INFO: <core> [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 2
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b42b0) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441b42b0 (level=1)
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d441b4358) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d441c0cf0) XAVP name: _dsdst_
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427333496
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6
INFO: <core> [core/xavp.c:571]: xavp_print_list_content():      XAVP value: <xavp:0x7f1d441ec258>
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441ec258 (0x7f1d441c0d10) (level=1)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ec258) XAVP name: dstid
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1762493352
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): cuore_1
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ec258) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b4650) XAVP name: attrs
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1835799177
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): weight=100;maxload=2;duid=cuore_1
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b4650) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441edb50) XAVP name: grp
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7056653
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1
INFO: <core> [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 1
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441edb50) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44202b88) XAVP name: uri
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 8122237
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): sip:34.201.28.49:5080
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44202b88) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441ec258 (level=1)
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d441c0cf0) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d441bcbb0) XAVP name: _dsdst_
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427333496
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6
INFO: <core> [core/xavp.c:571]: xavp_print_list_content():      XAVP value: <xavp:0x7f1d441ebed8>
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441ebed8 (0x7f1d441bcbd0) (level=1)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ebed8) XAVP name: attrs
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1835799177
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): weight=100;maxload=2;duid=cuore_3
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ebed8) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441bcb08) XAVP name: grp
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7056653
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1
INFO: <core> [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 11
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441bcb08) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441f08a8) XAVP name: uri
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 8122237
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): sip:35.170.67.206:5080
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441f08a8) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441ebed8 (level=1)
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d441bcbb0) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441b4358 (level=0)
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1075 a=16 n=if
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1080 a=26 n=xlog
DEBUG: <script>: [DISPATCH] 4-7723@192.168.1.201: going to <sip:*TESTCALL@cuore-proxy.sandbox-sngl.com> via <sip:34.201.28.49:5080>
</code></pre>
<p>Call 5</p>
<pre><code>ERROR: <script>: [DISPATCH] 5-7723@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <<null>> xavp_dsdst: <<null>>)
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1070 a=24 n=pv_xavp_print
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d44226d88 ((nil)) (level=0)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226d88) XAVP name: _dsctx_
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427193258
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6
INFO: <core> [core/xavp.c:571]: xavp_print_list_content():      XAVP value: <xavp:0x7f1d44226ce0>
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d44226ce0 (0x7f1d44226da8) (level=1)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ce0) XAVP name: cnt
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7279890
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1
INFO: <core> [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 1
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ce0) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d44226ce0 (level=1)
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226d88) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226c38) XAVP name: _dsdst_
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427333496
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6
INFO: <core> [core/xavp.c:571]: xavp_print_list_content():      XAVP value: <xavp:0x7f1d44226b70>
INFO: <core> [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d44226b70 (0x7f1d44226c58) (level=1)
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226b70) XAVP name: attrs
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1835799177
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): weight=100;maxload=2;duid=cuore_3
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226b70) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ac8) XAVP name: grp
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7056653
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1
INFO: <core> [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 11
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ac8) end
INFO: <core> [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226a08) XAVP name: uri
INFO: <core> [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 8122237
INFO: <core> [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2
INFO: <core> [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): sip:35.170.67.206:5080
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226a08) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d44226b70 (level=1)
INFO: <core> [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226c38) end
INFO: <core> [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d44226d88 (level=0)
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1075 a=16 n=if
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1072 a=26 n=send_reply
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1073 a=2 n=exit
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1062 a=26 n=dp_match
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1079 a=16 n=if
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1064 a=27 n=ds_select_routes
exec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1069 a=26 n=xlog
ERROR: <script>: [DISPATCH] 6-7723@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: <<null>> xavp_dsdst: <<null>>)
</code></pre>

<p style="font-size:small;-webkit-text-size-adjust:none;color:#666;">—<br />You are receiving this because you commented.<br />Reply to this email directly, <a href="https://github.com/kamailio/kamailio/issues/1728#issuecomment-440738611">view it on GitHub</a>, or <a href="https://github.com/notifications/unsubscribe-auth/AF36ZVBfx2rQZEfMC0xPQqQW1BMFYXkJks5uxYZkgaJpZM4YnO9T">mute the thread</a>.<img src="https://github.com/notifications/beacon/AF36ZdhuVPm1pnrUOm6ejAkAVbyd4Rq1ks5uxYZkgaJpZM4YnO9T.gif" height="1" width="1" alt="" /></p>
<script type="application/json" data-scope="inboxmarkup">{"api_version":"1.0","publisher":{"api_key":"05dde50f1d1a384dd78767c55493e4bb","name":"GitHub"},"entity":{"external_key":"github/kamailio/kamailio","title":"kamailio/kamailio","subtitle":"GitHub repository","main_image_url":"https://assets-cdn.github.com/images/email/message_cards/header.png","avatar_image_url":"https://assets-cdn.github.com/images/email/message_cards/avatar.png","action":{"name":"Open in GitHub","url":"https://github.com/kamailio/kamailio"}},"updates":{"snippets":[{"icon":"PERSON","message":"@davidcsi in #1728: Hello Daniel,\r\n\r\nHere's the requested info, unedited.\r\n\r\nKamailio's config:\r\n\r\n(I added that `if($du==$null){` because when $du it's not set kamailio just sends it to itself creating a loop)\r\n```\r\nroute[DISPATCH] {\r\n#!ifdef WITH_DISPATCHER\r\n\r\n    dp_match(\"1\", \"$ru\");\r\n\r\n    if(ds_select_routes(\"1=10;11=9\", \"d\", \"0\"))\r\n    {\r\n        xlog(\"L_ERR\", \"[DISPATCH] $ci: ds_select_routes was succesful (ruri: $ru - du: \u003c$du\u003e xavp_dsdst: \u003c$xavp(_dsdst_=\u003eattr)\u003e)\\n\");\r\n        pv_xavp_print();\r\n        if($du==$null){\r\n            send_reply(\"404\", \"No destination - failed\");\r\n            exit;\r\n        }\r\n    } else {\r\n        xlog(\"L_ERR\", \"[DISPATCH] $ci: did NOT find a gateway to use!\\n\");\r\n        send_reply(\"404\", \"No destination\");\r\n        exit;\r\n    }\r\n    xlog(\"L_DBG\", \"[DISPATCH] $ci: going to \u003c$ru\u003e via \u003c$du\u003e\\n\");\r\n    t_on_failure(\"RTF_DISPATCH\");\r\n    route(RELAY);\r\n    exit;\r\n}\r\n```\r\n\r\nrpc command output:\r\n```\r\nkamctl rpc dispatcher.list\r\n{\r\n  \"jsonrpc\":  \"2.0\",\r\n  \"result\": {\r\n    \"NRSETS\": 5,\r\n    \"RECORDS\":  [{\r\n        \"SET\":  {\r\n          \"ID\": 1,\r\n          \"TARGETS\":  [{\r\n              \"DEST\": {\r\n                \"URI\":  \"sip:54.209.229.198:5080\",\r\n                \"FLAGS\":  \"AP\",\r\n                \"PRIORITY\": 0,\r\n                \"ATTRS\":  {\r\n                  \"BODY\": \"weight=100;maxload=2;duid=cuore_2\",\r\n                  \"DUID\": \"cuore_2\",\r\n                  \"MAXLOAD\":  2,\r\n                  \"WEIGHT\": 100,\r\n                  \"RWEIGHT\":  0,\r\n                  \"SOCKET\": \"\"\r\n                },\r\n                \"RUNTIME\":  {\r\n                  \"DLGLOAD\":  0\r\n                }\r\n              }\r\n            }, {\r\n              \"DEST\": {\r\n                \"URI\":  \"sip:34.201.28.49:5080\",\r\n                \"FLAGS\":  \"AP\",\r\n                \"PRIORITY\": 0,\r\n                \"ATTRS\":  {\r\n                  \"BODY\": \"weight=100;maxload=2;duid=cuore_1\",\r\n                  \"DUID\": \"cuore_1\",\r\n                  \"MAXLOAD\":  2,\r\n                  \"WEIGHT\": 100,\r\n                  \"RWEIGHT\":  0,\r\n                  \"SOCKET\": \"\"\r\n                },\r\n                \"RUNTIME\":  {\r\n                  \"DLGLOAD\":  0\r\n                }\r\n              }\r\n            }]\r\n        }\r\n      }, {\r\n        \"SET\":  {\r\n          \"ID\": 11,\r\n          \"TARGETS\":  [{\r\n              \"DEST\": {\r\n                \"URI\":  \"sip:35.170.67.206:5080\",\r\n                \"FLAGS\":  \"AP\",\r\n                \"PRIORITY\": 0,\r\n                \"ATTRS\":  {\r\n                  \"BODY\": \"weight=100;maxload=2;duid=cuore_3\",\r\n                  \"DUID\": \"cuore_3\",\r\n                  \"MAXLOAD\":  2,\r\n                  \"WEIGHT\": 100,\r\n                  \"RWEIGHT\":  0,\r\n                  \"SOCKET\": \"\"\r\n                },\r\n                \"RUNTIME\":  {\r\n                  \"DLGLOAD\":  0\r\n                }\r\n              }\r\n            }]\r\n        }\r\n      }]\r\n  },\r\n  \"id\": 9046\r\n}\r\n```\r\n\r\nScenario:\r\n\r\nI'm sending exactly 5 calls to kamailio, it should do the following according to the config:\r\n\r\n- call 1: Send to setid 1 node A (maxload=2)\r\n- call 2: Send to setid 1 node B (maxload=2)\r\n- call 3: Send to setid 1 node A (maxload=2)\r\n- call 4: Send to setid 1 node B (maxload=2)\r\n- call 5: Send to setid 11 node A\r\n\r\nThe logs:\r\n\r\nI'm pasting the logs for call 4 (in which the destination is set properly on $du) and call 5 where $du is not set:\r\n\r\nCall 4:\r\n```\r\nERROR: \u003cscript\u003e: [DISPATCH] 4-7723@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: \u003csip:34.201.28.49:5080\u003e xavp_dsdst: \u003c\u003cnull\u003e\u003e)\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1070 a=24 n=pv_xavp_print\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441b4358 ((nil)) (level=0)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d441b4358) XAVP name: _dsctx_\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427193258\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6\r\nINFO: \u003ccore\u003e [core/xavp.c:571]: xavp_print_list_content():      XAVP value: \u003cxavp:0x7f1d441b42b0\u003e\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441b42b0 (0x7f1d441b4378) (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b42b0) XAVP name: cnt\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7279890\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1\r\nINFO: \u003ccore\u003e [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 2\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b42b0) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441b42b0 (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d441b4358) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d441c0cf0) XAVP name: _dsdst_\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427333496\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6\r\nINFO: \u003ccore\u003e [core/xavp.c:571]: xavp_print_list_content():      XAVP value: \u003cxavp:0x7f1d441ec258\u003e\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441ec258 (0x7f1d441c0d10) (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ec258) XAVP name: dstid\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1762493352\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): cuore_1\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ec258) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b4650) XAVP name: attrs\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1835799177\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): weight=100;maxload=2;duid=cuore_1\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441b4650) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441edb50) XAVP name: grp\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7056653\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1\r\nINFO: \u003ccore\u003e [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 1\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441edb50) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44202b88) XAVP name: uri\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 8122237\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): sip:34.201.28.49:5080\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44202b88) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441ec258 (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d441c0cf0) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d441bcbb0) XAVP name: _dsdst_\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427333496\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6\r\nINFO: \u003ccore\u003e [core/xavp.c:571]: xavp_print_list_content():      XAVP value: \u003cxavp:0x7f1d441ebed8\u003e\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d441ebed8 (0x7f1d441bcbd0) (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ebed8) XAVP name: attrs\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1835799177\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): weight=100;maxload=2;duid=cuore_3\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441ebed8) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441bcb08) XAVP name: grp\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7056653\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1\r\nINFO: \u003ccore\u003e [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 11\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441bcb08) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d441f08a8) XAVP name: uri\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 8122237\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): sip:35.170.67.206:5080\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d441f08a8) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441ebed8 (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d441bcbb0) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d441b4358 (level=0)\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1075 a=16 n=if\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1080 a=26 n=xlog\r\nDEBUG: \u003cscript\u003e: [DISPATCH] 4-7723@192.168.1.201: going to \u003csip:*TESTCALL@cuore-proxy.sandbox-sngl.com\u003e via \u003csip:34.201.28.49:5080\u003e\r\n```\r\n\r\nCall 5\r\n```\r\nERROR: \u003cscript\u003e: [DISPATCH] 5-7723@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: \u003c\u003cnull\u003e\u003e xavp_dsdst: \u003c\u003cnull\u003e\u003e)\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1070 a=24 n=pv_xavp_print\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d44226d88 ((nil)) (level=0)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226d88) XAVP name: _dsctx_\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427193258\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6\r\nINFO: \u003ccore\u003e [core/xavp.c:571]: xavp_print_list_content():      XAVP value: \u003cxavp:0x7f1d44226ce0\u003e\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d44226ce0 (0x7f1d44226da8) (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ce0) XAVP name: cnt\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7279890\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1\r\nINFO: \u003ccore\u003e [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 1\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ce0) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d44226ce0 (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226d88) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226c38) XAVP name: _dsdst_\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1427333496\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 6\r\nINFO: \u003ccore\u003e [core/xavp.c:571]: xavp_print_list_content():      XAVP value: \u003cxavp:0x7f1d44226b70\u003e\r\nINFO: \u003ccore\u003e [core/xavp.c:543]: xavp_print_list_content(): +++++ start XAVP list: 0x7f1d44226b70 (0x7f1d44226c58) (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226b70) XAVP name: attrs\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 1835799177\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): weight=100;maxload=2;duid=cuore_3\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226b70) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ac8) XAVP name: grp\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 7056653\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 1\r\nINFO: \u003ccore\u003e [core/xavp.c:555]: xavp_print_list_content():      XAVP value (int): 11\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226ac8) end\r\nINFO: \u003ccore\u003e [core/xavp.c:547]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226a08) XAVP name: uri\r\nINFO: \u003ccore\u003e [core/xavp.c:548]: xavp_print_list_content():      XAVP id: 8122237\r\nINFO: \u003ccore\u003e [core/xavp.c:549]: xavp_print_list_content():      XAVP value type: 2\r\nINFO: \u003ccore\u003e [core/xavp.c:558]: xavp_print_list_content():      XAVP value (str): sip:35.170.67.206:5080\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:1 - 0x7f1d44226a08) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d44226b70 (level=1)\r\nINFO: \u003ccore\u003e [core/xavp.c:581]: xavp_print_list_content():      *** (l:0 - 0x7f1d44226c38) end\r\nINFO: \u003ccore\u003e [core/xavp.c:584]: xavp_print_list_content(): ----- end XAVP list: 0x7f1d44226d88 (level=0)\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1075 a=16 n=if\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1072 a=26 n=send_reply\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1073 a=2 n=exit\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1062 a=26 n=dp_match\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1079 a=16 n=if\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1064 a=27 n=ds_select_routes\r\nexec: *** cfgtrace:request_route=[DISPATCH] c=[/usr/local/kamailio5/etc/kamailio/kamailio.cfg] l=1069 a=26 n=xlog\r\nERROR: \u003cscript\u003e: [DISPATCH] 6-7723@192.168.1.201: ds_select_routes was succesful (ruri: sip:*TESTCALL@cuore-proxy.sandbox-sngl.com - du: \u003c\u003cnull\u003e\u003e xavp_dsdst: \u003c\u003cnull\u003e\u003e)\r\n```\r\n"}],"action":{"name":"View Issue","url":"https://github.com/kamailio/kamailio/issues/1728#issuecomment-440738611"}}}</script>
<script type="application/ld+json">[
{
"@context": "http://schema.org",
"@type": "EmailMessage",
"potentialAction": {
"@type": "ViewAction",
"target": "https://github.com/kamailio/kamailio/issues/1728#issuecomment-440738611",
"url": "https://github.com/kamailio/kamailio/issues/1728#issuecomment-440738611",
"name": "View Issue"
},
"description": "View this Issue on GitHub",
"publisher": {
"@type": "Organization",
"name": "GitHub",
"url": "https://github.com"
}
},
{
"@type": "MessageCard",
"@context": "http://schema.org/extensions",
"hideOriginalBody": "false",
"originator": "AF6C5A86-E920-430C-9C59-A73278B5EFEB",
"title": "Re: [kamailio/kamailio] dispatcher on 5.2 not setting the destination properly for the second route (#1728)",
"sections": [
{
"text": "",
"activityTitle": "**David Villasmil**",
"activityImage": "https://assets-cdn.github.com/images/email/message_cards/avatar.png",
"activitySubtitle": "@davidcsi",
"facts": [

]
}
],
"potentialAction": [
{
"name": "Add a comment",
"@type": "ActionCard",
"inputs": [
{
"isMultiLine": true,
"@type": "TextInput",
"id": "IssueComment",
"isRequired": false
}
],
"actions": [
{
"name": "Comment",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueComment\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1728,\n\"IssueComment\": \"{{IssueComment.value}}\"\n}"
}
]
},
{
"name": "Close issue",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"IssueClose\",\n\"repositoryFullName\": \"kamailio/kamailio\",\n\"issueId\": 1728\n}"
},
{
"targets": [
{
"os": "default",
"uri": "https://github.com/kamailio/kamailio/issues/1728#issuecomment-440738611"
}
],
"@type": "OpenUri",
"name": "View on GitHub"
},
{
"name": "Unsubscribe",
"@type": "HttpPOST",
"target": "https://api.github.com",
"body": "{\n\"commandName\": \"MuteNotification\",\n\"threadId\": 412938067\n}"
}
],
"themeColor": "26292E"
}
]</script>