Module: sip-router
Branch: master
Commit: 639fce79466baf77bbd707eb9cef6473dcb3eb7c
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=639fce7…
Author: Richard Fuchs <rfuchs(a)sipwise.com>
Committer: Richard Fuchs <rfuchs(a)sipwise.com>
Date: Wed Jul 2 14:53:36 2014 -0400
rtpengine: add support for TOS=... flag
---
modules/rtpengine/doc/rtpengine_admin.xml | 8 ++++++++
modules/rtpengine/rtpengine.c | 2 ++
2 files changed, 10 insertions(+), 0 deletions(-)
diff --git a/modules/rtpengine/doc/rtpengine_admin.xml
b/modules/rtpengine/doc/rtpengine_admin.xml
index b9f62d4..7c35611 100644
--- a/modules/rtpengine/doc/rtpengine_admin.xml
+++ b/modules/rtpengine/doc/rtpengine_admin.xml
@@ -469,6 +469,14 @@ rtpengine_offer();
<emphasis>media-address=...</emphasis> - force a particular media address
to
be used in the &sdp; body. Address family is detected automatically.
</para></listitem>
+ <listitem><para>
+ <emphasis>TOS=...</emphasis> - change the IP TOS value for all outgoing
RTP
+ packets within the entire call in both directions. Only honoured in an
+ <quote>offer</quote>, ignored for an <quote>answer</quote>.
Valid values are
+ 0 through 255, given in decimal. If this option is not specified, the TOS
+ value will revert to the default TOS (normally 184). A value of -1 may be used
+ to leave the currently used TOS unchanged.
+ </para></listitem>
</itemizedlist>
</listitem>
</itemizedlist>
diff --git a/modules/rtpengine/rtpengine.c b/modules/rtpengine/rtpengine.c
index 334688b..ce2bc78 100644
--- a/modules/rtpengine/rtpengine.c
+++ b/modules/rtpengine/rtpengine.c
@@ -1188,6 +1188,8 @@ static int parse_flags(struct ng_flags_parse *ng_flags, struct
sip_msg *msg, enu
ng_flags->transport |= 0x100;
ng_flags->transport &= ~0x002;
}
+ else if (str_eq(&key, "TOS") && val.s)
+ bencode_dictionary_add_integer(ng_flags->dict, "TOS", atoi(val.s));
else
goto generic;
goto next;