Adding a new command in CLI

Hi everyone…

This is my first posting. I am really desperate to know how I can add a new command in CLI (I am using Asterisk 1.4.1) ?

For say, I want when I type “greeting today”, then the output will be “Hello world”…

I have been searching in cli.c, but it’s pretty hard for me to read the code…

I really need help from you guys…

Thank You
Fadil

Reading cli.c is not really where you want to be for an example of this. I would recommend looking at the code in one of the modules that registers a new CLI command.

For example, take a look at res_clioriginate.c. That module registers a single CLI command, and also uses tab completion.

Thank you…

I’ll take a look at it…