Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] When a user registers and saves through mid_registrar_save, and when the Expires time arrives, OpenSIPS initiates a re-registration. #3451

Closed
gao114882 opened this issue Aug 23, 2024 · 3 comments
Labels

Comments

@gao114882
Copy link

OpenSIPS version you are running

version: opensips 3.3.10 (x86_64/linux)
flags: STATS: On, DISABLE_NAGLE, USE_MCAST, SHM_MMAP, PKG_MALLOC, Q_MALLOC, F_MALLOC, HP_MALLOC, DBG_MALLOC, FAST_LOCK-ADAPTIVE_WAIT
ADAPTIVE_WAIT_LOOPS=1024, MAX_RECV_BUFFER_SIZE 262144, MAX_LISTEN 16, MAX_URI_SIZE 1024, BUF_SIZE 65535
poll method support: poll, epoll, sigio_rt, select.
main.c compiled on 01:57:54 Aug 23 2024 with gcc 4.8.5

Describe the bug

I registered a user and set the Expires time to 30 seconds. When the time expires, another REGISTER request is initiated. My questions are:

  1. Is there any configuration parameter to prevent it from sending the REGISTER request?
  2. If I cannot prevent it, can I modify the source IP and port from which the request is sent? I want send from port 5161, not 5162。

my listen config:

socket=tcp:172.16.4.111:5162
socket=udp:172.16.4.111:5162
socket=tcp:172.16.4.111:5161
socket=udp:172.16.4.111:5161
socket=tcp:172.16.4.111:5163
socket=udp:172.16.4.111:5163

here is the sip trace:

企业微信截图_17243955811326 企业微信截图_1724395634318

To Reproduce

Expected behavior

Relevant System Logs

here is the re-REGISTER log:

Aug 23 14:18:42 [42] DBG:usrloc:run_ul_callbacks: contact=0x7efc294e74b8, callback type 8/15, id 0 entered
Aug 23 14:18:42 [42] DBG:mid_registrar:mid_reg_ct_event: Contact callback (8): contact='sip:[email protected]:5667'
Aug 23 14:18:42 [42] DBG:usrloc:nodb_timer: Binding '1000','sip:[email protected]:5667' has expired
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str domain='location'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str aor='1000'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str uri='sip:[email protected]:5667'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str received=''
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str path=''
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set int qval=-1
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str user_agent='n/a'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str socket='udp:172.16.4.111:5161'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set int bflags=0
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set int expires=1724393914
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str callid='[email protected]'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set int cseq=2
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str attr=''
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set int latency=0
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str shtag=''
Aug 23 14:18:42 [42] DBG:core:get_dummy_sip_msg: reusing the static sip msg 0x7efca9f066a8
Aug 23 14:18:42 [42] DBG:core:release_dummy_sip_msg: cleaning the static sip msg 0x7efca9f066a8
Aug 23 14:18:42 [42] DBG:core:destroy_avp_list: destroying list (nil)
Aug 23 14:18:42 [42] DBG:usrloc:run_ul_callbacks: contact=0x7efc294e6960, callback type 128/208, id 1 entered
Aug 23 14:18:42 [42] DBG:mid_registrar:mid_reg_aor_event: AOR callback (128): contact='1000'
Aug 23 14:18:42 [42] DBG:mid_registrar:build_unregister_hdrs: building contact from uri 'sip:172.16.4.114:5660;transport=UDP'
Aug 23 14:18:42 [42] DBG:mid_registrar:build_unregister_hdrs: extra hdrs: 'Contact: <sip:172.16.4.114:5660;transport=UDP>;expires=0
'
Aug 23 14:18:42 [42] DBG:tm:t_uac: next_hop=<sip:[email protected]:5660;transport=udp>
Aug 23 14:18:42 [42] DBG:core:mk_proxy: doing DNS lookup...
Aug 23 14:18:42 [42] DBG:tm:t_uac: sending socket is 172.16.4.111 
Aug 23 14:18:42 [42] DBG:tm:print_request_uri: sip:[email protected]:5660;transport=udp
Aug 23 14:18:42 [42] DBG:tm:set_timer: relative timeout is 500000
Aug 23 14:18:42 [42] DBG:tm:insert_timer_unsafe: [4]: 0x7efc294df260 (2660800000)
Aug 23 14:18:42 [42] DBG:tm:insert_timer_unsafe: [0]: 0x7efc294df290 (2665)
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str domain='location'
Aug 23 14:18:42 [42] DBG:core:evi_param_set: set str aor='1000'
Aug 23 14:18:42 [42] DBG:core:get_dummy_sip_msg: reusing the static sip msg 0x7efca9f066a8
Aug 23 14:18:42 [42] DBG:core:release_dummy_sip_msg: cleaning the static sip msg 0x7efca9f066a8
Aug 23 14:18:42 [42] DBG:core:destroy_avp_list: destroying list (nil)
Aug 23 14:18:42 [48] DBG:tm:utimer_routine: timer routine:4,tl=0x7efc294df260 next=(nil), timeout=2660800000
Aug 23 14:18:42 [48] DBG:tm:retransmission_handler: retransmission_handler : request resending (t=0x7efc294df040, REGISTER  ... )
Aug 23 14:18:42 [48] DBG:tm:set_timer: relative timeout is 1000000
Aug 23 14:18:42 [48] DBG:tm:insert_timer_unsafe: [5]: 0x7efc294df260 (2661800000)
Aug 23 14:18:42 [48] DBG:tm:retransmission_handler: retransmission_handler : done
Aug 23 14:18:43 [42] DBG:tm:utimer_routine: timer routine:5,tl=0x7efc294df260 next=(nil), timeout=2661800000
Aug 23 14:18:43 [42] DBG:tm:retransmission_handler: retransmission_handler : request resending (t=0x7efc294df040, REGISTER  ... )
Aug 23 14:18:43 [42] DBG:tm:set_timer: relative timeout is 2000000
Aug 23 14:18:43 [42] DBG:tm:insert_timer_unsafe: [6]: 0x7efc294df260 (2663800000)
Aug 23 14:18:43 [42] DBG:tm:retransmission_handler: retransmission_handler : done
Aug 23 14:18:45 [48] DBG:tm:utimer_routine: timer routine:6,tl=0x7efc294df260 next=(nil), timeout=2663800000
Aug 23 14:18:45 [48] DBG:tm:retransmission_handler: retransmission_handler : request resending (t=0x7efc294df040, REGISTER  ... )
Aug 23 14:18:45 [48] DBG:tm:set_timer: relative timeout is 4000000
Aug 23 14:18:45 [48] DBG:tm:insert_timer_unsafe: [7]: 0x7efc294df260 (2667800000)
Aug 23 14:18:45 [48] DBG:tm:retransmission_handler: retransmission_handler : done
Aug 23 14:18:47 [46] DBG:tm:timer_routine: timer routine:0,tl=0x7efc294df290 next=(nil), timeout=2665
Aug 23 14:18:47 [46] DBG:tm:final_response_handler: Cancel sent out, sending 408 (0x7efc294df040)
Aug 23 14:18:47 [46] DBG:tm:t_should_relay_response: T_code=0, new_code=408
Aug 23 14:18:47 [46] DBG:tm:t_pick_branch: picked branch 0, code 408 (prio=800)
Aug 23 14:18:47 [46] DBG:tm:is_3263_failure: dns-failover test: branch=0, last_recv=408, flags=0
Aug 23 14:18:47 [46] DBG:tm:t_should_relay_response: trying DNS-based failover
Aug 23 14:18:47 [46] DBG:tm:local_reply: branch=0, save=0, winner=0
Aug 23 14:18:47 [46] DBG:tm:local_reply: local transaction completed
Aug 23 14:18:47 [46] DBG:tm:run_any_trans_callbacks: trans=0x7efc294df040, callback type 256, id 0 entered
Aug 23 14:18:47 [46] DBG:mid_registrar:reg_tm_cback: >> [REPLY] UNREGISTER !
Aug 23 14:18:47 [46] DBG:tm:insert_timer_unsafe: [2]: 0x7efc294df0c0 (2670)
Aug 23 14:18:47 [46] DBG:tm:final_response_handler: done
Aug 23 14:18:49 [48] DBG:tm:utimer_routine: timer routine:7,tl=0x7efc294df260 next=(nil), timeout=2667800000
Aug 23 14:18:52 [35] DBG:tm:timer_routine: timer routine:2,tl=0x7efc294df0c0 next=(nil), timeout=2670
Aug 23 14:18:52 [35] DBG:tm:wait_handler: removing 0x7efc294df040 from table 
Aug 23 14:18:52 [35] DBG:tm:delete_cell: delete transaction 0x7efc294df040
Aug 23 14:18:52 [35] DBG:tm:wait_handler: done

OS/environment information

  • Operating System:
  • OpenSIPS installation:
  • other relevant information:

Additional context

@gao114882
Copy link
Author

here is the usrloc, why don't use Domains.AORs.Contacts.Socket to send?

(opensips-cli): mi ul_dump 
{
    "Domains": [
        {
            "name": "location",
            "hash_size": 512,
            "AORs": [
                {
                    "AOR": "1000",
                    "Contacts": [
                        {
                            "Contact": "sip:[email protected]:5667",
                            "ContactID": "3784923643084051695",
                            "Expires": "expired",
                            "Q": "",
                            "Callid": "[email protected]",
                            "Cseq": 2,
                            "User-agent": "n/a",
                            "State": "CS_NEW",
                            "Flags": 0,
                            "Cflags": "",
                            "Socket": "udp:172.16.4.111:5161",
                            "Methods": 4294967295
                        }
                    ]
                }
            ]
        }
    ]
}

Copy link

github-actions bot commented Sep 8, 2024

Any updates here? No progress has been made in the last 15 days, marking as stale. Will close this issue if no further updates are made in the next 30 days.

@github-actions github-actions bot added the stale label Sep 8, 2024
Copy link

github-actions bot commented Oct 8, 2024

Marking as closed due to lack of progress for more than 30 days. If this issue is still relevant, please re-open it with additional details.

@github-actions github-actions bot closed this as completed Oct 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant