<div dir="ltr"><div>Hi all,</div><div><br></div><div>i have a problem with kamailio 5.3.x and asterisk 13, i basically forward everything, but i cant manage to make it register.</div><div><br></div><div>The register arrives on asterisk see the capture bellow:</div><div>Any help is much appreciated!<br></div><div>----------------<br></div><div>REGISTER sip:<a href="http://oro.sips.nl">oro.sips.nl</a>;transport=UDP SIP/2.0<br>Via: SIP/2.0/UDP 104.201.100.15;branch=z9hG4bK4d5e.997621d931a2ad9f6423e2ac7782a319.1<br>Via: SIP/2.0/UDP 34.12.55.102:34626;received=34.12.55.102;branch=z9hG4bK-524287-1---0a0bffd64bbd9941;rport=34626<br>Max-Forwards: 69<br>Contact: <sip:test-user1@34.12.55.102:34626;transport=UDP;rinstance=85c33e976be3dad1><br>To: <<a href="mailto:sip%3Atest-user1@oro.sips.nl">sip:test-user1@oro.sips.nl</a>;transport=UDP><br>From: <<a href="mailto:sip%3Atest-user1@oro.sips.nl">sip:test-user1@oro.sips.nl</a>;transport=UDP>;tag=6d8fd914<br>Call-ID: h6lkViFgxurpVRkw4Ly-GQ..<br>CSeq: 1 REGISTER<br>Expires: 60<br>Allow: INVITE, ACK, CANCEL, BYE, NOTIFY, REFER, MESSAGE, OPTIONS, INFO, SUBSCRIBE<br>User-Agent: Z 5.4.9 rv2.10.11.7<br>Allow-Events: presence, kpml, talk<br>Content-Length: 0<br>Path: <sip:104.201.100.15;lr;received=sip:<a href="http://34.12.55.102:34626">34.12.55.102:34626</a>><br></div><div><br></div>-------------------the config -------<br><div><div># - flags<br>#   FLT_ - per transaction (message) flags<br>#        FLB_ - per branch flags<br>#!define FLT_ACC 1<br>#!define FLT_ACCMISSED 2<br>#!define FLT_ACCFAILED 3<br><br>#!define FLT_FS 10<br><br>####### Global Parameters #########<br><br>debug=4<br>log_stderror=yes<br><br>memdbg=5<br>memlog=5<br><br>log_facility=LOG_LOCAL0<br><br>fork=yes<br>children=4<br><br>/* comment the next line to enable TCP */<br>disable_tcp=yes<br><br>/* uncomment the next line to disable the auto discovery of local aliases<br>   based on revers DNS on IPs (default on) */<br>auto_aliases=no<br><br>/* add local domain aliases */<br># alias="<a href="http://mysipserver.com">mysipserver.com</a>"<br><br>port=5060<br><br>/* uncomment and configure the following line if you want Kamailio to<br>   bind on a specific interface/port/proto (default bind on all available) */<br># listen=udp:<a href="http://127.0.0.1:5060">127.0.0.1:5060</a><br><br>sip_warning=no<br><br>####### Modules Section ########<br><br># set module path<br>#mpath="/usr/local/lib/kamailio/modules/"<br><br>#loadmodule "db_mysql.so"<br>loadmodule "jsonrpcs.so"<br>loadmodule "kex.so"<br>loadmodule "corex.so"<br>loadmodule "tm.so"<br>loadmodule "tmx.so"<br>loadmodule "sl.so"<br>loadmodule "rr.so"<br>loadmodule "pv.so"<br>loadmodule "maxfwd.so"<br>loadmodule "textops.so"<br>loadmodule "siputils.so"<br>loadmodule "xlog.so"<br>loadmodule "sanity.so"<br>loadmodule "ctl.so"<br>loadmodule "acc.so"<br>loadmodule "dispatcher.so"<br>loadmodule "path.so"<br><br># ----------------- setting module-specific parameters ---------------<br><br><br># ----- jsonrpcs params -----<br>modparam("jsonrpcs", "pretty_format", 1)<br><br><br># ----- rr params -----<br># add value to ;lr param to cope with most of the UAs<br>modparam("rr", "enable_full_lr", 1)<br># do not append from tag to the RR (no need for this script)<br>modparam("rr", "append_fromtag", 0)<br><br><br># ----- acc params -----<br>modparam("acc", "log_flag", FLT_ACC)<br>modparam("acc", "failed_transaction_flag", FLT_ACCFAILED)<br>modparam("acc", "log_extra", "src_user=$fU;src_domain=$fd;dst_ouser=$tU;dst_user=$rU;dst_domain=$rd;src_ip=$si")<br><br># ----- tm params -----<br>modparam("tm", "fr_timer", 2000)<br>modparam("tm", "fr_inv_timer", 40000)<br><br># ----- dispatcher params -----<br>#modparam("dispatcher", "db_url", DBURL)<br>#modparam("dispatcher", "table_name", "dispatcher")<br>modparam("dispatcher", "list_file", "/etc/kamailio/dispatcher.list")<br>modparam("dispatcher", "flags", 2)<br>modparam("dispatcher", "xavp_dst", "_dsdst_")<br>modparam("dispatcher", "xavp_ctx", "_dsctx_")<br>modparam("dispatcher", "ds_ping_from", "sip:proxy@mykamailio")<br>modparam("dispatcher", "ds_ping_interval", 30)<br>modparam("dispatcher", "ds_probing_threshold", 10)<br>modparam("dispatcher", "ds_inactive_threshold", 5)<br>modparam("dispatcher", "ds_ping_reply_codes", "class=2;code=403;code=488;class=3")<br>modparam("dispatcher", "ds_probing_mode", 1)<br><br>modparam("path", "use_received", 1)<br><br>####### Routing Logic ########<br><br><br># main request routing logic<br><br>request_route {<br><br>        # per request initial checks<br>  route(REQINIT);<br><br>        if(ds_is_from_list()) {<br>                setflag(FLT_FS);<br>        }<br><br> # CANCEL processing<br>   if (is_method("CANCEL")) {<br>          if (t_check_trans()) {<br>                        route(RELAY);<br>         }<br>             exit;<br> }<br><br>   # handle retransmissions<br>      if (!is_method("ACK")) {<br>            if(t_precheck_trans()) {<br>                      t_check_trans();<br>                      exit;<br>         }<br>             t_check_trans();<br>      }<br><br>   # handle requests within SIP dialogs<br>  route(WITHINDLG);<br><br>        if (isflagset(FLT_FS)) {<br>                route(FROM_FS);<br>                exit;<br>        }<br><br>    ### only initial requests (no To tag)<br><br>       # record routing for dialog forming requests (in case they are routed)<br>        # - remove preloaded route headers<br>    remove_hf("Route");<br> if (is_method("INVITE|SUBSCRIBE")) {<br>                record_route();<br>       }<br><br>   # account only INVITEs<br>        if (is_method("INVITE")) {<br>          setflag(FLT_ACC); # do accounting<br>     }<br><br>   # handle presence related requests<br>    route(PRESENCE);<br><br>    # handle registrations<br>        route(REGISTRAR);<br><br>   if ($rU==$null) {<br>             # request with no Username in RURI<br>            sl_send_reply("484","Address Incomplete");<br>                exit;<br> }<br><br>   # dispatch destinations<br>       route(DISPATCH);<br>}<br><br>route[FROM_FS]<br>{<br>        record_route();<br>        route(RELAY);<br>        exit;<br>}<br><br>route[RELAY] {<br>      if (!t_relay()) {<br>             sl_reply_error();<br>     }<br>     exit;<br>}<br><br># Per SIP request initial checks<br>route[REQINIT] {<br>        if (!mf_process_maxfwd_header("10")) {<br>              sl_send_reply("483","Too Many Hops");<br>             exit;<br> }<br><br>   if(!sanity_check("1511", "7")) {<br>          xlog("Malformed SIP message from $si:$sp\n");<br>               exit;<br> }<br>}<br><br># Handle requests within SIP dialogs<br>route[WITHINDLG] {<br>      if (has_totag()) {<br>            # sequential request withing a dialog should<br>          # take the path determined by record-routing<br>          if (loose_route()) {<br>                  if (is_method("BYE")) {<br>                             setflag(FLT_ACC); # do accounting ...<br>                         setflag(FLT_ACCFAILED); # ... even if the transaction fails<br>                   }<br>                     route(RELAY);<br>         } else {<br>                      if (is_method("SUBSCRIBE") && uri == myself) {<br>                              # in-dialog subscribe requests<br>                                route(PRESENCE);<br>                              exit;<br>                 }<br>                     if ( is_method("ACK") ) {<br>                           if ( t_check_trans() ) {<br>                                      # non loose-route, but stateful ACK;<br>                                  # must be ACK after a 487 or e.g. 404 from upstream server<br>                                    t_relay();<br>                                    exit;<br>                         } else {<br>                                      # ACK without matching transaction ... ignore and discard.<br>                                    exit;<br>                         }<br>                     }<br>                     sl_send_reply("404","Not here");<br>          }<br>             exit;<br> }<br>}<br><br># Handle SIP registrations<br>route[REGISTRAR] {<br>        if(!is_method("REGISTER"))<br>          return;<br>       add_path_received();<br>        route(DISPATCH);<br>}<br><br># Presence server route<br>route[PRESENCE] {<br>   if(!is_method("PUBLISH|SUBSCRIBE"))<br>         return;<br><br>     sl_send_reply("404", "Not here");<br> exit;<br>}<br><br># Dispatch requests<br>route[DISPATCH] {<br>    # round robin dispatching on gateways group '1'<br>               switch ($fd){<br>                 case "<a href="http://oro.sips.nl">oro.sips.nl</a>":<br>                          send_reply(483, "Ok, Skipper!");<br>                            if (!ds_select_dst("1", "4")) {<br>                                   log("ERROR: no active destinations found!\n");<br>                                      send_reply(503, "Service Unavailable");<br>                                     exit;<br>                         }<br>                             ds_select_dst("1", "4");<br>                          log("---- flag value is $dd -- branch $fd \n");<br>                             xdbg("--- SCRIPT: going to <$ru> via <$du> (attrs: $xavp(_dsdst_=>attrs))\n");<br>                               break;<br>                        case "<a href="http://oro2.sips.nl">oro2.sips.nl</a>":<br>                                send_reply(483, "Ok, Skipper!");<br>                            if (!ds_select_dst("2", "4")) {<br>                                   log("ERROR: no active destinations found!\n");<br>                                      send_reply(503, "Service Unavailable");<br>                                     exit;<br>                         }<br>                             ds_select_dst("2", "4");<br>                          log("---- flag value is $dd -- branch $fd \n");<br>                                     xdbg("--- SCRIPT: going to <$ru> via <$du> (attrs: $xavp(_dsdst_=>attrs))\n");<br>                               break;<br>                        default:<br>                          log("unknow destination?");<br>                       send_reply(503, "No service defined");<br>                            exit;<br>           }<br><br>   xdbg("--- SCRIPT: going to <$ru> via <$du> (attrs: $xavp(_dsdst_=>attrs))\n");<br>       t_on_failure("RTF_DISPATCH");<br>       route(RELAY);<br> exit;<br>}<br><br># Try next destionations in failure route<br>failure_route[RTF_DISPATCH] {<br>  if (t_is_canceled()) {<br>                exit;<br> }<br>     # next DST - only for 500 or local timeout<br>    if (t_check_status("500")<br>                   or (t_branch_timeout() and !t_branch_replied())) {<br>            if(ds_next_dst()) {<br>                   xdbg("--- SCRIPT: retrying to <$ru> via <$du> (attrs: $xavp(_dsdst_=>attrs))\n");<br>                    t_on_failure("RTF_DISPATCH");<br>                       route(RELAY);<br>                 exit;<br>         }<br>     }<br>}<br></div></div></div>