juha-h / baresip-studio

baresip library based SIP client for Android

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Can not receive method NOTIFY when connecting to wss server

datpt11 opened this issue · comments

I have debug and sip trace enabled

Then show what adb logcat | grep Baresip gives. See the Wiki.

There is no log when a call comes in

I can still outbound call

i try jssip can still receive method notify

I use flutter's sip library and jssip still receives the event but baresip does not

Screenshot 2024-03-05 at 3 06 37 AM
jssip I listen to sipEvent

Screenshot 2024-03-05 at 3 09 29 AM

and flutter

Please show me if I'm wrong somewhere

Then you better use those apps, because I cannot fix something that I cannot reproduce. I just tried and baresip received NOTIFY over wss without any problems:

03-05 09:02:30.475 29673 29727 D Baresip Lib: ua: ua_register sip:bar@test.tutpro.com
03-05 09:02:30.475 29673 29673 D Baresip Lib: ua event (REGISTERING) 
03-05 09:02:30.475 29673 29673 D Baresip Lib: sending ua/call -5476376647687864880/0 event registering
03-05 09:02:30.476 29673 29673 D Baresip : got uaEvent registering/sip:bar@test.tutpro.com/0
03-05 09:02:30.482 29673 29727 D Baresip Lib: websock: connecting to 'wss://192.168.243.45:5063/'
03-05 09:02:30.615 29673 29727 D Baresip Lib: <0xb400007490c93310> WSS websock established to 192.168.243.45:5063
03-05 09:02:30.615 29673 29727 D Baresip Lib: --> send
03-05 09:02:30.631 29673 29727 D Baresip Lib: bar@test.tutpro.com: (prio 0) {1/WSS/v4} 200 OK (OpenSIPg SIP Proxy (5.7.3-4 (x86_64/linux))) [1 binding]
03-05 09:02:30.631 29673 29726 D Baresip Lib: ua event (REGISTER_OK) 200 OK
...
03-05 09:06:05.722 29673 29727 D Baresip Lib: 09:06:05.718#
03-05 09:06:05.722 29673 29727 D Baresip Lib: WSS 192.168.243.45:5063 -> 192.168.243.151:39258
03-05 09:06:05.722 29673 29727 D Baresip Lib: NOTIFY sip:bar-0xb40000743a51fdd0@192.168.243.151:9;transport=wss SIP/2.0
03-05 09:06:05.722 29673 29727 D Baresip Lib: Record-Route: <sip:192.168.243.45:5061;transport=ws;sn=ext_tls;r2=on;lr>
03-05 09:06:05.723 29673 29727 D Baresip Lib: Record-Route: <sip:127.0.0.1:5070;transport=tcp;r2=on;lr>
03-05 09:06:05.723 29673 29727 D Baresip Lib: Via: SIP/2.0/WSS 192.168.243.45:5061;branch=z9hG4bK2e17.8b4737c8c01a30f090edc53a70c8294f.0;i=c2
03-05 09:06:05.723 29673 29727 D Baresip Lib: Via: SIP/2.0/TCP 127.0.0.1:5080;branch=z9hG4bK2e17.b9ca7ed7000000000000000000000000.0
03-05 09:06:05.723 29673 29727 D Baresip Lib: To: <sip:bar@test.tutpro.com>;tag=2845908c484bfb01
03-05 09:06:05.723 29673 29727 D Baresip Lib: From: <sip:bar@test.tutpro.com>;tag=48b5b8952e8d0bca6256941910840e90-a2cbe054
03-05 09:06:05.723 29673 29727 D Baresip Lib: CSeq: 4 NOTIFY
03-05 09:06:05.724 29673 29727 D Baresip Lib: Call-ID: 6bbff5613388002b
03-05 09:06:05.724 29673 29727 D Baresip Lib: Content-Length: 94
03-05 09:06:05.724 29673 29727 D Baresip Lib: User-Agent: OpenSIPg Presence Server (5.7.3-3 (x86_64/linux))
03-05 09:06:05.724 29673 29727 D Baresip Lib: Max-Forwards: 69
03-05 09:06:05.725 29673 29727 D Baresip Lib: Event: message-summary
03-05 09:06:05.725 29673 29727 D Baresip Lib: Contact: <sip:127.0.0.1:5080;alias=127.0.0.1~45479~2;transport=tcp>
03-05 09:06:05.726 29673 29727 D Baresip Lib: Subscription-State: active;expires=313
03-05 09:06:05.726 29673 29727 D Baresip Lib: Content-Type: application/simple-message-summary
03-05 09:06:05.726 29673 29727 D Baresip Lib: 
03-05 09:06:05.726 29673 29727 D Baresip Lib: Messages-Waiting: yes
03-05 09:06:05.726 29673 29727 D Baresip Lib: Message-Account: sip:bar@vm.test.tutpro.com
03-05 09:06:05.726 29673 29727 D Baresip Lib: Voice-Message: 2/0 (0/0)
03-05 09:06:05.727 29673 29727 D Baresip Lib: 
03-05 09:06:05.727 29673 29726 D Baresip Lib: ua event (MWI_NOTIFY) Messages-Waiting: yes
03-05 09:06:05.727 29673 29726 D Baresip Lib: Message-Account: sip:bar@vm.test.tutpro.com
03-05 09:06:05.727 29673 29726 D Baresip Lib: Voice-Message: 2/0 (0/0)
03-05 09:06:05.727 29673 29726 D Baresip Lib: 
03-05 09:06:05.728 29673 29726 D Baresip Lib: sending ua/call -5476376647687864880/0 event mwi notify,Messages-Waiting: yes

This library suits my needs for connecting sip in the background

Thank you I will check this again. Maybe I'm missing something

NOTIFY needs to be sent from the proxy/presence server using the same connection that SUBSCRIBE used.

If SIP Trace is enabled and logcat does not show the incoming SIP request, then it never arrived and there is nothing baresip app can do about it.

2024-07-17 05:11:03.095 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
2024-07-17 05:11:03.095 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Supported: path, replaces
2024-07-17 05:11:03.095 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Event: incoming
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-descripti
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  on, presence.winfo, message-summary, refer
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Subscription-State: terminated;reason=noresource
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Content-Type: application/simple-message-summary
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  Content-Length: 107
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  
2024-07-17 05:11:03.096 26007-26062 Baresip Lib             com.tutpro.baresip                   D  {"phone_number":"0966882669","sip_phone_number":"0869462376","uuid":"57dc1eb1-3010-4b93-b049-a9eb06149c92"}�[;m
2024-07-17 05:11:03.100 26007-26062 Baresip Lib             com.tutpro.baresip                   D  �[36;1m05:11:03.100#
                                                                                                    WSS 192.168.1.39:50122 -> 113.20.119.22:8089
                                                                                                    SIP/2.0 481 Subscription Does Not Exist
                                                                                                    Via: SIP/2.0/WSS 113```

When I receive the NOTIFI method, it says Subscription Does Not Exist

In that case, there is no subscription that is still valid, i.e., has not expired. Study the SIP trace and look for SUBSCRIBE requests.