[Asterisk-code-review] res pjsip: improve realtime performance (asterisk[13])

Joshua Colp asteriskteam at digium.com
Tue Apr 26 10:53:08 CDT 2016


Joshua Colp has posted comments on this change.

Change subject: res_pjsip: improve realtime performance
......................................................................


Patch Set 3: Code-Review-1

(4 comments)

This also needs an alembic change for the authenticate_qualify persistence.

https://gerrit.asterisk.org/#/c/2622/3/res/res_pjsip/pjsip_options.c
File res/res_pjsip/pjsip_options.c:

Line 1056: static int qualify_and_schedule_contract(void *obj, void *arg, int flags)
contact


PS3, Line 1058: 	struct ast_sip_contact *contact = obj;
              : 	int initial_interval;
              : 	int max_time = ast_sip_get_max_initial_qualify_time();
              : 
              : 	/* Delay initial qualification by a random fraction of the specified interval */
              : 	if (max_time && max_time < contact->qualify_frequency) {
              : 		initial_interval = max_time;
              : 	} else {
              : 		initial_interval = contact->qualify_frequency;
              : 	}
              : 
              : 	initial_interval = (int)((initial_interval * 1000) * ast_random_double());
              : 
              : 	unschedule_qualify(contact);
              : 	if (contact->qualify_frequency) {
              : 		schedule_qualify(contact, initial_interval);
              : 	} else {
              : 		update_contact_status(contact, UNKNOWN);
              : 	}
This code duplicates that in qualify_and_schedule_cb - if possible please use a single function that is used by both


Line 1121: 	struct ao2_container *contracts;
contacts


PS3, Line 1136: 	contracts = ast_sorcery_retrieve_by_fields(ast_sip_get_sorcery(),
              : 		"contract", AST_RETRIEVE_FLAG_MULTIPLE, var);
              : 	if (contracts) {
              : 		ao2_callback(contracts, OBJ_NODATA, qualify_and_schedule_contract, NULL);
              : 		ao2_ref(contracts, -1);
              : 	}
You've used contracts/contract in here instead of contacts/contact - as a result this wouldn't work.


-- 
To view, visit https://gerrit.asterisk.org/2622
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: comment
Gerrit-Change-Id: I1831fa46c4578eae5a3e574ee3362fddf08a1f05
Gerrit-PatchSet: 3
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Alexei Gradinari <alex2grad at gmail.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list