[Asterisk-code-review] res pjsip pubsub.c: Implement "pjsip show subscriptions" com... (asterisk[master])

George Joseph asteriskteam at digium.com
Mon Jan 23 15:54:03 CST 2017


George Joseph has posted comments on this change. ( https://gerrit.asterisk.org/4747 )

Change subject: res_pjsip_pubsub.c: Implement "pjsip show subscriptions" commands.
......................................................................


Patch Set 1: Code-Review-1

(1 comment)

https://gerrit.asterisk.org/#/c/4747/1/res/res_pjsip_pubsub.c
File res/res_pjsip_pubsub.c:

PS1, Line 3800: 	ast_str_append(&buf, 0, "Resource: %s\n", sub_tree->root->resource);
              : 	ast_str_append(&buf, 0, "Event: %s\n", sub_tree->root->handler->event_name);
              : 	ast_str_append(&buf, 0, "Expiry: %d\n", cli_subscription_expiry(sub_tree));
              : 
              : 	sip_subscription_to_ami(sub_tree, &buf);
              : 
              : 	/* Convert AMI \r\n to \n line terminators. */
              : 	src = strchr(ast_str_buffer(buf), '\r');
              : 	if (src) {
              : 		dest = src;
              : 		++src;
              : 		while (*src) {
              : 			if (*src == '\r') {
              : 				++src;
              : 				continue;
              : 			}
              : 			*dest++ = *src++;
              : 		}
              : 		*dest = '\0';
              : 		ast_str_update(buf);
              : 	}
              : 
              : 	ast_cli(cli->a->fd, "%s", ast_str_buffer(buf));
              : 	ast_free(buf);
> Requesting the information for a single subscription should be able to give
Since you already parse the buffer to convert newlines, you could easily reformat the lines as the other pjsip commands do.


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

Gerrit-MessageType: comment
Gerrit-Change-Id: Ifb8a3b61f447aedc58a8e6b36a810f7566018567
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: master
Gerrit-Owner: Richard Mudgett <rmudgett at digium.com>
Gerrit-Reviewer: Anonymous Coward #1000019
Gerrit-Reviewer: George Joseph <gjoseph at digium.com>
Gerrit-Reviewer: Mark Michelson <mmichelson at digium.com>
Gerrit-Reviewer: Richard Mudgett <rmudgett at digium.com>
Gerrit-HasComments: Yes



More information about the asterisk-code-review mailing list