mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-12 15:45:18 +00:00
pjsip_options: Fix non-qualified contacts showing as unavailable
The "Add qualify_timeout processing and eventing" patch introduced an issue where contacts that had qualify_frequency set to 0 were showing Unavailable instead Unknown. This patch checks for qualify_frequency=0 and create an "Unknown" contact_status with an RTT = 0. Previously, the lack of contact_status implied Unknown but since we're now changing endpoint state based on contact_status, I've had to add new UNKNOWN status so that changes could trigger the appropriate contact_status observers. ASTERISK-24977: #close Change-Id: Ifcbc01533ce57f0e4e584b89a395326e098b8fe7
This commit is contained in:
@@ -147,15 +147,9 @@ static int pjsip_contact_function_read(struct ast_channel *chan,
|
||||
contact_status = ast_sorcery_retrieve_by_id(pjsip_sorcery, CONTACT_STATUS, ast_sorcery_object_get_id(contact_obj));
|
||||
|
||||
if (!strcmp(args.field_name, "status")) {
|
||||
if (!contact_status) {
|
||||
ast_str_set(buf, len, "%s", "Unknown");
|
||||
} else if (contact_status->status == UNAVAILABLE) {
|
||||
ast_str_set(buf, len, "%s", "Unreachable");
|
||||
} else if (contact_status->status == AVAILABLE) {
|
||||
ast_str_set(buf, len, "%s", "Reachable");
|
||||
}
|
||||
ast_str_set(buf, len, "%s", ast_sip_get_contact_status_label(contact_status->status));
|
||||
} else if (!strcmp(args.field_name, "rtt")) {
|
||||
if (!contact_status) {
|
||||
if (contact_status->status == UNKNOWN) {
|
||||
ast_str_set(buf, len, "%s", "N/A");
|
||||
} else {
|
||||
ast_str_set(buf, len, "%" PRId64, contact_status->rtt);
|
||||
|
Reference in New Issue
Block a user