From: Joshua Colp Date: Sun, 26 Jan 2014 02:10:22 +0000 (+0000) Subject: res_pjsip_session: Be less strict with core requested outgoing capabilities. X-Git-Tag: 12.1.0-rc1~3^2~45 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c573b00ea18068ef1c443dc4ff090f491b68f831;p=thirdparty%2Fasterisk.git res_pjsip_session: Be less strict with core requested outgoing capabilities. The core may (depending on circumstances) request a single codec on outgoing calls. Many channel drivers ignore or treat this as a suggestion while still including configured codecs. The res_pjsip_session logic treated this as an explicit request, leaving out other configured codecs. This change makes res_pjsip_session behave like other channel driver and simply adds the requested codec to the list. (closes issue ASTERISK-23082) Reported by: xrobau Review: https://reviewboard.asterisk.org/r/3140/ git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/12@406489 65c4cc65-6c06-0410-ace0-fbb531ad65f3 --- diff --git a/res/res_pjsip_session.c b/res/res_pjsip_session.c index 03d2e577af..3ad34de78f 100644 --- a/res/res_pjsip_session.c +++ b/res/res_pjsip_session.c @@ -1250,7 +1250,11 @@ struct ast_sip_session *ast_sip_session_create_outgoing(struct ast_sip_endpoint return NULL; } - ast_format_cap_copy(session->req_caps, req_caps); + if (!ast_format_cap_is_empty(req_caps)) { + ast_format_cap_copy(session->req_caps, session->endpoint->media.codecs); + ast_format_cap_append(session->req_caps, req_caps); + } + if ((pjsip_dlg_add_usage(dlg, &session_module, NULL) != PJ_SUCCESS)) { pjsip_inv_terminate(inv_session, 500, PJ_FALSE); /* Since we are not notifying ourselves that the INVITE session is being terminated