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

NOTIFY after REGISTER #51

Open
arkadiam opened this issue Feb 27, 2025 · 2 comments
Open

NOTIFY after REGISTER #51

arkadiam opened this issue Feb 27, 2025 · 2 comments

Comments

@arkadiam
Copy link

There is a new code in NewDiago(): dg.server.OnNotify()
It looks like it was added to handle SUBSCRIBE-NOTIFY cases.

There is another case when NOTIFY can be sent out of dialog: registration. On successful client registration PBX will reply with NOTIFY indicating number of vociemail message. That's Asterisk behaviour.

REGISTER ->
...
<- 200 OK
<- NOTIFY

Right now this NOTIFY is rejected with this error:
SIP/2.0 400 missing tag param in To header
Call/Transaction Outside Dialog

There was a discussion about out of dialog "notify"
https://sip-implementors.cs.columbia.narkive.com/bkHgiKHL/notify-without-subscribe

What is the best way to handle that?

@arkadiam
Copy link
Author

Also combining errors using errors.Join() produces an error, which when printed presented as multi line string.

        id, err := sip.UACReadRequestDialogID(req)
        if err != nil {
                return nil, errors.Join(err, ErrDialogOutsideDialog)
        }

Reply looks like below. Due to second line, it is an invalid syntax:

SIP/2.0 400 missing tag param in To header
Call/Transaction Outside Dialog
Via: SIP/2.0/UDP xxx
Via: SIP/2.0/UDP yyy
From: "xxx" <sip:xxx>;tag=dddd
To: <sip:xxxx@xxxxx:5060>;tag=xx
Call-ID: xxxxxxxxx
CSeq: 102 NOTIFY
Content-Length: 0

@emiago
Copy link
Owner

emiago commented Feb 27, 2025

Hi @arkadiam . Welcome!.
Yes, new code landed, before handling this, goal is really to finish full support of Transfers, but THANKS for sharing this!
There is work also for documentation, but many things also got fixed in meantime.

If this is urgent, please use temporarly fix by passing your server to diago, and then after overriding NOTIFY and other handlers.

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

No branches or pull requests

2 participants