res_pjsip: Updates and adds more PJSIP CLI commands.

* Adds identify, transport, and registration support to the PJSIP CLI.

* Creates three additional callbacks, one for an iterator, one for a
comparator, and one for a container.  This eliminates the link dependency
from higher level modules to lower level ones.

* Eliminates duplicate sorting in PJSIP CLI commands.

* Cleans up PJSIP CLI output formatting.

* Pushes CLI command registration down to the implementing source file.

* Adds several ast_sip_destroy_sorcery functions to complement existing
ast_sip_sorcery_initialize functions.  The destroy functions unregister
PJSIP CLI commands and PJSIP CLI formatters.

Reported by: George Joseph

Review: https://reviewboard.asterisk.org/r/3104/
........

Merged revisions 407568 from http://svn.asterisk.org/svn/asterisk/branches/12


git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@407573 65c4cc65-6c06-0410-ace0-fbb531ad65f3
This commit is contained in:
Richard Mudgett
2014-02-06 17:55:45 +00:00
parent 8ff02ac951
commit b5ca213e34
14 changed files with 792 additions and 269 deletions

View File

@@ -576,6 +576,7 @@ static int cli_on_contact(void *obj, void *arg, void *data, int flags)
struct ast_sip_contact *contact = obj;
struct ast_sip_endpoint *endpoint = data;
int *cli_fd = arg;
ast_cli(*cli_fd, " contact %s\n", contact->uri);
qualify_contact(endpoint, contact);
return 0;
@@ -765,8 +766,10 @@ static int sched_qualifies_cmp_fn(void *obj, void *arg, int flags)
ast_sorcery_object_get_id(arg));
}
int ast_sip_initialize_sorcery_qualify(struct ast_sorcery *sorcery)
int ast_sip_initialize_sorcery_qualify(void)
{
struct ast_sorcery *sorcery = ast_sip_get_sorcery();
/* initialize sorcery ast_sip_contact_status resource */
ast_sorcery_apply_default(sorcery, CONTACT_STATUS, "memory", NULL);