Thu Feb 20 07:00:00 CET 2003

git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@619 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Matteo Brancaleoni
2003-02-20 06:00:14 +00:00
parent cf3b725fe9
commit 48130719cb
3 changed files with 24 additions and 3 deletions

View File

@@ -395,6 +395,7 @@ static void quit_handler(int num, int nice, int safeshutdown, int restart)
ast_verbose("Asterisk %s ending (%d).\n", ast_active_channels() ? "uncleanly" : "cleanly", num);
else if (option_debug)
ast_log(LOG_DEBUG, "Asterisk ending (%d).\n", num);
manager_event(EVENT_FLAG_SYSTEM, "Shutdown", "Shutdown: %s\r\nRestart: %s\r\n", ast_active_channels() ? "Uncleanly" : "Cleanly", restart ? "True" : "False");
if (ast_socket > -1) {
close(ast_socket);
ast_socket = -1;

View File

@@ -1632,8 +1632,10 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p, struct ast_rtp *
{
int len;
int codec;
int alreadysent = 0;
char costr[80];
struct sockaddr_in sin;
struct sip_codec_pref *cur;
char v[256];
char s[256];
char o[256];
@@ -1665,8 +1667,25 @@ static int add_sdp(struct sip_request *resp, struct sip_pvt *p, struct ast_rtp *
snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", inet_ntoa(dest.sin_addr));
snprintf(t, sizeof(t), "t=0 0\r\n");
snprintf(m, sizeof(m), "m=audio %d RTP/AVP", ntohs(dest.sin_port));
/* Start by sending our preferred codecs */
cur = prefs;
while(cur) {
if (p->capability & cur->codec) {
if (sipdebug)
ast_verbose("Answering with preferred capability %d\n", cur->codec);
if ((codec = ast2rtp(cur->codec)) > -1) {
snprintf(costr, sizeof(costr), " %d", codec);
strcat(m, costr);
snprintf(costr, sizeof(costr), "a=rtpmap:%d %s/8000\r\n", codec, ast2rtpn(x));
strcat(a, costr);
}
}
alreadysent |= cur->codec;
cur = cur->next;
}
/* Now send anything else in no particular order */
for (x=1;x<= AST_FORMAT_MAX_AUDIO; x <<= 1) {
if (p->capability & x) {
if ((p->capability & x) && !(alreadysent & x)) {
if (sipdebug)
ast_verbose("Answering with capability %d\n", x);
if ((codec = ast2rtp(x)) > -1) {

5
rtp.c
View File

@@ -592,11 +592,12 @@ static int ast_rtp_raw_write(struct ast_rtp *rtp, struct ast_frame *f, int codec
/* Re-calculate last TS */
rtp->lastts = ms * 8;
#if 0 /* XXX Experiment -- Make timestamp always relative XXX */
/* If it's close to ou prediction, go for it */
if (abs(rtp->lastts - pred) < 640)
#endif
rtp->lastts = pred;
#if 1
#if 0
else
printf("Difference is %d, ms is %d\n", abs(rtp->lastts - pred), ms);
#endif