[asterisk-bugs] [JIRA] (ASTERISK-25735) res_xmpp does not connect in component mode
Asterisk Team (JIRA)
noreply at issues.asterisk.org
Mon Feb 1 09:56:33 CST 2016
[ https://issues.asterisk.org/jira/browse/ASTERISK-25735?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=229236#comment-229236 ]
Asterisk Team commented on ASTERISK-25735:
------------------------------------------
Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.
A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.
Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].
> res_xmpp does not connect in component mode
> -------------------------------------------
>
> Key: ASTERISK-25735
> URL: https://issues.asterisk.org/jira/browse/ASTERISK-25735
> Project: Asterisk
> Issue Type: Bug
> Security Level: None
> Components: Resources/res_xmpp
> Affects Versions: 11.21.0
> Environment: Debian Linux 8, Kernel 4.4, XMPP server Jabberd2 (2.3.4)
> Reporter: Karsten Wemheuer
>
> In asterisk 1.8 we are using res_jabber to connect asterisk with a xmpp server (jabberd2) in *component mode*. In asterisk 11 and newer version res_jabber is deprecated. So I configured the asterisk 11 with res_xmpp in the same way as res_jabber in asterisk 1.8 before. The connection is not established. The module gets immediately unloaded, because the setting of the username “pbx.pbxtest” is not accepted. In res_xmpp there must be a username like xxx at yyy which is wrong according to the xmpp protocol in component mode (XEP-0114).
> In res_xmpp.c (line 3705) in function "xmpp_client_config_post_apply" is this peace of code
> {noformat}
> if (!cfg->client->jid || ast_strlen_zero(cfg->client->jid->user)) {
> ast_log(LOG_ERROR, "Jabber identity '%s' could not be created for client '%s' - client not active\n", cfg->user, cfg->name);
> return -1;
> }
> {noformat}
> With the attached patch this if statement is skipped in case of component mode. The module accepts the old res_jabber configuration, but the connection is still not established.
> If the xmpp server sends out a "stream" element before handshake is finished, the connection gets dropped in res_xmpp. The res_jabber code discards the stream elements and continues the handshaking. The patch fixes this in function xmpp_component_authenticating.
> Another problem is located in function "xmpp_pak_presence". The current code leaves the function directly if there is no resource. A few lines later there is a call to "xmpp_client_set_presence" in case of component mode. This call is not reached, cause in this situation there is no resource. So the patch moves the lines
> {noformat}
> /* If this is a component presence probe request answer immediately with our presence status */
> if (ast_test_flag(&cfg->flags, XMPP_COMPONENT) && !ast_strlen_zero(type) && !strcasecmp(type, "probe")) {
> xmpp_client_set_presence(client, pak->from->full, iks_find_attrib(pak->x, "to"), cfg->status, cfg->statusmsg);
> }
> {noformat}
> to the top of the function.
> The attached patch fixes the issues with component mode in asterisk 11 (tested with latest release 11.21.0).
--
This message was sent by Atlassian JIRA
(v6.2#6252)
More information about the asterisk-bugs
mailing list