Openfire http prebinding with JAXL

675 views Asked by At

I am trying to implement converse.js in my project to use Openfire chat and am prebinding the user using JAXL. Its working fine on my cloud(VPS) server. when am try to publish the same code on my client server its not working. and getting the same problem when execute the same from my localhost. not working means prebind request remains (pending) for a while and ends with 500 internal server error.

we have checked the server configuration. seems to be fine. Can any one suggest me something to how to debug this one?

here is my jaxl config code.

$client = new JAXL(array(
  'jid'=>$un,
  'pass'=>$pwd,
  'bosh_url' => 'http://xx.xx.xx.xx/http-bind',
  'log_path' => __DIR__ . '/logs',
  'log_level' => JAXL_INFO,
  'strict' => false
));

Thanks in advance
-josan

UPDATE

here is my jaxl log from my client server.

1.jaxl:180 - 2014-11-05 10:47:47 - dns srv lookup for iz25pkf9c7hz
2.jaxl:189 - 2014-11-05 10:47:47 - including bosh xep
3.jaxl_fsm:61 - 2014-11-05 10:47:47 - calling state handler 'setup' for incoming event 'start_cb'
4.jaxl_fsm:71 - 2014-11-05 10:47:47 - current state 'wait_for_stream_features'
5.xep_0206:109 - 2014-11-05 10:47:47 - posting to http://182.92.156.24/http-bind body 
6.<body xmlns="http://jabber.org/protocol/httpbind" content="text/xml; charset=utf-8" 
 to="iz25pkf9c7hz" route="xmpp:iz25pkf9c7hz:5222" secure="true" xml:lang="en" 
 xmpp:version="1.0" xmlns:xmpp="urn:xmpp:xbosh" hold="1" wait="30" rid="2280" 
 ver="1.10" from="bala101@iz25pkf9c7hz">  
</body>
7.xep_0206:132 - 2014-11-05 10:47:47 - recving for 2280
8.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
9.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
10.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
.
.
.
.
58854.xep_0206:132 - 2014-11-05 10:47:48 - recving for 2280
.
.
(Its just kept on adding for 5 or 3 mins)
1

There are 1 answers

0
Jothi Sankar N Kanakavel On BEST ANSWER

At last we found the solution for this issue.
As i already mentioned in my comment the problem was caused of PHP versions

In JAXL

 #135 $changed = curl_multi_select($this->mch, 0.1);
        
 #137 if($changed == 0 && $running == 0) {  

https://github.com/jaxl/JAXL/blob/v3.x/xep/xep_0206.php#L135

The curl_multi_select() function used there on line no #135 returning (-1) instead of (0) as the response when PHP versions are higher than 5.3.18

So i have changed the #137 as follows

#137 if(($changed == 0 || $changed == -1) && $running == 0) {

This thing fixes my problem.

ref https://bugs.php.net/bug.php?id=63411

Note: for PHP versions Greater than 5.3.x Do the migration check before using the JAXL in-to your project. The below link having a shell script to found inconveniences
http://blog.waja.info/2013/09/15/migrating-from-php-5-dot-3-x-to-5-dot-4-x-and-finding-problematic-application-code/

Hope this could help someone on sometime.

Happy coding