Просмотр исходного кода

cmd_dispatcher: aded subcommands for add/remove in memory records

Daniel-Constantin Mierla 5 лет назад
Родитель
Сommit
c17f3b465b
1 измененных файлов с 40 добавлено и 0 удалено
  1. 40 0
      kamcli/commands/cmd_dispatcher.py

+ 40 - 0
kamcli/commands/cmd_dispatcher.py

@@ -117,3 +117,43 @@ def dispatcher_reload(ctx):
     """
     command_ctl(ctx, 'dispatcher.reload', [ ])
 
+
+##
+#
+#
[email protected]('memadd', short_help='Add a new dispatcher destination in memory')
[email protected]('flags', '--flags', type=int, default=0,
+            help='Flags value')
[email protected]('setid', metavar='<setid>', type=int)
[email protected]('destination', metavar='<destination>')
+@pass_context
+def dispatcher_memadd(ctx, flags, setid, destination):
+    """Add a new destination in a set of dispatcher memory
+
+    \b
+    Parameters:
+        <setid> - dispatching set id
+        <destination> - SIP URI for destination
+    """
+    ctx.vlog('Adding to setid [%d] destination [%s]', setid, destination)
+    command_ctl(ctx, 'dispatcher.add', [ setid, destination, flags ])
+
+
+##
+#
+#
[email protected]('memrm', short_help='Remove a destination from dispatcher memory')
[email protected]('setid', metavar='<setid>', type=int)
[email protected]('destination', metavar='<destination>')
+@pass_context
+def dispatcher_memrm(ctx, setid, destination):
+    """Remove a destination from dispatcher memory
+
+    \b
+    Parameters:
+        <setid> - dispatching set id
+        <destination> - SIP URI for destination
+    """
+    command_ctl(ctx, 'dispatcher.remove', [ setid, destination ])
+
+