2 * Asterisk -- An open source telephony toolkit.
4 * Copyright (C) 2013, Digium, Inc.
6 * Matt Jordan <mjordan@digium.com>
8 * See http://www.asterisk.org for more information about
9 * the Asterisk project. Please do not directly contact
10 * any of the maintainers of this project for assistance;
11 * the project provides a web site, mailing lists and IRC
12 * channels for your use.
14 * This program is free software, distributed under the terms of
15 * the GNU General Public License Version 2. See the LICENSE file
16 * at the top of the source tree.
25 #include "asterisk/res_pjsip.h"
26 #include "asterisk/channel.h"
27 #include "asterisk/pbx.h"
28 #include "asterisk/astobj2.h"
29 #include "asterisk/cli.h"
30 #include "asterisk/time.h"
31 #include "include/res_pjsip_private.h"
33 #define DEFAULT_LANGUAGE "en"
34 #define DEFAULT_ENCODING "text/plain"
35 #define QUALIFIED_BUCKETS 211
37 static int qualify_contact(struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact);
41 * \brief Create a ast_sip_contact_status object.
43 static void *contact_status_alloc(const char *name)
45 struct ast_sip_contact_status *status = ast_sorcery_generic_alloc(sizeof(*status), NULL);
48 ast_log(LOG_ERROR, "Unable to allocate ast_sip_contact_status\n");
52 status->status = UNAVAILABLE;
59 * \brief Retrieve a ast_sip_contact_status object from sorcery creating
62 static struct ast_sip_contact_status *find_or_create_contact_status(const struct ast_sip_contact *contact)
64 struct ast_sip_contact_status *status = ast_sorcery_retrieve_by_id(
65 ast_sip_get_sorcery(), CONTACT_STATUS,
66 ast_sorcery_object_get_id(contact));
72 if (!(status = ast_sorcery_alloc(
73 ast_sip_get_sorcery(), CONTACT_STATUS,
74 ast_sorcery_object_get_id(contact)))) {
76 ast_log(LOG_ERROR, "Unable to create ast_sip_contact_status for contact %s\n",
81 if (ast_sorcery_create(ast_sip_get_sorcery(), status)) {
82 ast_log(LOG_ERROR, "Unable to persist ast_sip_contact_status for contact %s\n",
92 * \brief Update an ast_sip_contact_status's elements.
94 static void update_contact_status(const struct ast_sip_contact *contact,
95 enum ast_sip_contact_status_type value)
97 RAII_VAR(struct ast_sip_contact_status *, status,
98 find_or_create_contact_status(contact), ao2_cleanup);
100 RAII_VAR(struct ast_sip_contact_status *, update, ast_sorcery_alloc(
101 ast_sip_get_sorcery(), CONTACT_STATUS,
102 ast_sorcery_object_get_id(status)), ao2_cleanup);
105 ast_log(LOG_ERROR, "Unable to create update ast_sip_contact_status for contact %s\n",
110 update->status = value;
112 /* if the contact is available calculate the rtt as
113 the diff between the last start time and "now" */
114 update->rtt = update->status ?
115 ast_tvdiff_us(ast_tvnow(), status->rtt_start) : 0;
117 update->rtt_start = ast_tv(0, 0);
119 if (ast_sorcery_update(ast_sip_get_sorcery(), update)) {
120 ast_log(LOG_ERROR, "Unable to update ast_sip_contact_status for contact %s\n",
127 * \brief Initialize the start time on a contact status so the round
128 * trip time can be calculated upon a valid response.
130 static void init_start_time(const struct ast_sip_contact *contact)
132 RAII_VAR(struct ast_sip_contact_status *, status,
133 find_or_create_contact_status(contact), ao2_cleanup);
135 RAII_VAR(struct ast_sip_contact_status *, update, ast_sorcery_alloc(
136 ast_sip_get_sorcery(), CONTACT_STATUS,
137 ast_sorcery_object_get_id(status)), ao2_cleanup);
140 ast_log(LOG_ERROR, "Unable to create update ast_sip_contact_status for contact %s\n",
145 update->rtt_start = ast_tvnow();
147 if (ast_sorcery_update(ast_sip_get_sorcery(), update)) {
148 ast_log(LOG_ERROR, "Unable to update ast_sip_contact_status for contact %s\n",
155 * \brief For an endpoint try to match on a given contact.
157 static int on_endpoint(void *obj, void *arg, int flags)
159 struct ast_sip_endpoint *endpoint = obj;
160 char *aor_name, *aors;
162 if (!arg || ast_strlen_zero(endpoint->aors)) {
166 aors = ast_strdupa(endpoint->aors);
168 while ((aor_name = strsep(&aors, ","))) {
169 RAII_VAR(struct ast_sip_aor *, aor,
170 ast_sip_location_retrieve_aor(aor_name), ao2_cleanup);
171 RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup);
173 if (!aor || !(contacts = ast_sip_location_retrieve_aor_contacts(aor))) {
177 if (ao2_find(contacts, arg, OBJ_NODATA | OBJ_POINTER)) {
187 * \brief Find endpoints associated with the given contact.
189 static struct ao2_iterator *find_endpoints(struct ast_sip_contact *contact)
191 RAII_VAR(struct ao2_container *, endpoints,
192 ast_sip_get_endpoints(), ao2_cleanup);
194 return ao2_callback(endpoints, OBJ_MULTIPLE, on_endpoint, contact);
199 * \brief Receive an response to the qualify contact request.
201 static void qualify_contact_cb(void *token, pjsip_event *e)
203 RAII_VAR(struct ast_sip_contact *, contact, token, ao2_cleanup);
205 switch(e->body.tsx_state.type) {
206 case PJSIP_EVENT_TRANSPORT_ERROR:
207 case PJSIP_EVENT_TIMER:
208 update_contact_status(contact, UNAVAILABLE);
211 update_contact_status(contact, AVAILABLE);
218 * \brief Attempt to qualify the contact
220 * \detail Sends a SIP OPTIONS request to the given contact in order to make
221 * sure that contact is available.
223 static int qualify_contact(struct ast_sip_endpoint *endpoint, struct ast_sip_contact *contact)
225 pjsip_tx_data *tdata;
226 RAII_VAR(struct ast_sip_endpoint *, endpoint_local, ao2_bump(endpoint), ao2_cleanup);
229 if (!endpoint_local) {
230 struct ao2_iterator *endpoint_iterator = find_endpoints(contact);
232 /* try to find endpoints that are associated with the contact */
233 if (endpoint_iterator) {
234 /* find "first" endpoint in order to authenticate - actually any
235 endpoint should do that matched on the contact */
236 endpoint_local = ao2_iterator_next(endpoint_iterator);
237 ao2_iterator_destroy(endpoint_iterator);
241 if (ast_sip_create_request("OPTIONS", NULL, NULL, NULL, contact, &tdata)) {
242 ast_log(LOG_ERROR, "Unable to create request to qualify contact %s\n",
247 /* If an outbound proxy is specified set it on this request */
248 if (!ast_strlen_zero(contact->outbound_proxy) &&
249 ast_sip_set_outbound_proxy(tdata, contact->outbound_proxy)) {
250 pjsip_tx_data_dec_ref(tdata);
251 ast_log(LOG_ERROR, "Unable to apply outbound proxy on request to qualify contact %s\n",
256 init_start_time(contact);
258 ao2_ref(contact, +1);
259 if (ast_sip_send_request(tdata, NULL, endpoint_local, contact,
260 qualify_contact_cb) != PJ_SUCCESS) {
261 /* The callback will be called so we don't need to drop the contact ref*/
262 ast_log(LOG_ERROR, "Unable to send request to qualify contact %s\n",
272 * \brief Scheduling context for sending QUALIFY request at specified intervals.
274 static struct ast_sched_context *sched;
278 * \brief Container to hold all actively scheduled qualifies.
280 static struct ao2_container *sched_qualifies;
284 * \brief Structure to hold qualify contact scheduling information.
287 /*! The scheduling id */
289 /*! The the contact being checked */
290 struct ast_sip_contact *contact;
295 * \brief Destroy the scheduled data and remove from scheduler.
297 static void sched_data_destructor(void *obj)
299 struct sched_data *data = obj;
300 ao2_cleanup(data->contact);
304 * \brief Create the scheduling data object.
306 static struct sched_data *sched_data_create(struct ast_sip_contact *contact)
308 struct sched_data *data = ao2_alloc(sizeof(*data), sched_data_destructor);
311 ast_log(LOG_ERROR, "Unable to create schedule qualify data\n");
315 data->contact = contact;
316 ao2_ref(data->contact, +1);
323 * \brief Send a qualify contact request within a threaded task.
325 static int qualify_contact_task(void *obj)
327 RAII_VAR(struct ast_sip_contact *, contact, obj, ao2_cleanup);
328 return qualify_contact(NULL, contact);
333 * \brief Send a scheduled qualify contact request.
335 static int qualify_contact_sched(const void *obj)
337 struct sched_data *data = (struct sched_data *)obj;
339 ao2_ref(data->contact, +1);
340 if (ast_sip_push_task(NULL, qualify_contact_task, data->contact)) {
341 ao2_ref(data->contact, -1);
346 return data->contact->qualify_frequency * 1000;
351 * \brief Set up a scheduled qualify contact check.
353 static void schedule_qualify(struct ast_sip_contact *contact)
355 RAII_VAR(struct sched_data *, data, sched_data_create(contact), ao2_cleanup);
362 if ((data->id = ast_sched_add_variable(
363 sched, contact->qualify_frequency * 1000,
364 qualify_contact_sched, data, 1)) < 0) {
367 ast_log(LOG_ERROR, "Unable to schedule qualify for contact %s\n",
372 ao2_link(sched_qualifies, data);
377 * \brief Remove the contact from the scheduler.
379 static void unschedule_qualify(struct ast_sip_contact *contact)
381 RAII_VAR(struct sched_data *, data, ao2_find(
382 sched_qualifies, contact, OBJ_UNLINK), ao2_cleanup);
388 AST_SCHED_DEL_UNREF(sched, data->id, ao2_cleanup(data));
393 * \brief Qualify the given contact and set up scheduling if configured.
395 static void qualify_and_schedule(struct ast_sip_contact *contact)
397 unschedule_qualify(contact);
399 if (contact->qualify_frequency) {
400 ao2_ref(contact, +1);
401 ast_sip_push_task(NULL, qualify_contact_task, contact);
403 schedule_qualify(contact);
409 * \brief A new contact has been created make sure it is available.
411 static void contact_created(const void *obj)
413 qualify_and_schedule((struct ast_sip_contact *)obj);
418 * \brief A contact has been deleted remove status tracking.
420 static void contact_deleted(const void *obj)
422 struct ast_sip_contact *contact = (struct ast_sip_contact *)obj;
423 RAII_VAR(struct ast_sip_contact_status *, status, NULL, ao2_cleanup);
425 unschedule_qualify(contact);
427 if (!(status = ast_sorcery_retrieve_by_id(
428 ast_sip_get_sorcery(), CONTACT_STATUS,
429 ast_sorcery_object_get_id(contact)))) {
433 if (ast_sorcery_delete(ast_sip_get_sorcery(), status)) {
434 ast_log(LOG_ERROR, "Unable to delete ast_sip_contact_status for contact %s\n",
439 static const struct ast_sorcery_observer contact_observer = {
440 .created = contact_created,
441 .deleted = contact_deleted
444 static pj_bool_t options_start(void)
446 if (!(sched = ast_sched_context_create()) ||
447 ast_sched_start_thread(sched)) {
454 static pj_bool_t options_stop(void)
456 ast_sorcery_observer_remove(ast_sip_get_sorcery(), "contact", &contact_observer);
458 ao2_t_ref(sched_qualifies, -1, "Remove scheduled qualifies on module stop");
461 ast_sched_context_destroy(sched);
467 static pj_status_t send_options_response(pjsip_rx_data *rdata, int code)
469 pjsip_endpoint *endpt = ast_sip_get_pjsip_endpoint();
470 pjsip_dialog *dlg = pjsip_rdata_get_dlg(rdata);
471 pjsip_transaction *trans = pjsip_rdata_get_tsx(rdata);
472 pjsip_tx_data *tdata;
473 const pjsip_hdr *hdr;
474 pjsip_response_addr res_addr;
477 /* Make the response object */
478 if ((status = ast_sip_create_response(rdata, code, NULL, &tdata) != PJ_SUCCESS)) {
479 ast_log(LOG_ERROR, "Unable to create response (%d)\n", status);
483 /* Add appropriate headers */
484 if ((hdr = pjsip_endpt_get_capability(endpt, PJSIP_H_ACCEPT, NULL))) {
485 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr));
487 if ((hdr = pjsip_endpt_get_capability(endpt, PJSIP_H_ALLOW, NULL))) {
488 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr));
490 if ((hdr = pjsip_endpt_get_capability(endpt, PJSIP_H_SUPPORTED, NULL))) {
491 pjsip_msg_add_hdr(tdata->msg, (pjsip_hdr*)pjsip_hdr_clone(tdata->pool, hdr));
495 * XXX TODO: pjsip doesn't care a lot about either of these headers -
496 * while it provides specific methods to create them, they are defined
497 * to be the standard string header creation. We never did add them
498 * in chan_sip, although RFC 3261 says they SHOULD. Hard coded here.
500 ast_sip_add_header(tdata, "Accept-Encoding", DEFAULT_ENCODING);
501 ast_sip_add_header(tdata, "Accept-Language", DEFAULT_LANGUAGE);
504 status = pjsip_dlg_send_response(dlg, trans, tdata);
506 /* Get where to send request. */
507 if ((status = pjsip_get_response_addr(
508 tdata->pool, rdata, &res_addr)) != PJ_SUCCESS) {
509 ast_log(LOG_ERROR, "Unable to get response address (%d)\n",
512 pjsip_tx_data_dec_ref(tdata);
515 status = ast_sip_send_response(&res_addr, tdata,
516 ast_pjsip_rdata_get_endpoint(rdata));
519 if (status != PJ_SUCCESS) {
520 ast_log(LOG_ERROR, "Unable to send response (%d)\n", status);
526 static pj_bool_t options_on_rx_request(pjsip_rx_data *rdata)
528 RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
530 pjsip_sip_uri *sip_ruri;
531 char exten[AST_MAX_EXTENSION];
533 if (pjsip_method_cmp(&rdata->msg_info.msg->line.req.method,
534 &pjsip_options_method)) {
538 if (!(endpoint = ast_pjsip_rdata_get_endpoint(rdata))) {
542 ruri = rdata->msg_info.msg->line.req.uri;
543 if (!PJSIP_URI_SCHEME_IS_SIP(ruri) && !PJSIP_URI_SCHEME_IS_SIPS(ruri)) {
544 send_options_response(rdata, 416);
548 sip_ruri = pjsip_uri_get_uri(ruri);
549 ast_copy_pj_str(exten, &sip_ruri->user, sizeof(exten));
551 if (ast_shutting_down()) {
552 send_options_response(rdata, 503);
553 } else if (!ast_exists_extension(NULL, endpoint->context, exten, 1, NULL)) {
554 send_options_response(rdata, 404);
556 send_options_response(rdata, 200);
561 static pjsip_module options_module = {
562 .name = {"Options Module", 14},
564 .priority = PJSIP_MOD_PRIORITY_APPLICATION,
565 .start = options_start,
566 .stop = options_stop,
567 .on_rx_request = options_on_rx_request,
572 * \brief Send qualify request to the given contact.
574 static int cli_on_contact(void *obj, void *arg, void *data, int flags)
576 struct ast_sip_contact *contact = obj;
577 struct ast_sip_endpoint *endpoint = data;
579 ast_cli(*cli_fd, " contact %s\n", contact->uri);
580 qualify_contact(endpoint, contact);
585 * \brief Data pushed to threadpool to qualify endpoints from the CLI
587 struct qualify_data {
588 /*! Endpoint that is being qualified */
589 struct ast_sip_endpoint *endpoint;
590 /*! CLI File descriptor for printing messages */
594 static struct qualify_data *qualify_data_alloc(struct ast_sip_endpoint *endpoint, int cli_fd)
596 struct qualify_data *qual_data;
598 qual_data = ast_malloc(sizeof(*qual_data));
603 qual_data->endpoint = ao2_bump(endpoint);
604 qual_data->cli_fd = cli_fd;
608 static void qualify_data_destroy(struct qualify_data *qual_data)
610 ao2_cleanup(qual_data->endpoint);
616 * \brief For an endpoint iterate over and qualify all aors/contacts
618 static int cli_qualify_contacts(void *data)
620 char *aor_name, *aors;
621 RAII_VAR(struct qualify_data *, qual_data, data, qualify_data_destroy);
622 struct ast_sip_endpoint *endpoint = qual_data->endpoint;
623 int cli_fd = qual_data->cli_fd;
624 const char *endpoint_name = ast_sorcery_object_get_id(endpoint);
626 if (ast_strlen_zero(endpoint->aors)) {
627 ast_cli(cli_fd, "Endpoint %s has no AoR's configured\n",
632 aors = ast_strdupa(endpoint->aors);
634 while ((aor_name = strsep(&aors, ","))) {
635 RAII_VAR(struct ast_sip_aor *, aor,
636 ast_sip_location_retrieve_aor(aor_name), ao2_cleanup);
637 RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup);
639 if (!aor || !(contacts = ast_sip_location_retrieve_aor_contacts(aor))) {
643 ast_cli(cli_fd, "Sending qualify to endpoint %s\n", endpoint_name);
644 ao2_callback_data(contacts, OBJ_NODATA, cli_on_contact, &cli_fd, endpoint);
649 static char *cli_qualify(struct ast_cli_entry *e, int cmd, struct ast_cli_args *a)
651 RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
652 const char *endpoint_name;
653 struct qualify_data *qual_data;
657 e->command = "pjsip qualify";
659 "Usage: pjsip qualify <endpoint>\n"
660 " Send a SIP OPTIONS request to all contacts on the endpoint.\n";
667 return CLI_SHOWUSAGE;
670 endpoint_name = a->argv[2];
672 if (!(endpoint = ast_sorcery_retrieve_by_id(
673 ast_sip_get_sorcery(), "endpoint", endpoint_name))) {
674 ast_cli(a->fd, "Unable to retrieve endpoint %s\n", endpoint_name);
678 qual_data = qualify_data_alloc(endpoint, a->fd);
683 if (ast_sip_push_task(NULL, cli_qualify_contacts, qual_data)) {
684 qualify_data_destroy(qual_data);
693 * \brief Send qualify request to the given contact.
695 static int ami_contact_cb(void *obj, void *arg, int flags)
697 struct ast_sip_contact *contact = obj;
698 ao2_ref(contact, +1);
699 if (ast_sip_push_task(NULL, qualify_contact_task, contact)) {
700 ao2_cleanup(contact);
705 static int ami_sip_qualify(struct mansession *s, const struct message *m)
707 const char *endpoint_name = astman_get_header(m, "Endpoint");
708 RAII_VAR(struct ast_sip_endpoint *, endpoint, NULL, ao2_cleanup);
709 char *aor_name, *aors;
711 if (ast_strlen_zero(endpoint_name)) {
712 astman_send_error(s, m, "Endpoint parameter missing.");
716 endpoint = ast_sorcery_retrieve_by_id(
717 ast_sip_get_sorcery(),
721 astman_send_error(s, m, "Unable to retrieve endpoint\n");
725 /* send a qualify for all contacts registered with the endpoint */
726 if (ast_strlen_zero(endpoint->aors)) {
727 astman_send_error(s, m, "No AoRs configured for endpoint\n");
731 aors = ast_strdupa(endpoint->aors);
733 while ((aor_name = strsep(&aors, ","))) {
734 RAII_VAR(struct ast_sip_aor *, aor,
735 ast_sip_location_retrieve_aor(aor_name), ao2_cleanup);
736 RAII_VAR(struct ao2_container *, contacts, NULL, ao2_cleanup);
738 if (!aor || !(contacts = ast_sip_location_retrieve_aor_contacts(aor))) {
742 ao2_callback(contacts, OBJ_NODATA, ami_contact_cb, NULL);
745 astman_send_ack(s, m, "Endpoint found, will qualify");
749 static struct ast_cli_entry cli_options[] = {
750 AST_CLI_DEFINE(cli_qualify, "Send an OPTIONS request to a PJSIP endpoint")
753 static int sched_qualifies_hash_fn(const void *obj, int flags)
755 const struct sched_data *data = obj;
757 return ast_str_hash(ast_sorcery_object_get_id(data->contact));
760 static int sched_qualifies_cmp_fn(void *obj, void *arg, int flags)
762 struct sched_data *data = obj;
764 return !strcmp(ast_sorcery_object_get_id(data->contact),
765 ast_sorcery_object_get_id(arg));
768 int ast_sip_initialize_sorcery_qualify(struct ast_sorcery *sorcery)
770 /* initialize sorcery ast_sip_contact_status resource */
771 ast_sorcery_apply_default(sorcery, CONTACT_STATUS, "memory", NULL);
773 if (ast_sorcery_internal_object_register(sorcery, CONTACT_STATUS,
774 contact_status_alloc, NULL, NULL)) {
775 ast_log(LOG_ERROR, "Unable to register ast_sip_contact_status in sorcery\n");
779 ast_sorcery_object_field_register_nodoc(sorcery, CONTACT_STATUS, "rtt", "0", OPT_UINT_T,
780 1, FLDSET(struct ast_sip_contact_status, status));
781 ast_sorcery_object_field_register_nodoc(sorcery, CONTACT_STATUS, "rtt", "0", OPT_UINT_T,
782 1, FLDSET(struct ast_sip_contact_status, rtt));
787 static int qualify_and_schedule_cb(void *obj, void *arg, int flags)
789 struct ast_sip_contact *contact = obj;
790 struct ast_sip_aor *aor = arg;
792 contact->qualify_frequency = aor->qualify_frequency;
794 qualify_and_schedule(contact);
801 * \brief Qualify and schedule an endpoint's contacts
803 * \detail For the given endpoint retrieve its list of aors, qualify all
804 * contacts, and schedule for checks if configured.
806 static int qualify_and_schedule_all_cb(void *obj, void *arg, int flags)
808 struct ast_sip_endpoint *endpoint = obj;
809 char *aor_name, *aors;
811 if (ast_strlen_zero(endpoint->aors)) {
815 aors = ast_strdupa(endpoint->aors);
817 while ((aor_name = strsep(&aors, ","))) {
818 RAII_VAR(struct ast_sip_aor *, aor,
819 ast_sip_location_retrieve_aor(aor_name), ao2_cleanup);
820 struct ao2_container *contacts;
822 if (!aor || !(contacts = ast_sip_location_retrieve_aor_contacts(aor))) {
826 ao2_callback(contacts, OBJ_NODATA, qualify_and_schedule_cb, aor);
827 ao2_ref(contacts, -1);
833 static void qualify_and_schedule_all(void)
835 struct ao2_container *endpoints = ast_sip_get_endpoints();
841 ao2_callback(endpoints, OBJ_NODATA,
842 qualify_and_schedule_all_cb, NULL);
843 ao2_ref(endpoints, -1);
846 int ast_res_pjsip_init_options_handling(int reload)
848 const pj_str_t STR_OPTIONS = { "OPTIONS", 7 };
851 qualify_and_schedule_all();
855 if (!(sched_qualifies = ao2_t_container_alloc(
856 QUALIFIED_BUCKETS, sched_qualifies_hash_fn, sched_qualifies_cmp_fn,
857 "Create container for scheduled qualifies"))) {
862 if (pjsip_endpt_register_module(ast_sip_get_pjsip_endpoint(), &options_module) != PJ_SUCCESS) {
867 if (pjsip_endpt_add_capability(ast_sip_get_pjsip_endpoint(), NULL, PJSIP_H_ALLOW, NULL, 1, &STR_OPTIONS) != PJ_SUCCESS) {
868 pjsip_endpt_unregister_module(ast_sip_get_pjsip_endpoint(), &options_module);
872 if (ast_sorcery_observer_add(ast_sip_get_sorcery(), "contact", &contact_observer)) {
873 ast_log(LOG_WARNING, "Unable to add contact observer\n");
877 qualify_and_schedule_all();
878 ast_cli_register_multiple(cli_options, ARRAY_LEN(cli_options));
879 ast_manager_register2("PJSIPQualify", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, ami_sip_qualify, NULL, NULL, NULL);
884 void ast_res_pjsip_cleanup_options_handling(void)
886 ast_cli_unregister_multiple(cli_options, ARRAY_LEN(cli_options));
887 ast_manager_unregister("PJSIPQualify");