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

Fix sdp payload parser #60

Merged
merged 6 commits into from
Feb 3, 2023
Merged

Conversation

fabian-borot
Copy link
Contributor

No description provided.

@fabian-borot fabian-borot reopened this Feb 3, 2023
@fabian-borot
Copy link
Contributor Author

Adding Asterisk as another media server

@fabian-borot
Copy link
Contributor Author

This fixes an issue I found both in Freeswitch and in Asterisk. With AcmePacket SBCs, the INVITE with multiple SDPs comes like this:
1- SDP1 has several offerings (i.e. ulaw, alaw, g729, gsm)
2- SDP2 has only the codec chosen for the actual call (ulaw). So the actual call that we want to record was established using 'ulaw' in this case.

So the media server receives an INVITE from drachtio sip server with SDP1, and as such it can choose any codec form the offering, 'alaw' for example. Then when it sends the INVITE back to drachtio server it sends it with the codecs setup for that outbound endpoint but the response from the drachtio sip server chooses the one codec in its SDP2 ('ulaw'). So the media server expects 'alaw' on the A leg and 'ulaw' on the B leg.
At this point, the SBC starts sending a copy of the RTP packets, but since the call was established on 'ulaw', all the RTP packets received by the media server will be 'ulaw' packets. This causes the 'wav' file created to contain only the packets from one leg, the other ones are 'dropped'.
If you enable 'debug' logs on Asterisk you will see these messages:
[Jan 31 16:47:46] DEBUG[27197][C-0000000e] chan_pjsip.c: Oooh, got a frame with format of alaw on channel 'PJSIP/drachtio_in-0000001a' when it has not been negotiated

@davehorton davehorton merged commit fa7c408 into drachtio:main Feb 3, 2023
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

Successfully merging this pull request may close these issues.

2 participants