[asterisk-dev] asterisk 16 / pjsip: SDP handling on outbound calls - unnecessary transcoding

Michael Maier m1278468 at mailbox.org
Sat Jun 22 14:39:40 CDT 2019


Hello!

On outbound calls, the codecs for the subsequent INVITE to the ISP are derived from the codecs defined for the trunk and from the received INVITE from the local device.

The codecs presented by the ISP in 200 OK seem to be ignored unfortunately later on.

E.g.:
direct_media				disabled
Local endpoint definition: 		g722, alaw, ulaw
Trunk definition: 			g722, alaw, ulaw

Outbound call:
Initial INVITE from local endpoint: 	g722, alaw, ulaw, g726

Subsequent INVITE to ISP: 		g722, alaw, ulaw (the codecs are derived from the initial INVITE and the codecs defined for the trunk)
Response from ISP: 200 OK: 		alaw

200 OK to local endpoint: 		g722, alaw, ulaw (based on initial INVITE and local endpoint definition - the 200 OK from the ISP is ignored)

=> asterisk has to transcode between g722 <-> alaw


Is there any chance to get the codec information of the ISP during building the 200 OK for the local endpoint in handle_negotiated_sdp_session_media() or maybe somewhere else? Or did I miss something else? I want to remove g722 in 200 OK to
local endpoint.






Same call - but reverse direction (inbound):

Initial INVITE from ISP: 		alaw

Subsequent INVITE to local endpoint: 	alaw, g722, ulaw (the codecs are derived from the initial INVITE and the codecs defined for the local endpoint)

200 OK from local endpoint: alaw

200 OK to ISP: alaw

=> no transcoding necessary.



Thanks,
Michael



More information about the asterisk-dev mailing list