s1p

Rating: 
4.92857
Your rating: None Average: 4.9 (14 votes)

s1p is an experimental SIP client for Sailfish OS

This is software in an early stage of development - please don't expect it to work with every type of SIP server out there.

It also needs a restart after any changes to the settings.

Successfully tested with Asterisk chan_sip.

Please reference the log-id when writing a comment after submittimg a log. The id should be displayed at the bottom of the page if the log was successfully submitted. 

 

Screenshots: 

Keywords:

Changelog: 

- 0.0.2 initial release

- 0.0.3 adds log page

- 0.0.4 fixes registering issues with antisip.com

- 0.0.5 adds ringtones

- 0.0.6 improves UI and makes hanging up calls more reliable

- 0.0.7 fixes some issues with sipgate (inbound calls still broken)

- 0.0.8 fixes inbound calls with sipgate (cancelling outbound calls still broken)

- 0.0.9 fixes issues with outbound calls through sipgate

- 0.1.0 improves UI

- 0.1.1 adds contacts page

- 0.1.2 adds log upload

- 0.1.3 improves logging and handling of audio packets

- 0.1.4 enables audio output selection buttons

- 0.1.5 fixes issues with audio output selection

- 0.1.6 enables mute button

- 0.1.7 adds volume presets

- 0.1.8 makes some changes to how audio frames are handled

- 0.1.9 fixes choppy audio on some phones

- 0.2.0 adds G.711 μ-law codec, (hopefully) fixes some call-state issues

- 0.2.1 adds DNS SRV record lookup

- 0.2.2 fixes call status being sometimes overwritten by regstration status

- 0.2.3 adds initial DTMF support

- 0.2.4 adds preferrence for domain instead of IP in SIP dialogs and adds auth-name field to SIP account settings

- 0.2.5 adds improvements to power consumption, audio handler and playback buffer

- 0.2.6 adds configuration-file options for latency and audio buffer length

- 0.2.7 adds configuration dialog options for latency and audio buffer length

- 0.2.8 fixes issues with setting latency and buffer length

- 0.2.9 enables voicemail button, fixes issues with number input

- 0.3.0 adds options for bind address and regsiter frequency

- 0.3.1 sets default register frequency to 1 hour

- 0.3.2 fixes regsitering with sip.linphone.org

- 0.3.3 fixes previously broken default settings

- 0.3.4 adds support for display name

- 0.3.5 fixes proxy-authentication

- 0.3.6 allows a more flexible approach to call progess messages

- 0.3.7 reinstates stricter approach to call progess messages

Comments

emsys's picture

Hello, First of all, I would like to congratulate you for taking this initiative for a long overdue feature of SFOS.

I tried to test your app on Xperia XA2 with a self hosted 3CX PBX installed on a Raspberry Pi in a LAN configuration. The application fails to authenticate with the PBX and gets stuck in an infinite authentication loop until SFOS flags the application as non-responsive and hence offers to terminate the application. The app gets stuck on subsequent restarts since it gets stuck in the authentication loop, and hence I cannot extract/send the log file from within the app.

However, I started the app from command line and was able to capture the debug log. What I think goes wrong is that the PBX returns a 407 Proxy Authentication Required response and s1p sends an Authorization header instead of a Proxy-Authorization header. Interesting sections in the log go like this:

b'DEBUG [SIPServer-1] Register [6696721c@192.168.1.151] - from: 152 (192.168.1.151:5060), ua: s1p, to: 152\n'
b'TRACE [SIPServer-1] WritePacket: 192.168.1.151:5060 => 192.168.1.201:5061 (REGISTER) sip:192.168.1.201;transport=UDP\n'


b'TRACE [SIPServer-1] Run - received from: 192.168.1.201:5061\n'
b'SIP/2.0 407 Proxy Authentication Required\r\n'
b'Via: SIP/2.0/UDP 192.168.1.151:5060;branch=z9hG4bK-7b4e7c02\r\n'
b'Proxy-Authenticate: Digest nonce="414d53595f0e1eec78:f11faae83a263976e10e57789a105ce5", algorithm=MD5,realm="3CXPhoneSystem"\r\n'


b'DEBUG [SIPServer-1] Register [6696721c@192.168.1.151] - from: 152 (192.168.1.151:5060), ua: s1p, to: 152\n'
b'TRACE [SIPServer-1] WritePacket: 192.168.1.151:5060 => 192.168.1.201:5061 (REGISTER) sip:192.168.1.201;transport=UDP\n'
b'Authorization: Digest username="ulzA7FZrKq",realm="3CXPhoneSystem",nonce="414d53595f0e1eec78:f11faae83a263976e10e57789a105ce5", uri="sip:192.168.1.201;transport=UDP",response="3c4ce565d5733b6522c357f2d3bc9ae3",algorithm=MD5\r\n'


b'TRACE [SIPServer-1] Run - received from: 192.168.1.201:5061\n'
b'SIP/2.0 407 Proxy Authentication Required\r\n'
b'Via: SIP/2.0/UDP 192.168.1.151:5060;branch=z9hG4bK-189eeb98\r\n'
b'Proxy-Authenticate: Digest nonce="414d53595f0e1eec20:5b99c474226d0360da759a504a02fdea", algorithm=MD5,realm="3CXPhoneSystem"\r\n'

This ping pong continues without any delay until the app is terminated by the OS.

When I compare this with the SIP registration session of my Gigaset DX800A phone with the same PBX and same extention, I indeed see that the phone sends a Proxy-Authorization header in response to 407 Proxy Authentication Required.

Here is a link to RFC2617 that also confirms this: https://tools.ietf.org/html/rfc2617#section-3.6

I have also recorded wireshark logs for both s1p and my Gigaset phone, please let me know if there is a way I can send them to you. For further testing, please feel free to contact me.

Thanks

unmaintained's picture

Could you please check if this issue occurs with version 0.3.5 as well?

emsys's picture

Thanks for the new release; I can confirm that the 0.3.5 version sends Proxy-Authorization header in response to code 407 Proxy Authentication Required during REGISTER sequence.

However, when I try to make a local call to another extension, the PBX responds again with a 407 Proxy Authentication Required code in response to the INVITE request. s1p sends ACK but never sends the INVITE again with the Proxy-Authorization header included.

When I compare this with my desk phone, I see that the phone sends the INVITE again with Proxy-Authorization header, to which the PBX then responds with 100 Trying.

I have sent the log file via s1p, log id: 28

unmaintained's picture

Thank you for providing the log dump.

Does this issue still occur with version 0.3.6 ?

emsys's picture

Thanks for the new release. With v0.3.6, I can now make and receive calls via s1p as it sends INVITE again with Proxy-Authorization header included when requested by PBX.

However, I encounter the following two issues now.

1. Call Hangup issue, log file: 29

Call hangup from within s1p does not work when a call is initiated by s1p. But if the call is terminated by the other party, then s1p can also hang up. The app status changes to "Hangup Reuqested" but the call continues on the other end unless hung up from the other side as well. s1p then returns to idle.

What I see in the wireshark logs on my PBX is that the PBX simply ignores the BYE request sent by s1p. Neither does it respond to s1p, nor does it send BYE to the other party. The call keeps going between the PBX and the other party until I end the call from the other phone. In that case, the desk phone sends BYE to PBX and PBX then sends BYE to s1p, and the call is terminated.

An interesting fact that I noted in wireshark was that if I dial s1p from my desk phone, and then end the call from the desk phone as well, I see that the phone sends Proxy-Authorization header in BYE request as well. In comparison, s1p does not include the Proxy-Authorization header when trying to terminate the call.

Another point of interest is that if s1p initiates the call, and the phone ends it, the phone does not send Proxy-Authorization header in BYE request. It only does so for the call that is initiated from the phone itself.

2.1. No Audio when receiving a call from desk phone, log file: 30

When I dial s1p from my desk phone, the call is established, but there is no call audio at all, not from the speaker, headset, or earpiece of the Xperia. There is no audio on the phone either. (Audio however works fine when the call is initiated from s1p, case 1 above)

2.2 One way audio with Nokia N9, log file: 31

I also tried to call from a Nokia N9 with its builtin SIP client. This time, there was one way audio, from N9 to s1p. However, I was able to capture the audio packets coming from s1p to the IP address of the PBX, with the PBX replying to s1p with an ICMP message that the RTP destination port is not reachable. So, instead of audio going from s1p to N9, it went from the s1p to the IP address of PBX.

In wireshark, I could see that both N9 and DX800A support the G.711 PCMA/PCMU codecs. I think something goes wrong with the RTP port exchange. I also enabled the option in the PBX to have all audio delivered via the PBX. This way, I can hear audio from both sides, but there is additional delay introduced due to extra buffering on the PBX.

Please let me know how can I assist further.
 

unmaintained's picture

Issue 1. should be fixed in 0.3.7 possibly breaking 3CX compatibility again.

3CX seems to request authentication at a stage in the call when s1p does not expect it to happen and allowing that without making significant changes to the internal logic would mess up things quite a bit (as happened with 1.) 

unmaintained's picture

s1p can perfectly do Proxy-Authorization, I guess in this case it must be thrown-off by something and is sending a fallback-response.

kayakbc's picture

Fantastic app! Kudos to you for all of your wotk so far. With your latest update this app now works great with my sip provider, Voip.ms, here in Canada. Thanks.

Bramba's picture

Anybody here has tried s1p with SIP-provider Easybell or dus.net? Registering the account works completely fine.

However, when trying an outgoing phone call, I always receive error:

DEBUG [SipServer-1] HandleResponseTerminatedOther [436456@192.168...] - call terminated with code: 482 Loop detected

PulseHandler - playback stream suspended - stream index: 0, suspended: false

unmaintained's picture

Could have been a bug with proxy authentication. Could you try it again with 0.3.6 and check if an actual loop occurs?

unmaintained's picture

Does this response "482 Loop detected" come right after the inital invite or is it preceeded by, well, a loop of some sort?

Bramba's picture

Thanks for your great support!

Yes, this error appears immediately after entering the callee phone number and tapping the "dial" button. It doesn't matter if the callee number is a mobile phone or a landline phone in this case.

The main window does always show message "Call ended" afterwards (even in case I did not end it).

unmaintained's picture

Anything changed with version 0.3.7 ?

schmolle's picture

Cool app! Thanks for your work. I would love to see this as Free Software :). Keep it up!

amaretzek's picture

How far away is "wake up display on incomming call"? ;)

unmaintained's picture

I hope once the underlying SIP communication works reliably enough I can concentrate more on the UI.

defactofactotum's picture

Confirm comment above, edited json and now it sticks. But says 'Call ended' so I'm not sure it registered

defactofactotum's picture

Exactly! My file looks like this: {}

So why on earth is it not writing to the file?

amaretzek's picture

ATM, v3.2, "~/.config/harbour-s1p/settings.json" looks like this:

{
  "accounts": [
    {
      "auth_name": "",
      "description": "default",
      "domain": "sip.example.com",
      "enabled": true,
      "name": "123456",
      "password": "secretpw",
      "register_frequency": 3600.0,
      "server_port": 5060.0
    }
  ],
  "bind_address": "0.0.0.0",
  "default_instance": 1.0,
  "playback_buffer_length": 1600.0,
  "playback_latency": 0.1,
  "playback_volume": 100.0,
  "record_buffer_length": 1600.0,
  "record_latency": 0.1,
  "record_volume": 100.0
}
defactofactotum's picture

something radically wrong here. I deleted the settings file...same behaviour. Checked settings file, 2 bytes. So nothing staying there at all.

unmaintained's picture

Super strange. Worked for me both on X and XA2+

amaretzek's picture

Verified on XA2, fresh install, doesn't save!

amaretzek's picture

Does this mean something to you?

[D] onAccepted:203 - SettingsDialog accepted
[W] unknown:205 - file:///usr/share/harbour-s1p/qml/pages/SettingsDialog.qml:205: TypeError: Type error
[1] INFO command_set_playback_volume - frame: {'value': None}
[D] unknown:0 - "PyOtherSide error: Traceback (most recent call last):\n\n  File \"/usr/share/harbour-s1p/qml/pages/s1p.py\", line 321, in command_set_playback_volume\n    args['value'] = int(args['value'])\n\nTypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'\n"
[1] INFO command_set_record_volume - frame: {'value': None}
[D] unknown:0 - "PyOtherSide error: Traceback (most recent call last):\n\n  File \"/usr/share/harbour-s1p/qml/pages/s1p.py\", line 333, in command_set_record_volume\n    args['value'] = int(args['value'])\n\nTypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'\n"
[D] onError:108 - ERROR - unhandled error received: Return value of PyObject call is NULL: Traceback (most recent call last):

  File "/usr/share/harbour-s1p/qml/pages/s1p.py", line 321, in command_set_playback_volume
    args['value'] = int(args['value'])

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'

[D] onError:108 - ERROR - unhandled error received: Return value of PyObject call is NULL: Traceback (most recent call last):

  File "/usr/share/harbour-s1p/qml/pages/s1p.py", line 333, in command_set_record_volume
    args['value'] = int(args['value'])

TypeError: int() argument must be a string, a bytes-like object or a number, not 'NoneType'
unmaintained's picture

It seems nor to create the configuration, especially no accounts sometimes. I'll try to fix that and will upload a new version later today.

amaretzek's picture

Hmmm, before there is:

[D] onError:108 - ERROR - unhandled error received: pyotherside.send() failed handler: file:///usr/share/harbour-s1p/qml/pages/PythonHandler.qml:116: TypeError: Cannot read property '0' of undefined
[W] unknown:232 - file:///usr/share/harbour-s1p/qml/pages/SettingsDialog.qml:232: TypeError: Cannot read property 'NaN' of undefined
unmaintained's picture

Could you please try it with version 0.3.3  ?

amaretzek's picture

version 0.3.3 solves this issue. Great!

defactofactotum's picture

Still no luck, the settings info is lost every time and no registration on XA2. On a newly reset X it's the same, but thanks for helping....

unmaintained's picture

You could try to delete s1p configuration completely and start from scratch:

rm /home/nemo/.config/harbour-s1p/settings.json

I've been able to succesfully register with sip.linphone.org so this may be more of an issue with configuration than with registration.

 

 

amaretzek's picture

Doesn't work via UI. It works if you edit the file. Verified on a fresh install on JP1 v3.2. Also, latency and buffers should come with defaults.

Pages