diff options
Diffstat (limited to 'channels/chan_sip.c')
-rw-r--r-- | channels/chan_sip.c | 29 |
1 files changed, 17 insertions, 12 deletions
diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 85701634c..5030af453 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -10964,22 +10964,25 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action if (portno != -1 || vportno != -1 || tportno != -1) { /* We are now ready to change the sip session and RTP structures with the offered codecs, since they are acceptable */ + unsigned int framing; ast_format_cap_remove_by_type(p->jointcaps, AST_MEDIA_TYPE_UNKNOWN); ast_format_cap_append_from_cap(p->jointcaps, newjointcapability, AST_MEDIA_TYPE_UNKNOWN); /* Our joint codec profile for this call */ ast_format_cap_remove_by_type(p->peercaps, AST_MEDIA_TYPE_UNKNOWN); ast_format_cap_append_from_cap(p->peercaps, newpeercapability, AST_MEDIA_TYPE_UNKNOWN); /* The other side's capability in latest offer */ p->jointnoncodeccapability = newnoncodeccapability; /* DTMF capabilities */ + tmp_fmt = ast_format_cap_get_format(p->jointcaps, 0); + framing = ast_format_cap_get_format_framing(p->jointcaps, tmp_fmt); /* respond with single most preferred joint codec, limiting the other side's choice */ if (ast_test_flag(&p->flags[1], SIP_PAGE2_PREFERRED_CODEC)) { - unsigned int framing; - - tmp_fmt = ast_format_cap_get_format(p->jointcaps, 0); - framing = ast_format_cap_get_format_framing(p->jointcaps, tmp_fmt); ast_format_cap_remove_by_type(p->jointcaps, AST_MEDIA_TYPE_UNKNOWN); ast_format_cap_append(p->jointcaps, tmp_fmt, framing); - ao2_ref(tmp_fmt, -1); } + if (!ast_rtp_codecs_get_framing(&newaudiortp)) { + /* Peer did not force us to use a specific framing, so use our own */ + ast_rtp_codecs_set_framing(&newaudiortp, framing); + } + ao2_ref(tmp_fmt, -1); } /* Setup audio address and port */ @@ -11488,6 +11491,7 @@ static int process_sdp_a_audio(const char *a, struct sip_pvt *p, struct ast_rtp_ if (framing && p->autoframing) { ast_debug(1, "Setting framing to %ld\n", framing); ast_format_cap_set_framing(p->caps, framing); + ast_rtp_codecs_set_framing(newaudiortp, framing); } found = TRUE; } else if (sscanf(a, "rtpmap: %30u %127[^/]/%30u", &codec, mimeSubtype, &sample_rate) == 3) { @@ -22475,7 +22479,7 @@ static void sip_dump_history(struct sip_pvt *dialog) return; } - if (!option_debug && !sipdebug) { + if (!sipdebug && !DEBUG_ATLEAST(1)) { if (!errmsg) { ast_log(LOG_NOTICE, "You must have debugging enabled (SIP or Asterisk) in order to dump SIP history.\n"); errmsg = 1; @@ -22483,20 +22487,20 @@ static void sip_dump_history(struct sip_pvt *dialog) return; } - ast_debug(1, "\n---------- SIP HISTORY for '%s' \n", dialog->callid); + ast_log(LOG_DEBUG, "\n---------- SIP HISTORY for '%s' \n", dialog->callid); if (dialog->subscribed) { - ast_debug(1, " * Subscription\n"); + ast_log(LOG_DEBUG, " * Subscription\n"); } else { - ast_debug(1, " * SIP Call\n"); + ast_log(LOG_DEBUG, " * SIP Call\n"); } if (dialog->history) { AST_LIST_TRAVERSE(dialog->history, hist, list) - ast_debug(1, " %-3.3d. %s\n", ++x, hist->event); + ast_log(LOG_DEBUG, " %-3.3d. %s\n", ++x, hist->event); } if (!x) { - ast_debug(1, "Call '%s' has no history\n", dialog->callid); + ast_log(LOG_DEBUG, "Call '%s' has no history\n", dialog->callid); } - ast_debug(1, "\n---------- END SIP HISTORY for '%s' \n", dialog->callid); + ast_log(LOG_DEBUG, "\n---------- END SIP HISTORY for '%s' \n", dialog->callid); } @@ -35740,5 +35744,6 @@ AST_MODULE_INFO(ASTERISK_GPL_KEY, AST_MODFLAG_LOAD_ORDER, "Session Initiation Pr .unload = unload_module, .reload = reload, .load_pri = AST_MODPRI_CHANNEL_DRIVER, + .requires = "ccss,dnsmgr,udptl", .optional_modules = "res_crypto,res_http_websocket", ); |