tomek-o / tSIP

SIP softphone
https://tomeko.net/software/SIPclient/
157 stars 34 forks source link

Not sending correct DTMF format #12

Closed aeri closed 4 years ago

aeri commented 4 years ago

First of all, congratulations on your job, it's great.

When i try to use the numeric keyboard to send a DTMF tone, the server not catch it.

It seems that uses a different format than RFC2833 and SIP INFO.

When i capture the log with other software that sends correctly the DTMF tones this is the result:

22:04:46,298: Generate DTMF: 1 22:04:46,298: Facility Request: 19 00 01 00 80 80 F2 0B 01 01 01 00 01 00 0A 03 00 64 00 3C 00 01 31 00 00 22:04:46,298: Facility (DTMF Send) Request (1) 22:04:46,299: Facility Confirm: 11 00 01 00 80 81 F2 0B 01 00 00 00 00 00 01 00 00 22:04:46,299: Facility Confirm (DTMF)

I think that the DTMFs format is generated as inband tone.

Could the following format be implemented in the software? Thank you :)

tomek-o commented 4 years ago

There might be one more possibility other than inband - SIP INFO with "dtmf" (not "dtmf-relay") payload. Could you capture with Wireshark what the other, working softphone is actually sending? To make is easy to decode audio use G.711a or G.711u (a-law/u-law) codec and start capturing with Wireshark before starting the call. What PABX are you using? Is it configurable / do you have access to configuration?

aeri commented 4 years ago

The problem is that the PABX is from my ISP, they do not provide technical information about the SIP and of course I can't configure any parameters.

The software that i have been using before was PhonerLite and they say this:

G.711 codec is negotiated AND the Option "SendOptionalInbandDTMF" is enabled (default is on), the DTMFs will be generated as inband tone. else: SIP INFO

When i use that software the codec by default is G.711a, maybe it's because of the lack of this codec?

I'm gonna try to do the capture with that software and upload it to pastebin.

aeri commented 4 years ago

https://pastebin.com/GcFCapCy This is the full log with PhonerLite since the SIP is registered, call, press number 7 and hang. You need a more low-level record with Wireshark?

tomek-o commented 4 years ago

G.711 codec is negotiated AND the Option "SendOptionalInbandDTMF" is enabled (default is on), the DTMFs will be generated as inband tone. else: SIP INFO

It's very likely that inband is used then. It specifies here that inband is used when G.711 is used as G.711 has generally low distortion (not being "voice" specific codec like e.g. GSM), so there is low risk of tone being damaged by compression and decompression.

I have one new feature open at the moment and I would like to finish it first, then I'll look into inband DTMF or some workaround (switching to wave file just to play DTMF would probably work, but it would be somehow hacky). This would probably take at least few days though.

aeri commented 4 years ago

Thank you for the fastest support. Your work is amazing.

tomek-o commented 4 years ago

Inband DTMF is now available in account settings. This is slightly modified https://github.com/hselasky/baresip/commit/84afa6778e32b3b2c7dea0b1af9c179987ea3dee commit. Seems to work with my "antique" PABX, let me know if this works for you. Commit: https://github.com/tomek-o/tSIP/commit/f3bca8bc29dd52c7065a5d06fd865f4bc11fbf37. Updated exe is at http://tomeko.net/tmp/tSIP.exe.

aeri commented 4 years ago

I just tried it and it worked perfectly. Thank you very much for the support and the quick management. :+1: