[Asterisk-code-review] res pjsip: Add AMI action 'PJSIPShowContacts' (asterisk[master])
Richard Mudgett
asteriskteam at digium.com
Mon Jan 22 18:10:28 CST 2018
Richard Mudgett has posted comments on this change. ( https://gerrit.asterisk.org/7960 )
Change subject: res_pjsip: Add AMI action 'PJSIPShowContacts'
......................................................................
Patch Set 3: Code-Review-1
(8 comments)
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip.c
File res/res_pjsip.c:
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip.c@2421
PS3, Line 2421: <parameter name="ID">
: <para>The sorcery ID of the contact.</para>
: </parameter>
Delete ID. This is redundant with ObjectName.
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip.c@2427
PS3, Line 2427: <enum name="Reachable"/>
: <enum name="Unreachable"/>
: <enum name="NonQualified"/>
The possible enum values are:
static const char *status_map [] = {
[UNAVAILABLE] = "Unreachable",
[AVAILABLE] = "Reachable",
[UNKNOWN] = "Unknown",
[CREATED] = "NonQualified",
[REMOVED] = "Removed",
};
Though, "Removed" is not expected to be visible to the user.
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip.c@2656
PS3, Line 2656: <para>Provides a listing of all Contacts. For each Contact an <literal>ContactList
s/an/a/
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip.c@2656
PS3, Line 2656: <literal>ContactList
: </literal>
This should be treated as an unbreakable word-wrap string to prevent unexpected spaces from showing up in the literal formatting.
See "manager show command PJSIPShowContacts" output.
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip.c@2658
PS3, Line 2658: Once all contacts have been listed an <literal>ContactListComplete</literal> event
s/an/a/
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip/pjsip_options.c
File res/res_pjsip/pjsip_options.c:
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip/pjsip_options.c@967
PS3, Line 967: ast_str_append(&buf, 0, "ID: %s\r\n", ast_sorcery_object_get_id(contact));
Delete the ID header. The ID header value is redundant with the ObjectName header value already output by sip_contact_to_ami().
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip/pjsip_options.c@971
PS3, Line 971: ast_str_append(&buf, 0, "Status: %s\r\n", ast_sip_get_contact_status_label(status ? status->status : UNKNOWN));
Guidelines: wrap long lines at 90 columns
https://gerrit.asterisk.org/#/c/7960/3/res/res_pjsip/pjsip_options.c@1569
PS3, Line 1569: if (ast_manager_register_xml("PJSIPShowContacts", EVENT_FLAG_SYSTEM, ami_show_contacts)) {
: return -1;
: }
Just list
ast_manager_register_xml("PJSIPShowContacts", EVENT_FLAG_SYSTEM, ami_show_contacts);
right after
ast_manager_register_xml("PJSIPQualify", EVENT_FLAG_SYSTEM | EVENT_FLAG_REPORTING, ami_sip_qualify);
If you return you need to clean up allocated resources which you are not doing.
--
To view, visit https://gerrit.asterisk.org/7960
To unsubscribe, visit https://gerrit.asterisk.org/settings
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-MessageType: comment
Gerrit-Change-Id: I2eed42c74bbc725fad26b8b33b1a5b3161950c73
Gerrit-Change-Number: 7960
Gerrit-PatchSet: 3
Gerrit-Owner: sungtae kim <pchero21 at gmail.com>
Gerrit-Reviewer: Jenkins2
Gerrit-Reviewer: Joshua Colp <jcolp at digium.com>
Gerrit-Reviewer: Kevin Harwell <kharwell at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: sungtae kim <pchero21 at gmail.com>
Gerrit-Comment-Date: Tue, 23 Jan 2018 00:10:28 +0000
Gerrit-HasComments: Yes
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180122/24cc523e/attachment-0001.html>
More information about the asterisk-code-review
mailing list