Browse Source

TT#107565 add `replace-session-name` option

Change-Id: I10d89f3bf8e88fb953cc7cc7fffae056bf0092c3
pull/1218/head
Richard Fuchs 5 years ago
parent
commit
3791b8f595
6 changed files with 30 additions and 1 deletions
  1. +4
    -0
      README.md
  2. +3
    -0
      daemon/call_interfaces.c
  3. +19
    -0
      daemon/sdp.c
  4. +1
    -0
      include/call.h
  5. +1
    -0
      include/call_interfaces.h
  6. +2
    -1
      utils/rtpengine-ng-client

+ 4
- 0
README.md View File

@ -873,6 +873,10 @@ Optionally included keys are:
the `o=` line always remains the same in all SDPs going to a
particular RTP endpoint.
- `session name` or `session-name`
Same as `username` but for the entire contents of the `s=` line.
- `zero address`
Using a zero endpoint address is an obsolete way to signal a


+ 3
- 0
daemon/call_interfaces.c View File

@ -713,6 +713,9 @@ static void call_ng_flags_replace(struct sdp_ng_flags *out, str *s, void *dummy)
case CSH_LOOKUP("session-connection"):
out->replace_sess_conn = 1;
break;
case CSH_LOOKUP("session-name"):
out->replace_sess_name = 1;
break;
case CSH_LOOKUP("sdp-version"):
out->replace_sdp_version = 1;
break;


+ 19
- 0
daemon/sdp.c View File

@ -53,6 +53,7 @@ struct sdp_attributes {
struct sdp_session {
str s;
struct sdp_origin origin;
str session_name;
struct sdp_connection connection;
int rr, rs;
struct sdp_attributes attributes;
@ -1204,6 +1205,12 @@ new_session:
break;
case 's':
errstr = "s= line found within media section";
if (media)
goto error;
session->session_name = value_str;
break;
case 'i':
case 'u':
case 'e':
@ -2477,6 +2484,18 @@ int sdp_replace(struct sdp_chopper *chop, GQueue *sessions, struct call_monologu
monologue->sdp_version = ssl_random();
}
err = "error while processing s= line";
if (!monologue->sdp_session_name)
monologue->sdp_session_name = call_strdup_len(monologue->call, session->session_name.s,
session->session_name.len);
else if (flags->replace_sess_name) {
if (copy_up_to(chop, &session->session_name))
goto error;
chopper_append_c(chop, monologue->sdp_session_name);
if (skip_over(chop, &session->session_name))
goto error;
}
sess_conn = 0;
if (flags->replace_sess_conn)
sess_conn = 1;


+ 1
- 0
include/call.h View File

@ -375,6 +375,7 @@ struct call_monologue {
unsigned long long sdp_version;
GString *last_sdp;
char *sdp_username;
char *sdp_session_name;
unsigned int block_dtmf:1;
unsigned int block_media:1;


+ 1
- 0
include/call_interfaces.h View File

@ -75,6 +75,7 @@ struct sdp_ng_flags {
replace_sess_conn:1,
replace_sdp_version:1,
replace_username:1,
replace_sess_name:1,
replace_zero_address:1,
rtcp_mux_offer:1,
rtcp_mux_require:1,


+ 2
- 1
utils/rtpengine-ng-client View File

@ -30,6 +30,7 @@ GetOptions(
'replace-session-connection' => \$options{'replace-session connection'},
'replace-sdp-version' => \$options{'replace-sdp version'},
'replace-username' => \$options{'replace-username'},
'replace-session-name' => \$options{'replace-session-name'},
'client-address=s' => \$options{'client-address'},
'sdp=s' => \$options{'sdp'},
'sdp-file=s' => \$options{'sdp-file'},
@ -102,7 +103,7 @@ for my $x (split(/,/, 'TOS,delete-delay')) {
for my $x (split(/,/, 'trust address,symmetric,asymmetric,unidirectional,force,strict source,media handover,sip source address,reset,port latching,no rtcp attribute,full rtcp attribute,loop protect,record call,always transcode,all,pad crypto,generate mid,fragment,original sendrecv,symmetric codecs,asymmetric codecs,inject DTMF,generate RTCP,single codec,reorder codecs')) {
defined($options{$x}) and push(@{$packet{flags}}, $x);
}
for my $x (split(/,/, 'origin,session connection,sdp version,username')) {
for my $x (split(/,/, 'origin,session connection,sdp version,username,session-name')) {
defined($options{'replace-' . $x}) and push(@{$packet{replace}}, $x);
}
for my $x (split(/,/, 'rtcp-mux,SDES,supports,T.38,OSRTP')) {


Loading…
Cancel
Save