diago icon indicating copy to clipboard operation
diago copied to clipboard

NOTIFY after REGISTER

Open arkadiam opened this issue 9 months ago • 2 comments

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 avatar Feb 27 '25 18:02 arkadiam

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

arkadiam avatar Feb 27 '25 18:02 arkadiam

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.

emiago avatar Feb 27 '25 19:02 emiago