On 22.06.19 at 23:59 Joshua C. Colp wrote: > On Sat, Jun 22, 2019, at 4:40 PM, Michael Maier wrote: >> 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. > > There's nothing built in explicitly to do this and it's not something that > has really been scoped out. A few people have wanted such functionality, but > it hasn't been implemented. You can't really reach across and get the > information - it has to be communicated back probably through using a frame.
That's a pity. Especially because it's working as expected on inbound calls. What do you exactly mean by "using a frame"? BTW, while analyzing, I found a potentially unnecessary variable in set_caps (see patch), which never seems to be used. I removed it without any side effects yet. Thanks Michael
diff -urN asterisk-16.3.0.orig/res/res_pjsip_sdp_rtp.c asterisk-16.3.0/res/res_pjsip_sdp_rtp.c --- asterisk-16.3.0.orig/res/res_pjsip_sdp_rtp.c 2019-04-04 16:49:57.000000000 +0200 +++ asterisk-16.3.0/res/res_pjsip_sdp_rtp.c 2019-06-23 06:00:47.860000000 +0200 @@ -381,7 +381,6 @@ RAII_VAR(struct ast_format_cap *, caps, NULL, ao2_cleanup); RAII_VAR(struct ast_format_cap *, peer, NULL, ao2_cleanup); RAII_VAR(struct ast_format_cap *, joint, NULL, ao2_cleanup); - RAII_VAR(struct ast_format_cap *, endpoint_caps, NULL, ao2_cleanup); enum ast_media_type media_type = session_media->type; struct ast_rtp_codecs codecs = AST_RTP_CODECS_NULL_INIT; int fmts = 0;
-- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- asterisk-dev mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-dev
