[Freeswitch-svn] [commit] r4980 - freeswitch/trunk/src/mod/endpoints/mod_sofia
Freeswitch SVN
anthm at freeswitch.org
Thu Apr 19 18:49:01 EDT 2007
Author: anthm
Date: Thu Apr 19 18:49:01 2007
New Revision: 4980
Modified:
freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
Log:
update
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/mod_sofia.h Thu Apr 19 18:49:01 2007
@@ -312,6 +312,8 @@
nua_handle_t *nh;
nua_handle_t *nh2;
sip_contact_t *contact;
+ uint32_t owner_id;
+ uint32_t session_id;
/** VIDEO **/
switch_frame_t video_read_frame;
switch_codec_t video_read_codec;
Modified: freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c
==============================================================================
--- freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c (original)
+++ freeswitch/trunk/src/mod/endpoints/mod_sofia/sofia_glue.c Thu Apr 19 18:49:01 2007
@@ -40,7 +40,6 @@
void sofia_glue_set_local_sdp(private_object_t *tech_pvt, char *ip, uint32_t port, char *sr, int force)
{
char buf[2048];
- switch_time_t now = switch_time_now();
int ptime = 0;
int rate = 0;
uint32_t v_port;
@@ -65,14 +64,24 @@
sr = "sendrecv";
}
+ if (!tech_pvt->owner_id) {
+ tech_pvt->owner_id = (uint32_t) time(NULL) - port;
+ }
+
+ if (!tech_pvt->session_id) {
+ tech_pvt->session_id = tech_pvt->owner_id ;
+ }
+
+ tech_pvt->session_id++;
+
snprintf(buf, sizeof(buf),
"v=0\n"
- "o=FreeSWITCH %d%" SWITCH_TIME_T_FMT " %d%" SWITCH_TIME_T_FMT " IN IP4 %s\n"
+ "o=FreeSWITCH %010u %010u IN IP4 %s\n"
"s=FreeSWITCH\n"
"c=IN IP4 %s\n" "t=0 0\n"
"a=%s\n"
- "m=audio %d RTP/AVP", port, now, port, now, ip, ip, sr, port);
-
+ "m=audio %d RTP/AVP", tech_pvt->owner_id, tech_pvt->session_id, ip, ip, sr, port);
+
if (tech_pvt->rm_encoding) {
snprintf(buf + strlen(buf), sizeof(buf) - strlen(buf), " %d", tech_pvt->pt);
} else if (tech_pvt->num_codecs) {
@@ -277,7 +286,7 @@
{
if (tech_pvt->num_codecs && !switch_test_flag(tech_pvt, TFLAG_VIDEO)) {
int i;
-
+ tech_pvt->video_count = 0;
for (i = 0; i < tech_pvt->num_codecs; i++) {
if (tech_pvt->codecs[i]->codec_type == SWITCH_CODEC_TYPE_VIDEO) {
tech_pvt->video_count++;
More information about the Freeswitch-svn
mailing list