[svn-commits] branch oej/sdpcleanup r32429 -
/team/oej/sdpcleanup/channels/chan_sip.c
svn-commits at lists.digium.com
svn-commits at lists.digium.com
Mon Jun 5 15:07:50 MST 2006
Author: oej
Date: Mon Jun 5 17:07:49 2006
New Revision: 32429
URL: http://svn.digium.com/view/asterisk?rev=32429&view=rev
Log:
- Changing variable names to something meaningful
- Moving t= (time) back on track for all calls (thanks vechers!)
Modified:
team/oej/sdpcleanup/channels/chan_sip.c
Modified: team/oej/sdpcleanup/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/oej/sdpcleanup/channels/chan_sip.c?rev=32429&r1=32428&r2=32429&view=diff
==============================================================================
--- team/oej/sdpcleanup/channels/chan_sip.c (original)
+++ team/oej/sdpcleanup/channels/chan_sip.c Mon Jun 5 17:07:49 2006
@@ -5078,17 +5078,17 @@
struct sockaddr_in vdest = { 0, };
/* SDP fields */
- char *v = "v=0\r\n"; /* Version */
+ char *version = "v=0\r\n"; /* Protocol version */
char *subject = "s=session\r\n"; /* Subject of the session */
- char o[256];
- char c[256]; /* Connection data */
- char *t = "";
- char b[256] = ""; /* Max bitrate */
+ char owner[256]; /* Session owner/creator */
+ char connection[256]; /* Connection data */
+ char *stime = "t=0 0\r\n"; /* Time the session is active */
+ char bandwidth[256] = ""; /* Max bitrate */
char *hold;
- char m_audio[256]; /* Media declaration line for audio */
- char m_video[256]; /* Media declaration line for video */
- char a_audio[1024]; /* Attributes for audio */
- char a_video[1024]; /* Attributes for video */
+ char m_audio[256]; /* Media declaration line for audio */
+ char m_video[256]; /* Media declaration line for video */
+ char a_audio[1024]; /* Attributes for audio */
+ char a_video[1024]; /* Attributes for video */
char *m_audio_next = m_audio;
char *m_video_next = m_video;
size_t m_audio_left = sizeof(m_audio);
@@ -5101,14 +5101,11 @@
char iabuf[INET_ADDRSTRLEN];
int x;
int capability;
- int debug;
int needvideo = FALSE;
+ int debug = sip_debug_test_pvt(p);
m_video[0] = '\0'; /* Reset the video media string if it's not needed */
-
- debug = sip_debug_test_pvt(p);
-
- len = 0;
+
if (!p->rtp) {
ast_log(LOG_WARNING, "No way to add SDP without an RTP structure\n");
return -1;
@@ -5160,7 +5157,6 @@
/* Ok, we need video. Let's add what we need for video and set codecs.
Video is handled differently than audio since we can not transcode. */
if (needvideo) {
- t = "t=0 0\r\n";
ast_build_string(&m_video_next, &m_video_left, "m=video %d RTP/AVP", ntohs(vdest.sin_port));
/* Determine video destination */
@@ -5174,7 +5170,7 @@
/* Build max bitrate string */
if (p->maxcallbitrate)
- snprintf(b, sizeof(b), "b=CT:%d\r\n", p->maxcallbitrate);
+ snprintf(bandwidth, sizeof(bandwidth), "b=CT:%d\r\n", p->maxcallbitrate);
if (debug)
ast_verbose("Video is at %s port %d\n", ast_inet_ntoa(iabuf, sizeof(iabuf), p->ourip), ntohs(vsin.sin_port));
@@ -5210,8 +5206,8 @@
/* We break with the "recommendation" and send our IP, in order that our
peer doesn't have to ast_gethostbyname() us */
- snprintf(o, sizeof(o), "o=root %d %d IN IP4 %s\r\n", p->sessionid, p->sessionversion, ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr));
- snprintf(c, sizeof(c), "c=IN IP4 %s\r\n", ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr));
+ snprintf(owner, sizeof(owner), "o=asterisk.org %d %d IN IP4 %s\r\n", p->sessionid, p->sessionversion, ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr));
+ snprintf(connection, sizeof(connection), "c=IN IP4 %s\r\n", ast_inet_ntoa(iabuf, sizeof(iabuf), dest.sin_addr));
ast_build_string(&m_audio_next, &m_audio_left, "m=audio %d RTP/AVP", ntohs(dest.sin_port));
if (ast_test_flag(&p->flags[0], SIP_CALL_ONHOLD))
@@ -5303,19 +5299,19 @@
if (needvideo)
ast_build_string(&m_video_next, &m_video_left, "\r\n");
- len = strlen(v) + strlen(subject) + strlen(o) + strlen(c) + strlen(t) + strlen(m_audio) + strlen(a_audio) + strlen(hold);
+ len = strlen(version) + strlen(subject) + strlen(owner) + strlen(connection) + strlen(stime) + strlen(m_audio) + strlen(a_audio) + strlen(hold);
if (needvideo) /* only if video response is appropriate */
- len += strlen(m_video) + strlen(a_video) + strlen(b) + strlen(hold);
+ len += strlen(m_video) + strlen(a_video) + strlen(bandwidth) + strlen(hold);
add_header(resp, "Content-Type", "application/sdp");
add_header_contentLength(resp, len);
- add_line(resp, v);
- add_line(resp, o);
+ add_line(resp, version);
+ add_line(resp, owner);
add_line(resp, subject);
- add_line(resp, c);
- if (needvideo) /* only if video response is appropriate */
- add_line(resp, b);
- add_line(resp, t);
+ add_line(resp, connection);
+ if (needvideo) /* only if video response is appropriate */
+ add_line(resp, bandwidth);
+ add_line(resp, stime);
add_line(resp, m_audio);
add_line(resp, a_audio);
add_line(resp, hold);
More information about the svn-commits
mailing list