From 162acd45f744395c19ec5686af30d0abd61ef897 Mon Sep 17 00:00:00 2001 From: George Joseph Date: Tue, 20 Oct 2015 15:02:30 -0600 Subject: res_pjsip: Add "like" processing to pjsip list and show commands Add the ability to filter output from pjsip list and show commands using the "like" predicate like chan_sip. For endpoints, aors, auths, registrations, identifyies and transports, the modification was a simple change of an ast_sorcery_retrieve_by_fields call to ast_sorcery_retrieve_by_regex. For channels and contacts a little more work had to be done because neither of those objects are true sorcery objects. That was just removing the non-matching object from the final container. Of course, a little extra plumbing in the common pjsip_cli code was needed to parse the "like" and pass the regex to the get_container callbacks. Some of the get_container code in res_pjsip_endpoint_identifier was also refactored for simplicity. ASTERISK-25477 #close Reported by: Bryant Zimmerman Tested by: George Joseph Change-Id: I646d9326b778aac26bb3e2bcd7fa1346d24434f1 --- include/asterisk/res_pjsip_cli.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') diff --git a/include/asterisk/res_pjsip_cli.h b/include/asterisk/res_pjsip_cli.h index 44979b701..c2535218a 100644 --- a/include/asterisk/res_pjsip_cli.h +++ b/include/asterisk/res_pjsip_cli.h @@ -61,7 +61,7 @@ struct ast_sip_cli_formatter_entry { /*! The callback used to print the details of the object. */ ao2_callback_fn *print_body; /*! The function used to retrieve a container of all objects of this type. */ - struct ao2_container *(* get_container)(void); + struct ao2_container *(* get_container)(const char *regex); /*! The function used to iterate over a container of objects. */ int (* iterate)(void *container, ao2_callback_fn callback, void *args); /*! The function used to retrieve a specific object from it's container. */ -- cgit v1.2.3