juha-h / baresip-studio

baresip library based SIP client for Android
BSD 3-Clause "New" or "Revised" License
278 stars 70 forks source link

Issue of app only connecting via WiFi, not data connection #492

Closed xandark closed 2 months ago

xandark commented 2 months ago

I really like this app, but I'm new to using VOIP as a replacement for a regular cell phone carrier. I can install this and it works fine on my Pixel 7 phone and it will connect to my Voip.ms account, but only on WiFi. Is this intentional?

In other words, is there an internal preference in Baresip to only use WiFi and not a data internet connection? All my other apps have a functioning internet connection via the data that I've bought from a eSIM data provider. But strangely enough not the Baresip app.

juha-h commented 2 months ago

baresip uses the same network to reach Internet as any other app. The network it uses is based on device's routing table.

I made a test by configuring on my device a fake voip.ms account on my device using outbound proxy amsterdam1.voip.ms. It tried to connect to that server without issues over cellular network:

08-02 09:40:42.545 23609 23685 D Baresip Lib: ua: ua_register sip:test@voip.ms
08-02 09:40:42.545 23609 23609 D Baresip Lib: ua event (REGISTERING) 
08-02 09:40:42.545 23609 23609 D Baresip Lib: sending ua/call -5476376658447992432/0 event registering
08-02 09:40:42.545 23609 23609 D Baresip : got uaEvent registering/sip:test@voip.ms/0
08-02 09:40:42.696 23609 23685 D Baresip Lib: 09:40:42.695#
08-02 09:40:42.696 23609 23685 D Baresip Lib: UDP 10.183.120.46:58311 -> 208.100.60.65:5060
08-02 09:40:42.696 23609 23685 D Baresip Lib: REGISTER sip:voip.ms SIP/2.0
08-02 09:40:42.696 23609 23685 D Baresip Lib: Via: SIP/2.0/UDP 10.183.120.46:58311;branch=z9hG4bKf7de29bf3293492f;rport
08-02 09:40:42.696 23609 23685 D Baresip Lib: Contact: <sip:test-0xb4000071b8f77990@10.183.120.46:58311>;expires=900;+sip.instance="<urn:uuid:0779cd67-79b3-e54a-fd87-a37ef33
08-02 09:40:42.696 23609 23685 D Baresip Lib: 482cd>";q=0.5;reg-id=1
08-02 09:40:42.697 23609 23685 D Baresip Lib: Max-Forwards: 70
08-02 09:40:42.697 23609 23685 D Baresip Lib: Route: <sip:amsterdam1.voip.ms;lr>
08-02 09:40:42.697 23609 23685 D Baresip Lib: To: <sip:test@voip.ms>
08-02 09:40:42.697 23609 23685 D Baresip Lib: From: <sip:test@voip.ms>;tag=f9655879279293f6
08-02 09:40:42.697 23609 23685 D Baresip Lib: Call-ID: c1bd3636bfc9c314
08-02 09:40:42.697 23609 23685 D Baresip Lib: CSeq: 59827 REGISTER
08-02 09:40:42.697 23609 23685 D Baresip Lib: User-Agent: baresip v60.4.1 (Android 14/aarch64)
08-02 09:40:42.697 23609 23685 D Baresip Lib: Supported: gruu, outbound, path
08-02 09:40:42.697 23609 23685 D Baresip Lib: Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,INFO,MESSAGE,UPDATE,REFER
08-02 09:40:42.697 23609 23685 D Baresip Lib: Content-Length: 0
08-02 09:40:42.697 23609 23685 D Baresip Lib: 
08-02 09:40:42.697 23609 23685 D Baresip Lib: 
08-02 09:40:42.755 23609 23685 D Baresip Lib: 09:40:42.755#
08-02 09:40:42.756 23609 23685 D Baresip Lib: UDP 208.100.60.65:5060 -> 10.183.120.46:58311
08-02 09:40:42.756 23609 23685 D Baresip Lib: SIP/2.0 401 Unauthorized
08-02 09:40:42.756 23609 23685 D Baresip Lib: Via: SIP/2.0/UDP 10.183.120.46:58311;branch=z9hG4bKf7de29bf3293492f;received=37.33.172.112;rport=7435
08-02 09:40:42.756 23609 23685 D Baresip Lib: From: <sip:test@voip.ms>;tag=f9655879279293f6
08-02 09:40:42.756 23609 23685 D Baresip Lib: To: <sip:test@voip.ms>;tag=as75d6d471
08-02 09:40:42.756 23609 23685 D Baresip Lib: Call-ID: c1bd3636bfc9c314
08-02 09:40:42.756 23609 23685 D Baresip Lib: CSeq: 59827 REGISTER
08-02 09:40:42.756 23609 23685 D Baresip Lib: Server: voip.ms
08-02 09:40:42.756 23609 23685 D Baresip Lib: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
08-02 09:40:42.756 23609 23685 D Baresip Lib: Supported: replaces, timer
08-02 09:40:42.756 23609 23685 D Baresip Lib: WWW-Authenticate: Digest algorithm=MD5, realm="amsterdam.voip.ms", nonce="23b455e7"
08-02 09:40:42.756 23609 23685 D Baresip Lib: Content-Length: 0
08-02 09:40:42.756 23609 23685 D Baresip Lib: 
08-02 09:40:42.756 23609 23685 D Baresip Lib: 
08-02 09:40:42.869 23609 23685 D Baresip Lib: 09:40:42.869#
08-02 09:40:42.869 23609 23685 D Baresip Lib: UDP 10.183.120.46:58311 -> 208.100.60.65:5060
08-02 09:40:42.869 23609 23685 D Baresip Lib: REGISTER sip:voip.ms SIP/2.0
08-02 09:40:42.869 23609 23685 D Baresip Lib: Via: SIP/2.0/UDP 10.183.120.46:58311;branch=z9hG4bKd23bacfade1a93e7;rport
08-02 09:40:42.870 23609 23685 D Baresip Lib: Contact: <sip:test-0xb4000071b8f77990@10.183.120.46:58311>;expires=900;+sip.instance="<urn:uuid:0779cd67-79b3-e54a-fd87-a37ef33
08-02 09:40:42.870 23609 23685 D Baresip Lib: 482cd>";q=0.5;reg-id=1
08-02 09:40:42.870 23609 23685 D Baresip Lib: Max-Forwards: 70
08-02 09:40:42.870 23609 23685 D Baresip Lib: Authorization: Digest username="test", realm="amsterdam.voip.ms", nonce="23b455e7", uri="sip:voip.ms", response="90a22754b68829
08-02 09:40:42.870 23609 23685 D Baresip Lib: 629d1a14d43a8eeb4e", algorithm=MD5
08-02 09:40:42.870 23609 23685 D Baresip Lib: Route: <sip:amsterdam1.voip.ms;lr>
08-02 09:40:42.870 23609 23685 D Baresip Lib: To: <sip:test@voip.ms>
08-02 09:40:42.870 23609 23685 D Baresip Lib: From: <sip:test@voip.ms>;tag=f9655879279293f6
08-02 09:40:42.870 23609 23685 D Baresip Lib: Call-ID: c1bd3636bfc9c314
08-02 09:40:42.870 23609 23685 D Baresip Lib: CSeq: 59828 REGISTER
08-02 09:40:42.870 23609 23685 D Baresip Lib: User-Agent: baresip v60.4.1 (Android 14/aarch64)
08-02 09:40:42.870 23609 23685 D Baresip Lib: Supported: gruu, outbound, path
08-02 09:40:42.870 23609 23685 D Baresip Lib: Allow: INVITE,ACK,BYE,CANCEL,OPTIONS,NOTIFY,INFO,MESSAGE,UPDATE,REFER
08-02 09:40:42.870 23609 23685 D Baresip Lib: Content-Length: 0
08-02 09:40:42.870 23609 23685 D Baresip Lib: 
08-02 09:40:42.871 23609 23685 D Baresip Lib: 
08-02 09:40:42.928 23609 23685 D Baresip Lib: 09:40:42.928#
08-02 09:40:42.929 23609 23685 D Baresip Lib: UDP 208.100.60.65:5060 -> 10.183.120.46:58311
08-02 09:40:42.929 23609 23685 D Baresip Lib: SIP/2.0 403 Forbidden
08-02 09:40:42.929 23609 23685 D Baresip Lib: Via: SIP/2.0/UDP 10.183.120.46:58311;branch=z9hG4bKd23bacfade1a93e7;received=37.33.172.112;rport=7435
08-02 09:40:42.929 23609 23685 D Baresip Lib: From: <sip:test@voip.ms>;tag=f9655879279293f6
08-02 09:40:42.929 23609 23685 D Baresip Lib: To: <sip:test@voip.ms>;tag=as75d6d471
08-02 09:40:42.929 23609 23685 D Baresip Lib: Call-ID: c1bd3636bfc9c314
08-02 09:40:42.929 23609 23685 D Baresip Lib: CSeq: 59828 REGISTER
08-02 09:40:42.929 23609 23685 D Baresip Lib: Server: voip.ms
08-02 09:40:42.929 23609 23685 D Baresip Lib: Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
08-02 09:40:42.929 23609 23685 D Baresip Lib: Supported: replaces, timer
08-02 09:40:42.930 23609 23685 D Baresip Lib: Content-Length: 0
08-02 09:40:42.930 23609 23685 D Baresip Lib: 
08-02 09:40:42.930 23609 23685 D Baresip Lib: 
08-02 09:40:42.930 23609 23685 D Baresip Lib: reg: sip:test@voip.ms (prio 0): 403 Forbidden (voip.ms)

As you see, I got back first 401 Unauthorized and after that 403 Forbidden. If there would be an issue of using baresip over cellular network, lots of users had already reported it.

So what you experience is most likely somehow related to your device configuration or your cellular network subscription.

xandark commented 2 months ago

Thank you so much for looking into this for me. I did some tests and you are right, baresip over cellular is not the issue. I need to dig deeper. I will close this issue.