diff options
-rw-r--r-- | asterisk.c | 9 | ||||
-rw-r--r-- | channels/chan_sip.c | 2 | ||||
-rw-r--r-- | rtp.c | 13 |
3 files changed, 21 insertions, 3 deletions
diff --git a/asterisk.c b/asterisk.c index 0ec8f9979..4a0e77885 100644 --- a/asterisk.c +++ b/asterisk.c @@ -75,9 +75,12 @@ #include <grp.h> #include <pwd.h> #include <sys/stat.h> -#include <sys/prctl.h> #include <regex.h> +#ifdef linux +#include <sys/prctl.h> +#endif + #if defined(__FreeBSD__) || defined( __NetBSD__ ) || defined(SOLARIS) #include <netdb.h> #endif @@ -2210,12 +2213,16 @@ int main(int argc, char *argv[]) #endif /* __CYGWIN__ */ +#ifdef linux + if (geteuid() && option_dumpcore) { if (prctl(PR_SET_DUMPABLE, 1, 0, 0, 0) < 0) { ast_log(LOG_WARNING, "Unable to set the process for core dumps after changing to a non-root user. %s\n", strerror(errno)); } } +#endif + term_init(); printf(term_end()); fflush(stdout); diff --git a/channels/chan_sip.c b/channels/chan_sip.c index 95f58015c..0f1f35b5a 100644 --- a/channels/chan_sip.c +++ b/channels/chan_sip.c @@ -4371,7 +4371,7 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p) ast_log(LOG_WARNING, "No way to add SDP without an RTP structure\n"); return -1; } - capability = p->capability; + capability = p->jointcapability; if (!p->sessionid) { p->sessionid = getpid(); @@ -1,7 +1,7 @@ /* * Asterisk -- An open source telephony toolkit. * - * Copyright (C) 1999 - 2006, Digium, Inc. + * Copyright (C) 1999 - 2005, Digium, Inc. * * Mark Spencer <markster@digium.com> * @@ -811,6 +811,17 @@ int ast_rtp_lookup_code(struct ast_rtp* rtp, const int isAstFormat, const int co return rtp->rtp_lookup_code_cache_result; } + /* Check the dynamic list first */ + for (pt = 0; pt < MAX_RTP_PT; ++pt) { + if (rtp->current_RTP_PT[pt].code == code && rtp->current_RTP_PT[pt].isAstFormat == isAstFormat) { + rtp->rtp_lookup_code_cache_isAstFormat = isAstFormat; + rtp->rtp_lookup_code_cache_code = code; + rtp->rtp_lookup_code_cache_result = pt; + return pt; + } + } + + /* Then the static list */ for (pt = 0; pt < MAX_RTP_PT; ++pt) { if (static_RTP_PT[pt].code == code && static_RTP_PT[pt].isAstFormat == isAstFormat) { rtp->rtp_lookup_code_cache_isAstFormat = isAstFormat; |