Skip to content

Conversation

@vladpaiu
Copy link
Member

Summary
Add MI commands to operate on the memory of the registrant with no DB interaction
Add event for all states of the registrant
Add new parameter controlling how much sooner the re-register needs to be sent

Details
Sometimes it is useful to use OpenSIPS as a registrant, but without any DB connectivity. 2 new MI commands have been added, reg_upsert and reg_delete, that insert/update the registrant memory contents and delete the registrant.

Added events for all state-machine changes for a registrant entry.

Added a new reregister_expiry_percentage parameter, describing how much sooner a RE-REGISTER needs to be sent based on the Expiry. a 100 value means the RE-REGISTER will be send right on the edge of expiry ( old behavior ), which might lead to registration loss. a 90 value means the RE-REGISTER will be sent sooner , at 90% of the Expiry, etc.

@vladpaiu vladpaiu added this to the 4.0.0 milestone Dec 12, 2025
@github-actions
Copy link

Any updates here? No progress has been made in the last 30 days, marking as stale.

@github-actions github-actions bot added the stale label Jan 12, 2026
@vladpaiu vladpaiu removed the stale label Jan 12, 2026
@bogdan-iancu bogdan-iancu self-assigned this Jan 13, 2026
@bogdan-iancu
Copy link
Member

Thank you @vladpaiu for the contribution here. It looks great, some really useful features. If I may comment on two aspects:

  • as you now have the ability to add / remove registrants via MI at runtime, you can use the module without the need of the DB table right? so, maybe the db_url should become optional (or able to be voided) if you want to use the modules ONLY with the MI funcs;
  • in regards to the events, have you considered grouping multiple notification into a single event? Like having the "uac_registrant_state" event with sub-type "registering, failed, registered, expired, etc", another one "uac_registrant_auth" with whatever auth events you have (bad credentials, auth OK, auth failed) ? something a bit more structured :)
  • and as a bonus (as I like the extension with the events), maybe adding support for status/report ? The status idea is already present via MI, but I see having some reports a very useful feature - to see the history of actions upon a registrant - but this is something I can add by myself if you decline the task :)

@vladpaiu
Copy link
Member Author

vladpaiu commented Jan 28, 2026

Hey,

  1. marked db_url as optional
  2. don't really agree here, would rather keep the events more granular so you can subscribe just to what you need
  3. added status reports - not sure if this is what you had in mind, couldn't think of a better way to name them other than aor=X;contact=Y;proxy=Z

ie. right now

# opensips-cli -x mi reg_upsert aor=sip:vlad@test.com contact=sip:test@mycontact.com registrar=sip:127.0.0.1:5061 proxy="" third_party_registrant="" username="vlad" password="1234" binding_params="" expiry=600 forced_socket="" cluster_shtag="" state=0

produces

# opensips-cli -x mi  sr_list_reports uac_registrant
[
   {
       "Name": "aor=sip:vlad@test.com;contact=sip:test@mycontact.com;registrar=sip:127.0.0.1:5061",
       "Reports": [
           {
               "Timestamp": 1769604697,
               "Date": "Wed Jan 28 14:51:37 2026",
               "Log": "created with state NOT_REGISTERED_STATE\n"
           },
           {
               "Timestamp": 1769604707,
               "Date": "Wed Jan 28 14:51:47 2026",
               "Log": "state changed to REGISTERING_STATE\n"
           },
           {
               "Timestamp": 1769604712,
               "Date": "Wed Jan 28 14:51:52 2026",
               "Log": "state changed to REGISTER_TIMEOUT_STATE\n"
           }
       ]
   }
]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants