|
@@ -231,6 +231,51 @@ def acc_list(ctx, oformat, ostyle, limit):
|
|
ioutils_dbres_print(ctx, oformat, ostyle, res)
|
|
ioutils_dbres_print(ctx, oformat, ostyle, res)
|
|
|
|
|
|
|
|
|
|
|
|
[email protected](
|
|
|
|
+ "mc-list",
|
|
|
|
+ short_help="List missed calls records",
|
|
|
|
+)
|
|
|
|
[email protected](
|
|
|
|
+ "oformat",
|
|
|
|
+ "--output-format",
|
|
|
|
+ "-F",
|
|
|
|
+ type=click.Choice(["raw", "json", "table", "dict"]),
|
|
|
|
+ default=None,
|
|
|
|
+ help="Format the output",
|
|
|
|
+)
|
|
|
|
[email protected](
|
|
|
|
+ "ostyle",
|
|
|
|
+ "--output-style",
|
|
|
|
+ "-S",
|
|
|
|
+ default=None,
|
|
|
|
+ help="Style of the output (tabulate table format)",
|
|
|
|
+)
|
|
|
|
[email protected](
|
|
|
|
+ "limit",
|
|
|
|
+ "--limit",
|
|
|
|
+ "-l",
|
|
|
|
+ type=int,
|
|
|
|
+ default=20,
|
|
|
|
+ help="The limit of listed records (default: 20)",
|
|
|
|
+)
|
|
|
|
+@pass_context
|
|
|
|
+def acc_mc_list(ctx, oformat, ostyle, limit):
|
|
|
|
+ """List missed calls records
|
|
|
|
+
|
|
|
|
+ \b
|
|
|
|
+ """
|
|
|
|
+ e = create_engine(ctx.gconfig.get("db", "rwurl"))
|
|
|
|
+ ctx.vlog("Showing missed calls records")
|
|
|
|
+ query = ""
|
|
|
|
+ if limit == 0:
|
|
|
|
+ query = "select * from missed_calls order by id desc"
|
|
|
|
+ else:
|
|
|
|
+ query = "select * from missed_calls order by id desc limit {0}".format(limit)
|
|
|
|
+ res = e.execute(query)
|
|
|
|
+ ioutils_dbres_print(ctx, oformat, ostyle, res)
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
@cli.command(
|
|
@cli.command(
|
|
"cdrs-generate",
|
|
"cdrs-generate",
|
|
short_help="Run SQL stored procedure to generate CDRS",
|
|
short_help="Run SQL stored procedure to generate CDRS",
|