Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Several Frames per Payload (affected user agent: MicroSIP) #16

Open
bfoot2018 opened this issue Aug 28, 2018 · 4 comments
Open

Several Frames per Payload (affected user agent: MicroSIP) #16

bfoot2018 opened this issue Aug 28, 2018 · 4 comments

Comments

@bfoot2018
Copy link

Hi Alexander,

The discussion is started in #15 (comment). Followed your recommendation and created new separate issue.

Have upgraded MicroSIP to the latest MicroSIP-3.19.7.exe https://www.microsip.org/downloads/?file=MicroSIP-3.19.7.exe. The issue with recording AMR is gone. Pl check successfull OK pcap / wav in attached zip.

Have tried AMR-WB and got garbled audio pl check NOK files. Could you pl describe how you compute real packetization time from raw RTP? In both cases asterisk answers with a=maxptime:20 in 200 OK / SDP.

amr_recording_tests.zip

@bfoot2018
Copy link
Author

Asterisk 13.22.0 outputs:

Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007424, ts 030720, len 000083)
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007425, ts 031360, len 000083)
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007426, ts 032000, len 000083)
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007427, ts 032640, len 000083)
    -- Executing [5005@public:3] Record("SIP/6002-00000012", "asterisk-recording%d:wav,0,100,q") in new stack
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007428, ts 033280, len 000083)
[Aug 28 14:36:46] WARNING[17229][C-00000015]: codec_amr.c:236 amrtolin_framein: multiple frames per packet were not tested
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007429, ts 033920, len 000083)
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007430, ts 034560, len 000083)
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007431, ts 035200, len 000083)
Got  RTP packet from    192.168.5.33:4006 (type 121, seq 007432, ts 035840, len 000083)

@traud
Copy link
Owner

traud commented Aug 29, 2018

describe how you compute real packetization time from raw RTP

The RTP Timestamp.
In case of AMR-WB (16 kHz) with one 20ms frame, the timestamp increases by 320.
In case of AMR (8 kHz) with one 20ms frame, the timestamp increases by 160.
Anyway, that is not the problem here. In case of AMR(-WB), the frames are prepended with a jump-table. With one frame, I was able to ignore that jump table. With more than one frame, I have to parse it and extract each frame. This is AMR(-WB) specific stuff/code. Other audio codecs simply prepend the frames; the decoder is aware of this because of the RTP payload length.

asterisk answers with a=maxptime:20

Yes, you could argue that MicroSIP is doing a protocol violation here. However, a decoder has to cope with any amount of frames. My module does not support that because I had no implementation which did several-frames-per-payload, yet. Therefore, I am happy to get aware of such an implementation. Anyway, the solution to this takes several months because coding that is not that easy – although what is missing is ‘just’ a jump-table parser.

@bfoot2018
Copy link
Author

Thanks for your detailed explanation. Is it possible to contact you via skype/email privately? Need your consultations on AMR/AMR-WB features - have AMR-WB spec for some product and need to find out what features are supported by your patch.

@traud
Copy link
Owner

traud commented Aug 30, 2018

On GitHub, you can see the E-mail address of a contributor by opening his commit and add .patch to the end of the URL, for example: https://github.com/traud/asterisk-amr/commit/72fddba0ae9e799fa13232d99ea1524548e141d9.patch. However, the ‘What is missing’ section in the README plus the other open issues is all I know.

@traud traud changed the title Asterisk fails to record AMR-WB sent by MicroSIP 3.18.15 Several Frames per Payload (affected user agent: MicroSIP) Aug 31, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants