summaryrefslogtreecommitdiff
path: root/res/res_pjsip_pubsub.c
diff options
context:
space:
mode:
authorMatthew Jordan <mjordan@digium.com>2014-06-27 13:50:02 +0000
committerMatthew Jordan <mjordan@digium.com>2014-06-27 13:50:02 +0000
commit15dcaeef82ce4fc013668392838f8ff9e0ec8075 (patch)
treefe66165bc3eeb12dbef6a71a86f9fbdd41938780 /res/res_pjsip_pubsub.c
parent512e505dc3e7a8f20a5054c5ee364c7c46d8976f (diff)
res_pjsip: Add ActionID to events created as a result of PJSIP AMI actions
A number of various PJSIP AMI actions were failing to parse out and place the ActionID into their responses. This patch updates the various PJSIP actions such that the passed in ActionID is emitted on any event list complete events, as well as any intermediate events created as a result of the action. #ASTERISK-23947 #close Reported by: Mark Michelson Review: https://reviewboard.asterisk.org/r/3675/ ........ Merged revisions 417460 from http://svn.asterisk.org/svn/asterisk/branches/12 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@417461 65c4cc65-6c06-0410-ace0-fbb531ad65f3
Diffstat (limited to 'res/res_pjsip_pubsub.c')
-rw-r--r--res/res_pjsip_pubsub.c20
1 files changed, 12 insertions, 8 deletions
diff --git a/res/res_pjsip_pubsub.c b/res/res_pjsip_pubsub.c
index 39846823e..9032bd3f6 100644
--- a/res/res_pjsip_pubsub.c
+++ b/res/res_pjsip_pubsub.c
@@ -1966,7 +1966,7 @@ static int ami_subscription_detail_outbound(struct ast_sip_subscription *sub, vo
static int ami_show_subscriptions_inbound(struct mansession *s, const struct message *m)
{
- struct ast_sip_ami ami = { .s = s, .m = m };
+ struct ast_sip_ami ami = { .s = s, .m = m, .action_id = astman_get_header(m, "ActionID"), };
int num;
astman_send_listack(s, m, "Following are Events for "
@@ -1974,16 +1974,18 @@ static int ami_show_subscriptions_inbound(struct mansession *s, const struct mes
num = for_each_subscription(ami_subscription_detail_inbound, &ami);
- astman_append(s,
- "Event: InboundSubscriptionDetailComplete\r\n"
- "EventList: Complete\r\n"
+ astman_append(s, "Event: InboundSubscriptionDetailComplete\r\n");
+ if (!ast_strlen_zero(ami.action_id)) {
+ astman_append(s, "ActionID: %s\r\n", ami.action_id);
+ }
+ astman_append(s, "EventList: Complete\r\n"
"ListItems: %d\r\n\r\n", num);
return 0;
}
static int ami_show_subscriptions_outbound(struct mansession *s, const struct message *m)
{
- struct ast_sip_ami ami = { .s = s, .m = m };
+ struct ast_sip_ami ami = { .s = s, .m = m, .action_id = astman_get_header(m, "ActionID"), };
int num;
astman_send_listack(s, m, "Following are Events for "
@@ -1991,9 +1993,11 @@ static int ami_show_subscriptions_outbound(struct mansession *s, const struct me
num = for_each_subscription(ami_subscription_detail_outbound, &ami);
- astman_append(s,
- "Event: OutboundSubscriptionDetailComplete\r\n"
- "EventList: Complete\r\n"
+ astman_append(s, "Event: OutboundSubscriptionDetailComplete\r\n");
+ if (!ast_strlen_zero(ami.action_id)) {
+ astman_append(s, "ActionID: %s\r\n", ami.action_id);
+ }
+ astman_append(s, "EventList: Complete\r\n"
"ListItems: %d\r\n\r\n", num);
return 0;
}