diff options
author | Daniil Baturin <daniil.baturin@vyatta.com> | 2011-12-16 06:57:29 +0700 |
---|---|---|
committer | Daniil Baturin <daniil.baturin@vyatta.com> | 2011-12-16 06:57:29 +0700 |
commit | 7b98a85b8b777182e698d0c2c4e668fa90245555 (patch) | |
tree | af77560ff0160833b970055b87e63d63c75e1599 | |
parent | c85dcc4ee106e1ba5324cf29b52f33e4872820c6 (diff) | |
download | vyatta-conntrack-7b98a85b8b777182e698d0c2c4e668fa90245555.tar.gz vyatta-conntrack-7b98a85b8b777182e698d0c2c4e668fa90245555.zip |
Dirty hack for SIP port option.
-rw-r--r-- | templates-cfg/system/conntrack/modules/sip/node.def | 16 | ||||
-rw-r--r-- | templates-cfg/system/conntrack/modules/sip/port/node.def | 2 |
2 files changed, 14 insertions, 4 deletions
diff --git a/templates-cfg/system/conntrack/modules/sip/node.def b/templates-cfg/system/conntrack/modules/sip/node.def index b5a3225..121d7a4 100644 --- a/templates-cfg/system/conntrack/modules/sip/node.def +++ b/templates-cfg/system/conntrack/modules/sip/node.def @@ -1,8 +1,12 @@ help: SIP connection tracking settings -end: /bin/cli-shell-api existsEffective system conntrack modules sip disable && exit 0 +end: /bin/cli-shell-api exists system conntrack modules sip disable && exit 0 reload=0 sdm=2 + defaultport=5060 + portopt="ports=" + portval="" + if [ -f /sys/module/nf_conntrack_sip/parameters/sip_direct_media ]; then sdm=$(sudo cat /sys/module/nf_conntrack_sip/parameters/sip_direct_media) fi @@ -34,13 +38,21 @@ end: /bin/cli-shell-api existsEffective system conntrack modules sip disable && fi (( numports++ )) done - portopt="ports=$portval" if [ $numports -gt 8 ]; then echo "Error: Can not specify more than 8 ports." exit 1 fi reload=1 fi + if [ "$portval" != "" ]; then + portopt="${portopt}$portval" + else + portopt="${portopt}$defaultport" + fi + + if [ "$COMMIT_ACTION" == "DELETE" ]; then + reload=1 + fi if [ -f /etc/modprobe.d/options ]; then sudo sed -i '/nf_conntrack_sip/d' /etc/modprobe.d/options diff --git a/templates-cfg/system/conntrack/modules/sip/port/node.def b/templates-cfg/system/conntrack/modules/sip/port/node.def index 78a0f07..b72f1ca 100644 --- a/templates-cfg/system/conntrack/modules/sip/port/node.def +++ b/templates-cfg/system/conntrack/modules/sip/port/node.def @@ -3,8 +3,6 @@ type: u32 help: Port number that SIP traffic is carried on -default: 5060 - val_help: u32:1-65535; SIP port number syntax:expression: ($VAR(@) >= 1 && $VAR(@) <=65535) ; "Port number must be in range 1 to 65535" |