mirror of
https://github.com/asterisk/asterisk.git
synced 2025-10-22 12:52:33 +00:00
res_pjsip_exten_state: Use the extension for publishing to.
This change uses the newly added multi-user support for outbound publish to publish to the specific user that an extension state change is for. This also extends the res_pjsip_outbound_publish support to include the user specific From and To URI information in the outbound publishing of extension state. Since the URI is used when constructing the body it is important to ensure that the correct local and remote URIs are used. Finally the max string growths for the dialog-info+xml body generator has been increased as through testing it has proven to be too conservative. ASTERISK-25965 Change-Id: I668fdf697b1e171d4c7e6f282b2e1590f8356ca1
This commit is contained in:
@@ -647,21 +647,21 @@ static int exten_state_publisher_cb(void *data)
|
||||
|
||||
publisher = AST_VECTOR_GET(&pub_data->pubs, idx);
|
||||
|
||||
uri = ast_sip_publish_client_get_from_uri(publisher->client);
|
||||
uri = ast_sip_publish_client_get_user_from_uri(publisher->client, pub_data->exten_state_data.exten,
|
||||
pub_data->exten_state_data.local, sizeof(pub_data->exten_state_data.local));
|
||||
if (ast_strlen_zero(uri)) {
|
||||
ast_log(LOG_WARNING, "PUBLISH client '%s' has no from_uri or server_uri defined.\n",
|
||||
publisher->name);
|
||||
continue;
|
||||
}
|
||||
ast_copy_string(pub_data->exten_state_data.local, uri, sizeof(pub_data->exten_state_data.local));
|
||||
|
||||
uri = ast_sip_publish_client_get_to_uri(publisher->client);
|
||||
uri = ast_sip_publish_client_get_user_to_uri(publisher->client, pub_data->exten_state_data.exten,
|
||||
pub_data->exten_state_data.remote, sizeof(pub_data->exten_state_data.remote));
|
||||
if (ast_strlen_zero(uri)) {
|
||||
ast_log(LOG_WARNING, "PUBLISH client '%s' has no to_uri or server_uri defined.\n",
|
||||
publisher->name);
|
||||
continue;
|
||||
}
|
||||
ast_copy_string(pub_data->exten_state_data.remote, uri, sizeof(pub_data->exten_state_data.remote));
|
||||
|
||||
pub_data->exten_state_data.datastores = publisher->datastores;
|
||||
|
||||
@@ -678,7 +678,7 @@ static int exten_state_publisher_cb(void *data)
|
||||
body.type = publisher->body_type;
|
||||
body.subtype = publisher->body_subtype;
|
||||
body.body_text = ast_str_buffer(body_text);
|
||||
ast_sip_publish_client_send(publisher->client, &body);
|
||||
ast_sip_publish_client_user_send(publisher->client, pub_data->exten_state_data.exten, &body);
|
||||
}
|
||||
|
||||
pjsip_endpt_release_pool(ast_sip_get_pjsip_endpoint(), pool);
|
||||
|
Reference in New Issue
Block a user