summaryrefslogtreecommitdiff
path: root/res/res_pjsip_outbound_publish.c
diff options
context:
space:
mode:
authorRichard Mudgett <rmudgett@digium.com>2016-04-27 17:19:53 -0500
committerRichard Mudgett <rmudgett@digium.com>2016-04-29 14:53:40 -0500
commit2c46063d54e41f3fad81eafb7d24f0308034bd96 (patch)
tree816271b64eab7dfeabcd0f21c9df63d71075e423 /res/res_pjsip_outbound_publish.c
parentbc19d9a2b0361f1aa5b3f8426bacfaf1300a1193 (diff)
res_pjsip_exten_state: Create PUBLISH messages.
Create PUBLISH messages to update a third party when an extension state changes because of either a device or presence state change. A configuration example: [exten-state-publisher] type=outbound-publish server_uri=sip:instance1@172.16.10.2 event=presence ; Optional regex for context filtering, if specified only extension state ; for contexts matching the regex will cause a PUBLISH to be sent. @context=^users ; Optional regex for extension filtering, if specified only extension ; state for extensions matching the regex will cause a PUBLISH to be sent. @exten=^[0-9]* ; Required body type for the PUBLISH message. ; ; Supported values are: ; application/pidf+xml ; application/xpidf+xml ; application/cpim-pidf+xml ; application/dialog-info+xml (Planned support but not yet) @body=application/pidf+xml The '@' extended variables are used because the implementation can't extend the outbound publish type as it is provided by the outbound publish module. That means you either have to use extended variables, or implement some sort of custom extended variable thing in the outbound publish module. Another option would be to refactor that stuff to have an option which specifies the use of an alternate implementation's configuration and then have that passed to the implementation. JColp opted for the extended variables method originally. ASTERISK-25972 #close Change-Id: Ic0dab4022f5cf59302129483ed38398764ee3cca
Diffstat (limited to 'res/res_pjsip_outbound_publish.c')
-rw-r--r--res/res_pjsip_outbound_publish.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/res/res_pjsip_outbound_publish.c b/res/res_pjsip_outbound_publish.c
index 0fe2e3e5d..0265c424e 100644
--- a/res/res_pjsip_outbound_publish.c
+++ b/res/res_pjsip_outbound_publish.c
@@ -425,6 +425,20 @@ struct ast_sip_outbound_publish_client *ast_sip_publish_client_get(const char *n
return state->client;
}
+const char *ast_sip_publish_client_get_from_uri(struct ast_sip_outbound_publish_client *client)
+{
+ struct ast_sip_outbound_publish *publish = client->publish;
+
+ return S_OR(publish->from_uri, S_OR(publish->server_uri, ""));
+}
+
+const char *ast_sip_publish_client_get_to_uri(struct ast_sip_outbound_publish_client *client)
+{
+ struct ast_sip_outbound_publish *publish = client->publish;
+
+ return S_OR(publish->to_uri, S_OR(publish->server_uri, ""));
+}
+
int ast_sip_register_event_publisher_handler(struct ast_sip_event_publisher_handler *handler)
{
struct ast_sip_event_publisher_handler *existing;