mgw: Use official Titan SDP library for encode/decode of SDP in MGCP

This commit is contained in:
Harald Welte 2017-09-14 22:43:08 +08:00
parent 2871d0b000
commit 12000e2a7a
4 changed files with 24 additions and 31 deletions

View File

@ -65,7 +65,7 @@ module MGCP_Types {
type record MgcpCommand {
MgcpCommandLine line,
MgcpParameterList params optional,
Sdp sdp optional
SDP_Message sdp optional
} with {
variant "BEGIN('')"
variant (sdp) "BEGIN('\r\n','([\r\n])|(\r\n)')"
@ -89,7 +89,7 @@ module MGCP_Types {
type record MgcpResponse {
MgcpResponseLine line,
MgcpParameterList params optional,
Sdp sdp optional
SDP_Message sdp optional
} with {
variant "BEGIN('')"
variant (sdp) "BEGIN('\r\n','([\r\n])|(\r\n)')"

View File

@ -1,28 +0,0 @@
module SDP_Types {
type char SdpTag;
type record SdpLine {
SdpTag tag,
charstring val
} with {
variant "BEGIN('')"
variant "SEPARATOR('=')"
variant "END('\r\n')"
};
type record of SdpLine SdpLineList with {
variant "BEGIN('')"
};
type record Sdp {
SdpLineList lines
} with {
variant "BEGIN('')"
};
external function enc_Sdp(in Sdp id) return charstring
with { extension "prototype(convert) encode(TEXT)" };
external function dec_Sdp(in charstring id) return Sdp
with { extension "prototype(convert) decode(TEXT)" };
} with { encode "TEXT" }

21
mgw/gen_links.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
BASEDIR=~/projects/git
gen_links() {
DIR=$1
FILES=$*
for f in $FILES; do
echo "Linking $f"
ln -sf $DIR/$f $f
done
}
#DIR=$BASEDIR/titan.TestPorts.UNIX_DOMAIN_SOCKETasp/src
#FILES="UD_PT.cc UD_PT.hh UD_PortType.ttcn UD_Types.ttcn"
#gen_links $DIR $FILES
DIR=$BASEDIR/titan.ProtocolModules.SDP/src
FILES="SDP_EncDec.cc SDP_Types.ttcn SDP_parse_.tab.c SDP_parse_.tab.h SDP_parse_parser.h SDP_parser.l
SDP_parser.y lex.SDP_parse_.c"
gen_links $DIR $FILES

View File

@ -1,6 +1,6 @@
#!/bin/sh
FILES="*.ttcn"
FILES="*.ttcn SDP_EncDec.cc *.c"
ttcn3_makefilegen -f MGCP_Test.ttcn $FILES
sed -i -e 's/# TTCN3_DIR = /TTCN3_DIR = \/usr/' Makefile