'socket eof disconnecting' error after authentication success

13 views
Skip to first unread message

James Sudimak

unread,
Oct 30, 2017, 1:03:19 PM10/30/17
to jaxl
I'm not sure if someone is maintaining JAXL as of now, but I am in dire need of assistance with trying to establish a valid connection.

My overall goal is to connect to the CoreDial API and pull in some raw data to be used for a web application. This connection is done through an XMPP library; I find that JAXL has caused the least amount of troubles when trying to achieve this.

However, once my script is run, the connection is cut short after the authentication goes through, for seemingly no reason.

Here is my code:

// Connect to CoreDial API using JAXL
$client = new JAXL(array(
'jid' => JID,
'pass' => PASS,
'host' => 'sb1.app.switchconnex.net', //CoreDial API server
'port' => '5222',
'priv_dir' => getcwd() . '/private_jaxl',
'log_level' => JAXLLogger::INFO
));

$client->require_xep(array(
    '0060' // For CoreDial Publish-Subscribe functionality
));

function on_auth_success_callback() {
global $client;
JAXLLogger::info("got on_auth_success cb, jid ".$client->full_jid->to_string());
$client->xeps['0060']->subscribe('presence.api.coredial.com', 'pbx_4');
$client->send_end_stream();
}
$client->add_cb('on_auth_success', 'on_auth_success_callback');


function on_auth_failure_callback($reason) {
global $client;
$client->send_end_stream();
JAXLLogger::info("got on_auth_failure cb with reason $reason");
}
$client->add_cb('on_auth_failure', 'on_auth_failure_callback');


function on_disconnect_callback() {
global $client;
JAXLLogger::info("got on_disconnect cb");
$client->send_end_stream();
}
$client->add_cb('on_disconnect', 'on_disconnect_callback');


$client->start();
$client->branch_list(28); // attempt to pull in data
echo "done".PHP_EOL;

Here is what I get in my error logs upon running the script:
[Fri Oct 27 12:24:02.762434 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mjaxl:159 - 2017-10-27 12:24:02 - strict mode enabled, adding exception handlers. ' .\n                'Set 'strict' => false inside JAXL config to disable this\x1b[0m
[Fri Oct 27 12:24:02.762677 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mjaxl_socket_client:110 - 2017-10-27 12:24:02 - trying tcp://sb1.app.switchconnex.net:5222\x1b[0m
[Fri Oct 27 12:24:02.772047 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mjaxl_socket_client:131 - 2017-10-27 12:24:02 - connected to tcp://sb1.app.switchconnex.net:5222\x1b[0m
[Fri Oct 27 12:24:02.815146 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mtest:21 - 2017-10-27 12:24:02 - got on_auth_success cb, jid MY_JID\x1b[0m
[Fri Oct 27 12:24:02.824300 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[34mjaxl_socket_client:217 - 2017-10-27 12:24:02 - socket eof, disconnecting\x1b[0m
[Fri Oct 27 12:24:02.824355 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mtest:38 - 2017-10-27 12:24:02 - got on_disconnect cb\x1b[0m
[Fri Oct 27 12:24:02.824390 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[34mjaxl:824 - 2017-10-27 12:24:02 - event 'branch_list' catched in handle_other with stanza name 28\x1b[0m
[Fri Oct 27 12:24:02.824416 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mxmpp_stream:129 - 2017-10-27 12:24:02 - got invalid return value from state handler 'logged_out', sending end stream...\x1b[0m
[Fri Oct 27 12:24:02.824437 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[33mxmpp_stream:136 - 2017-10-27 12:24:02 - state handler 'logged_out' returned N;, kindly report this to developers\x1b[0m
[Fri Oct 27 12:24:02.824499 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mjaxl:250 - 2017-10-27 12:24:02 - cleaning up pid and unix sock files\x1b[0m
[Fri Oct 27 12:24:02.824530 2017] [:error] [pid 11191] [client 38.140.197.115:57252] \x1b[32mjaxl_clock:58 - 2017-10-27 12:24:02 - shutting down clock server...\x1b[0m

I have seen you suggest running the connection off of a local jabber server such as ejabberd; I am not sure what that entails as far installing and configuring that, nor do I know how to integrate that with JAXL. My server is run off of Ubuntu.

Anyone's help would be sincerely appreciated, this project I am working on is on a serious time crunch! :(

Thanks in advance,

James S.
Reply all
Reply to author
Forward
0 new messages