Hello all!

i am using kamailio 5.3.1-4 on CentOS and i am using dispatcher to ping his targets.
Now i have someone with asterisk that answers with 401 or 404 (depends on asterisk version).

So i tried  code=401;code=404 as aditional attrs. Seems not to work.
Also i tired to change the modparam from class=2 to this:
  modparam("dispatcher", "ds_ping_reply_codes", "class=2,code=401,code=404")  

Is that a "bug" or a hidden feature, or i missed something?

Btw - Have a nice weekend!

SELECT * FROM dispatcher WHERE id=1 \G
*************************** 1. row ***************************
         id: 1
      setid: 1100
destination: sip:SOMEWHERE;transport=tls
      flags: 0
   priority: 0
      attrs: socket=tls:MY.IP.AD.RR:5061;ping_from=sip:MY.SIP.DOMAIN;code=401;code=404
description: UNTRUSTED



        "SET":  {
          "ID": 1100,
          "TARGETS":  [{
              "DEST": {
                "URI":  "sip:SOMEWHERE;transport=tls",
                "FLAGS":  "IP",
                "PRIORITY": 0,
                "ATTRS":  {
                  "BODY": "socket=tls:MY.IP.AD.RR:5061;ping_from=sip:MY.SIP.DOMAIN;code=401;code=404",
                  "DUID": "",
                  "MAXLOAD":  0,
                  "WEIGHT": 0,
                  "RWEIGHT":  0,
                  "SOCKET": "tls:MY.SIP.DOMAIN:5061"
                },
                "LATENCY":  {
                  "AVG":  48768.816406,
                  "STD":  139490.953125,
                  "EST":  43359.566406,
                  "MAX":  568876,
                  "TIMEOUT":  8
                }
              }
            }]
        }
      }]

#!ifdef WITH_MYSQL
modparam("dispatcher", "db_url", "DBURL")
modparam("dispatcher", "table_name", "dispatcher")
#!endif
#!ifndef WITH_MYSQL
modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")
#!endif
modparam("dispatcher", "ds_ping_method", "OPTIONS")
modparam("dispatcher", "ds_ping_from", "<sip:ping@FANCY-COMPANY-WEBNAME>")
modparam("dispatcher", "ds_ping_interval", 30)
modparam("dispatcher", "ds_probing_mode", 1)
modparam("dispatcher", "ds_probing_threshold", 2)
modparam("dispatcher", "setid_pvname", "$var(setid)")
modparam("dispatcher", "attrs_pvname", "$var(attrs)")
modparam("dispatcher", "ds_ping_reply_codes", "class=2,code=401,code=404")
modparam("dispatcher", "ds_ping_latency_stats", 1)


https://community.asterisk.org/t/asterisk-responds-with-404-to-options-even-when-an-endpoint-is-matched/76238




Dec 13 17:25:46 siptrunk3 /usr/sbin/kamailio[25115]: INFO: <script>: Sending message
'OPTIONS sip:SOMEWHERE;transport=tls SIP/2.0
Via: SIP/2.0/TLS MY.IP.AD.RR:5061;branch=z9hG4bK2527.825671c0000000000000000000000000.0
To: <sip:SOMEWHERE;transport=tls>
From: <sip:MY.SIP.DOMAIN>;tag=f9bf2579cb456ea8d260d4aabc8248ef-9ca844ad
CSeq: 10 OPTIONS
Call-ID: 01cb6e272da7b0dd-25115@MY.IP.AD.RR
Max-Forwards: 70
Content-Length: 0
User-Agent: SBC-OS

'
Dec 13 17:25:46 siptrunk3 /usr/sbin/kamailio[25127]: INFO: <script>: Received message
'SIP/2.0 404 Not Found
Via: SIP/2.0/TLS MY.IP.AD.RR:5061;branch=z9hG4bK2527.825671c0000000000000000000000000.0;received=MY.IP.AD.RR
From: <sip:MY.SIP.DOMAIN>;tag=f9bf2579cb456ea8d260d4aabc8248ef-9ca844ad
To: <sip:SOMEWHERE;transport=tls>;tag=as54adca41
Call-ID: 01cb6e272da7b0dd-25115@MY.IP.AD.RR
CSeq: 10 OPTIONS
Server: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Accept: application/sdp
Content-Length: 0

'
--
Cheers
*Karsten Horsmann*