Skip to content

Add OnRegisterStateChange callback for SIP registration lifecycle#123

Open
kjagosz wants to merge 1 commit intoemiago:mainfrom
kjagosz:main
Open

Add OnRegisterStateChange callback for SIP registration lifecycle#123
kjagosz wants to merge 1 commit intoemiago:mainfrom
kjagosz:main

Conversation

@kjagosz
Copy link

@kjagosz kjagosz commented Jan 8, 2026

This change introduces a new optional callback: OnRegisterStateChange.

The callback allows callers to observe SIP registration state transitions
during the Register transaction lifecycle.

What’s included:

  • New OnRegisterStateChange callback exposed via RegisterOptions
  • Callback is invoked with true when registration succeeds
  • Callback is invoked with false when registration fails
  • No behavior change for existing users unless the callback is provided

This makes it easier to track registration status, react to failures,
and integrate external state handling without polling or custom hacks.

@emiago
Copy link
Owner

emiago commented Jan 10, 2026

Hi @kjagosz . I really liked Idea, and I was actually avoiding this initially. You can see OnRegister . The reason behind is that more powerfull way would be doing transactions manually, but I think there just more to it so I kind see point going with this.

So the one thing I think we need to look this react on event change. I think you could have function that returns error as all other calbacks we mostly do.

@kjagosz
Copy link
Author

kjagosz commented Jan 10, 2026

I've made it because i have app what making call's via Rest API and there is no method to get registration status so i decided to create callback

@emiago
Copy link
Owner

emiago commented Jan 11, 2026

ok, but I think I need to make this more usable.
My assumption is that mostly people just call Register() while actually if you call RegisterTransaction() you are in full control.

Still I may see first simplifies headache. I may propose better solution if you do not mind. What was reason consuming error? It mostly stops registration except for some responses?

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants