oneaccess.gramar: voice ports
authorTomas Zeman <tzeman@volny.cz>
Tue, 21 Aug 2012 12:42:51 +0200
changeset 40 dd3906ea5dc6
parent 39 b39ab9900b24
child 41 7a33198be930
oneaccess.gramar: voice ports
oneaccess.gramar
--- a/oneaccess.gramar	Tue Aug 21 12:22:33 2012 +0200
+++ b/oneaccess.gramar	Tue Aug 21 12:42:51 2012 +0200
@@ -58,6 +58,7 @@
 
 line: 		s_controller
 		| s_interface
+		| s_voice_port
 		| l_vrf
 		| l_sntp
 		| l_syslog
@@ -226,5 +227,18 @@
 
 l_syslog:	"0" "syslog" "server" ip num via_iface[ctx => ctx('syslog', 'server', $item{ip})] eol
 		| "0" "logging" "syslog" /\w+/ eol
-		{ $::res->{syslog}->{level} = $item[4]; }
+		{ $::res->{syslog}->{level} = $item[4] }
+
+# voice ports
+s_voice_port:	"0" "voice-port" /\d+\/\d+/ eol s_voice_port_l[ctx => ctx('voice-port', $item[3])](s) "0" "exit" eol
+
+s_voice_port_l:	"1" s_voice_port_content[ctx => $arg{ctx}] eol
+		| l_section
 
+s_voice_port_content: /clock-source|tone|caller-id/ identifier
+		{ $arg{ctx}->{$item[1]} = $item{identifier} }
+		| /(no)?/ /sntp-time|power-source-one/
+		{ $arg{ctx}->{$item[2]} = ($item[1] eq 'no') ? 0 : 1 }
+		| "modify-tone" identifier /\S+/
+		{ $arg{ctx}->{$item[1]}->{$item{identifier}} = $item[3] }
+