Opened 11 years ago

Closed 11 years ago

Last modified 10 years ago

#1643 closed enhancement (fixed)

CLI integration

Reported by: riza Owned by: bennylp
Priority: normal Milestone: release-2.2
Component: pjlib-util Version: trunk
Keywords: Cc:
Backport to 1.x milestone: Backported: no

Description (last modified by riza)

A CLI framework features an interface for defining command specification, parsing, and executing a command.


  • Portable across desktop (windows, macosx, linux, etc) and mobile platforms (symbian, windows mobile, iphone, android, etc.)
  • User may access the UI by telneting to the app, and be able to operate the app as if it's a desktop app

Enhancements to existing console UI

  • Command (auto)completion, e.g. one can specify "makecall" or "make" or "m". The system will detect if a fraction of a word makes up unique command
  • arguments completion, i.e. user may specify the arguments together with the command, or if not, he will be asked to provide them.
  • command history (the use of up and down arrow)

Telnet interface

  • will provide interface exactly the same as console interface on desktop
  • may provide different logging level for each client

Command specification

The command specification includes:

  • Definition in an xml file
  • Command/argument name
  • Command/argument id
  • Argument data type (int, string, choice)
  • Argument mandatory type (optional/mandatory)
  • Text description (to show in help screen)
  • Each command could contain argument list or other command
  • Callback handler

XML example of a command specification:

<CMD name='vid' id='0' desc="">
       <CMD name='help' id='0' desc='' />
       <CMD name='enable' id='0' desc='' />
       <CMD name='disable' id='0' desc='' />
       <CMD name='call' id='0' desc='' >
                <CMD name='add' id='101' desc='...' />
                <CMD name='cap' id='102' desc='...' >
                   <ARG name='streamno' type='int' desc='...' id='1'/>
                   <ARG name='devid' type='int' optional='1' id='2'/>
<CMD name='disable_codec' id=0 desc="">
	<ARG name='codec_list' type='choice' id='3'>
	    <CHOICE value='g711'/>
	    <CHOICE value='g722'/>

Change History (13)

comment:1 Changed 11 years ago by riza

  • Description modified (diff)

comment:2 Changed 11 years ago by riza

In 4440:

Re #1643: add initial support for CLI

comment:3 Changed 11 years ago by bennylp

In 4459:

More re #1643: changed svn file type property to native

comment:4 Changed 11 years ago by riza

In 4461:

Re #1643: Code restructure+add callback to support symbian gui app

comment:5 Changed 11 years ago by riza

In 4476:

Re #1643: Code restructure + modification to handle non blocking mode

comment:6 Changed 11 years ago by riza

In 4489:

Re #1643: Modification to avoid namespace conflict with pjsua

comment:7 Changed 11 years ago by riza

In 4513:

Re #1643: - Modification to shortcut handling(execution&display).

  • Add exact match check to the parse input command process.

comment:8 Changed 11 years ago by riza

In 4522:

Re #1643:

  • Fix duplicate shortcut for video commands
  • Fix restart command bug on legacy mode
  • Fix restart bug when using add-buddy options

comment:9 Changed 11 years ago by riza

In 4525:

Re #1643: Restore configuration reset with added modification on app destroy. It was deleted from code to enable cli retain config values when restarted

comment:10 Changed 11 years ago by riza

In 4589:

Re #1643: Fix crash due to insufficient command buffer size in get_cmd_name()

comment:11 Changed 11 years ago by riza

In 4634:

Re #1643: Fix some build warnings detected on VS2012

comment:12 Changed 11 years ago by bennylp

  • Resolution set to fixed
  • Status changed from new to closed

comment:13 Changed 10 years ago by ming

In 4752:

Re #1643: Fixed accidental removal of pj_run_app() call

Note: See TracTickets for help on using tickets.