From 12000e2a7af64577efc6bdb52f43acfcf57c981b Mon Sep 17 00:00:00 2001 From: Harald Welte Date: Thu, 14 Sep 2017 22:43:08 +0800 Subject: [PATCH] mgw: Use official Titan SDP library for encode/decode of SDP in MGCP --- mgw/MGCP_Types.ttcn | 4 ++-- mgw/SDP_Types.ttcn | 28 ---------------------------- mgw/gen_links.sh | 21 +++++++++++++++++++++ mgw/regen_makefile.sh | 2 +- 4 files changed, 24 insertions(+), 31 deletions(-) delete mode 100644 mgw/SDP_Types.ttcn create mode 100755 mgw/gen_links.sh diff --git a/mgw/MGCP_Types.ttcn b/mgw/MGCP_Types.ttcn index efe76200b..9b55659c5 100644 --- a/mgw/MGCP_Types.ttcn +++ b/mgw/MGCP_Types.ttcn @@ -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)')" diff --git a/mgw/SDP_Types.ttcn b/mgw/SDP_Types.ttcn deleted file mode 100644 index 02e2f415e..000000000 --- a/mgw/SDP_Types.ttcn +++ /dev/null @@ -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" } diff --git a/mgw/gen_links.sh b/mgw/gen_links.sh new file mode 100755 index 000000000..b60aeefec --- /dev/null +++ b/mgw/gen_links.sh @@ -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 diff --git a/mgw/regen_makefile.sh b/mgw/regen_makefile.sh index 098299d9f..8b68b2f87 100755 --- a/mgw/regen_makefile.sh +++ b/mgw/regen_makefile.sh @@ -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