--- a/oneaccess.gramar Tue Aug 21 12:42:51 2012 +0200
+++ b/oneaccess.gramar Tue Aug 21 13:01:44 2012 +0200
@@ -59,6 +59,7 @@
line: s_controller
| s_interface
| s_voice_port
+ | s_dial_peer
| l_vrf
| l_sntp
| l_syslog
@@ -242,3 +243,24 @@
| "modify-tone" identifier /\S+/
{ $arg{ctx}->{$item[1]}->{$item{identifier}} = $item[3] }
+# dial peers
+s_dial_peer: "0" "dial-peer" "voice" word num eol s_dial_peer_l[ctx => ctx('dial-peer', $item{word}.":".$item{num}), type => $item{word}, num => $item{num} ](s) "0" "exit" eol
+
+s_dial_peer_l: "1" s_dial_peer_content[ctx => $arg{ctx}] eol
+ {
+ $arg{ctx}->{type} = $arg{type};
+ $arg{ctx}->{num} = $arg{num}
+ }
+ | l_section
+
+s_dial_peer_content: identifier word
+ {
+ if ($item[1] eq 'no') {
+ $arg{ctx}->{$item[2]} = 0;
+ } else {
+ $arg{ctx}->{$item[1]} = $item[2];
+ }
+ }
+ | identifier
+ { $arg{ctx}->{$item[1]} = 1 }
+