[sr-dev] [kamailio/kamailio] add rport to uac register msg (#2639)

Seven Du notifications at github.com
Tue Feb 16 16:28:52 CET 2021


built master and local_rport is in but seems has no effect.

the lua event callback get called, but as soon as it hit `KSR.add_local_rport();` it crashes. comment out that line doesn't crash.

some bt:

```
Core was generated by `/usr/local/sbin/kamailio -S -DD -dd -E -e -m 32 -M 2 -A KAM_SIP_PORT=9060 -A KA'.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  t_run_local_req (buf=0x7ffca69c35c8, buf_len=0x7ffca69c35c4, uac_r=0x7ffca69c4a10, new_cell=0x7f3a74d20dd8,
    request=0x7f3a74d21078) at uac.c:346
346			request->dst.proto = lreq.force_send_socket->proto;
(gdb) bt
#0  t_run_local_req (buf=0x7ffca69c35c8, buf_len=0x7ffca69c35c4, uac_r=0x7ffca69c4a10, new_cell=0x7f3a74d20dd8,
    request=0x7f3a74d21078) at uac.c:346
#1  0x00007f3a76fe2cec in t_uac_prepare (uac_r=0x7ffca69c4a10, dst_req=0x7ffca69c3730, dst_cell=0x7ffca69c3728)
    at uac.c:543
#2  0x00007f3a76fe6058 in t_uac_with_ids (uac_r=0x7ffca69c4a10, ret_index=0x0, ret_label=0x0) at uac.c:749
#3  0x00007f3a76fe6024 in t_uac (uac_r=0x7ffca69c4a10) at uac.c:731
#4  0x00007f3a76fe95c6 in request (uac_r=0x7ffca69c4a10, ruri=0x7ffca69c45f0, to=0x7ffca69c41e0,
    from=0x7ffca69c41e0, next_hop=0x7f3a74d20768) at uac.c:1099
#5  0x00007f3a7461a40d in uac_reg_send (reg=0x7f3a74d20700, tn=1613489050) at uac_reg.c:1152
#6  0x00007f3a7461ae4d in uac_reg_update (reg=0x7f3a74d20700, tn=1613489050) at uac_reg.c:1211
#7  0x00007f3a7461aef5 in uac_reg_timer (ticks=84554152) at uac_reg.c:1234
#8  0x00007f3a745df4e8 in child_init (rank=0) at uac.c:420
#9  0x000055d3e80e3e45 in init_mod_child (m=0x7f3a77fbca18, rank=0) at core/sr_module.c:861
#10 0x000055d3e80e46e4 in init_child (rank=0) at core/sr_module.c:906
#11 0x000055d3e7f9ffa5 in main_loop () at main.c:1772
#12 0x000055d3e7faa5b9 in main (argc=20, argv=0x7ffca69c5478) at main.c:2895
(gdb) f 0
#0  t_run_local_req (buf=0x7ffca69c35c8, buf_len=0x7ffca69c35c4, uac_r=0x7ffca69c4a10, new_cell=0x7f3a74d20dd8,
    request=0x7f3a74d21078) at uac.c:346
346			request->dst.proto = lreq.force_send_socket->proto;
(gdb) print lreq
$1 = {id = 1, pid = 27033, tval = {tv_sec = 0, tv_usec = 0}, fwd_send_flags = {f = 0, blst_imask = 0},
  rpl_send_flags = {f = 0, blst_imask = 0}, first_line = {type = 1, flags = 1, len = 37, u = {request = {
        method = {
          s = 0x7f3a74d22fa8 "REGISTER sip:xyt.xswitch.cn SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8"..., len = 8}, uri = {
          s = 0x7f3a74d22fb1 "sip:xyt.xswitch.cn SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8852a4ab47"..., len = 18}, version = {
          s = 0x7f3a74d22fc4 "SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8852a4ab4756667432d70505cb2e-"..., len = 7}, method_value = 32}, reply = {version = {
          s = 0x7f3a74d22fa8 "REGISTER sip:xyt.xswitch.cn SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8"..., len = 8}, status = {
          s = 0x7f3a74d22fb1 "sip:xyt.xswitch.cn SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8852a4ab47"..., len = 18}, reason = {
          s = 0x7f3a74d22fc4 "SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8852a4ab4756667432d70505cb2e-"..., len = 7}, statuscode = 32}}}, via1 = 0x7f3a77fdc5d8, via2 = 0x0, headers = 0x7f3a77fdc530,
  last_header = 0x7f3a77fdc530, parsed_flag = 2, h_via1 = 0x7f3a77fdc530, h_via2 = 0x0, callid = 0x0, to = 0x0,
--Type <RET> for more, q to quit, c to continue without paging--
  cseq = 0x0, from = 0x0, contact = 0x0, maxforwards = 0x0, route = 0x0, record_route = 0x0,
  content_type = 0x0, content_length = 0x0, authorization = 0x0, expires = 0x0, proxy_auth = 0x0,
  supported = 0x0, require = 0x0, proxy_require = 0x0, unsupported = 0x0, allow = 0x0, event = 0x0,
  accept = 0x0, accept_language = 0x0, organization = 0x0, priority = 0x0, subject = 0x0, user_agent = 0x0,
  server = 0x0, content_disposition = 0x0, diversion = 0x0, rpid = 0x0, refer_to = 0x0, session_expires = 0x0,
  min_se = 0x0, sipifmatch = 0x0, subscription_state = 0x0, date = 0x0, identity = 0x0, identity_info = 0x0,
  pai = 0x0, ppi = 0x0, path = 0x0, privacy = 0x0, min_expires = 0x0, body = 0x0, eoh = 0x0,
  unparsed = 0x7f3a74d23028 "To: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8852a4ab4756667432d70505cb2e-62ccedaf\r\nCSeq: 10 REGISTER\r\nCall-ID: 6c7081af46269ed1-27033 at 172.18.0.4\r\nMax-Forwards: 70\r\nContent-L"..., rcv = {src_ip = {af = 2, len = 4, u = {addrl = {67113644, 0}, addr32 = {67113644, 0, 0, 0},
        addr16 = {4780, 1024, 0, 0, 0, 0, 0, 0}, addr = "\254\022\000\004", '\000' <repeats 11 times>}},
    dst_ip = {af = 2, len = 4, u = {addrl = {1621362842, 0}, addr32 = {1621362842, 0, 0, 0}, addr16 = {2202,
          24740, 0, 0, 0, 0, 0, 0}, addr = "\232\b\244`", '\000' <repeats 11 times>}}, src_port = 9060,
    dst_port = 18860, proto_reserved1 = 0, proto_reserved2 = 0, src_su = {s = {sa_family = 2,
        sa_data = "#d\254\022\000\004\000\000\000\000\000\000\000"}, sin = {sin_family = 2, sin_port = 25635,
        sin_addr = {s_addr = 67113644}, sin_zero = "\000\000\000\000\000\000\000"}, sin6 = {sin6_family = 2,
        sin6_port = 25635, sin6_flowinfo = 67113644, sin6_addr = {__in6_u = {
            __u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0,
              0, 0, 0}}}, sin6_scope_id = 0}, sas = {ss_family = 2,
        __ss_padding = "#d\254\022\000\004", '\000' <repeats 111 times>, __ss_align = 0}},
    bind_address = 0x7f3a77f8c740, rflags = (unknown: 0), proto = 1 '\001', proto_pad0 = 0 '\000',
    proto_pad1 = 0},
--Type <RET> for more, q to quit, c to continue without paging--
  buf = 0x7f3a74d22fa8 "REGISTER sip:xyt.xswitch.cn SIP/2.0\r\nVia: SIP/2.0/UDP 172.16.131.200:9060;branch=z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0\r\nTo: <sip:6077 at xyt.xswitch.cn>\r\nFrom: <sip:6077 at xyt.xswitch.cn>;tag=313d8"..., len = 442, new_uri = {s = 0x0, len = 0}, dst_uri = {s = 0x7f3a77fdc7d0 "sip:xyt.xswitch.cn:18860",
    len = 24}, parsed_uri_ok = 0, parsed_uri = {user = {s = 0x0, len = 0}, passwd = {s = 0x0, len = 0}, host = {
      s = 0x0, len = 0}, port = {s = 0x0, len = 0}, params = {s = 0x0, len = 0}, sip_params = {s = 0x0,
      len = 0}, headers = {s = 0x0, len = 0}, port_no = 0, proto = 0, type = ERROR_URI_T, flags = (unknown: 0),
    transport = {s = 0x0, len = 0}, ttl = {s = 0x0, len = 0}, user_param = {s = 0x0, len = 0}, maddr = {
      s = 0x0, len = 0}, method = {s = 0x0, len = 0}, lr = {s = 0x0, len = 0}, r2 = {s = 0x0, len = 0}, gr = {
      s = 0x0, len = 0}, transport_val = {s = 0x0, len = 0}, ttl_val = {s = 0x0, len = 0}, user_param_val = {
      s = 0x0, len = 0}, maddr_val = {s = 0x0, len = 0}, method_val = {s = 0x0, len = 0}, lr_val = {s = 0x0,
      len = 0}, r2_val = {s = 0x0, len = 0}, gr_val = {s = 0x0, len = 0}}, parsed_orig_ruri_ok = 0,
  parsed_orig_ruri = {user = {s = 0x0, len = 0}, passwd = {s = 0x0, len = 0}, host = {s = 0x0, len = 0},
    port = {s = 0x0, len = 0}, params = {s = 0x0, len = 0}, sip_params = {s = 0x0, len = 0}, headers = {
      s = 0x0, len = 0}, port_no = 0, proto = 0, type = ERROR_URI_T, flags = (unknown: 0), transport = {
      s = 0x0, len = 0}, ttl = {s = 0x0, len = 0}, user_param = {s = 0x0, len = 0}, maddr = {s = 0x0, len = 0},
    method = {s = 0x0, len = 0}, lr = {s = 0x0, len = 0}, r2 = {s = 0x0, len = 0}, gr = {s = 0x0, len = 0},
    transport_val = {s = 0x0, len = 0}, ttl_val = {s = 0x0, len = 0}, user_param_val = {s = 0x0, len = 0},
    maddr_val = {s = 0x0, len = 0}, method_val = {s = 0x0, len = 0}, lr_val = {s = 0x0, len = 0}, r2_val = {
      s = 0x0, len = 0}, gr_val = {s = 0x0, len = 0}}, add_rm = 0x7f3a77fdc8c8, body_lumps = 0x0,
  reply_lump = 0x0,
  add_to_branch_s = "z9hG4bKae8.2f46aa8", '0' <repeats 25 times>, ".0", '\000' <repeats 12 times>,
  add_to_branch_len = 45, hash_index = 0, msg_flags = 2048, flags = 0, xflags = {0, 0}, set_global_address = {
--Type <RET> for more, q to quit, c to continue without paging--
    s = 0x0, len = 0}, set_global_port = {s = 0x0, len = 0}, force_send_socket = 0x0, path_vec = {s = 0x0,
    len = 0}, instance = {s = 0x0, len = 0}, reg_id = 0, ruid = {s = 0x0, len = 0}, location_ua = {s = 0x0,
    len = 0}, otcpid = 0, ldv = {flow = {decoded = 0, rcv = {src_ip = {af = 0, len = 0, u = {addrl = {0, 0},
            addr32 = {0, 0, 0, 0}, addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, addr = '\000' <repeats 15 times>}},
        dst_ip = {af = 0, len = 0, u = {addrl = {0, 0}, addr32 = {0, 0, 0, 0}, addr16 = {0, 0, 0, 0, 0, 0, 0,
              0}, addr = '\000' <repeats 15 times>}}, src_port = 0, dst_port = 0, proto_reserved1 = 0,
        proto_reserved2 = 0, src_su = {s = {sa_family = 0, sa_data = '\000' <repeats 13 times>}, sin = {
            sin_family = 0, sin_port = 0, sin_addr = {s_addr = 0}, sin_zero = "\000\000\000\000\000\000\000"},
          sin6 = {sin6_family = 0, sin6_port = 0, sin6_flowinfo = 0, sin6_addr = {__in6_u = {
                __u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {
                  0, 0, 0, 0}}}, sin6_scope_id = 0}, sas = {ss_family = 0,
            __ss_padding = '\000' <repeats 117 times>, __ss_align = 0}}, bind_address = 0x0,
        rflags = (unknown: 0), proto = 0 '\000', proto_pad0 = 0 '\000', proto_pad1 = 0}}, vdata = 0x0}}
(gdb) print *request
$2 = {rbtype = 0, flags = 0, t_active = 0, branch = 0, buffer_len = 0, buffer = 0x0, my_T = 0x7f3a74d20dd8,
  timer = {next = 0x0, prev = 0x0, expire = 0, initial_timeout = 0, data = 0x0,
    f = 0x7f3a7700bf14 <retr_buf_handler>, flags = 0, slow_idx = 0}, dst = {send_sock = 0x0, to = {s = {
        sa_family = 2, sa_data = "I\254\232\b\244`\000\000\000\000\000\000\000"}, sin = {sin_family = 2,
        sin_port = 44105, sin_addr = {s_addr = 1621362842}, sin_zero = "\000\000\000\000\000\000\000"}, sin6 = {
        sin6_family = 2, sin6_port = 44105, sin6_flowinfo = 1621362842, sin6_addr = {__in6_u = {
            __u6_addr8 = '\000' <repeats 15 times>, __u6_addr16 = {0, 0, 0, 0, 0, 0, 0, 0}, __u6_addr32 = {0,
              0, 0, 0}}}, sin6_scope_id = 0}, sas = {ss_family = 2,
        __ss_padding = "I\254\232\b\244`", '\000' <repeats 111 times>, __ss_align = 0}}, id = 0, send_flags = {
      f = 0, blst_imask = 0}, proto = 1 '\001', proto_pad0 = 0 '\000', proto_pad1 = 0}, retr_expire = 0,
  fr_expire = 0}
(gdb)
```

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/kamailio/kamailio/issues/2639#issuecomment-779911710
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.kamailio.org/pipermail/sr-dev/attachments/20210216/7af3ece6/attachment-0001.htm>


More information about the sr-dev mailing list