Example?
Is there any kind of example or docs on how to use this to send a gtalk message?
This would be really awesome!
Ya please if any example with openfire for groupchat
Hi i am using this code to connect with xmpp but is throws a error 1445931050 [INFO]: Connecting to tcp://hostname:port Fatal error: Maximum execution time of 30 seconds exceeded in /opt/lampp/htdocs/xmppinvite/examples/XMPPHP/Log.php on line 88
Please help me Thanks in Advance.
Hi varun
which xmpp server you using ejabberd , openfire ?
to connect your lampp server should open following ports 5222,5280,9090,9091 etc
Hi pratik, i am using openfire n i have i enabled 9090,5222 port after that this error comes.
from php.ini increase timeout from 30 second to 60 second and enable 5280 port also
if you can then put your connection code here
Hi pratik below is mycode for connection and sending message using xmpp in php
connect(); $conn->processUntil('session_start'); $conn->presence(); $conn->message('3698000000spalchat@canopus-pc','This is a test message!','chat', null, null); $conn->disconnect(); } catch(XMPPHP_Exception $e) { die($e->getMessage()); } After increase time limit to 60 seconds it throws this exception 1446099727 [INFO]: Connecting to tcp://hostname:9090 1446099727 [ERROR]: Could not connect. 1446099732 [INFO]: Connecting to tcp://hostname:9090 1446099732 [ERROR]: Could not connect. 1446099737 [INFO]: Connecting to tcp://hostname:9090 1446099737 [ERROR]: Could not connect. 1446099742 [INFO]: Connecting to tcp://hostname:9090 1446099742 [ERROR]: Could not connect. 1446099747 [INFO]: Connecting to tcp://hostname:9090 Fatal error: Maximum execution time of 60 seconds exceeded in /opt/lampp/htdocs/xmppinvite/examples/XMPPHP/XMLStream.php on line 388
use port 5222 in your connection and change code as below
$conn = new XMPPHP_XMPP('hostname', 5222, 'shubh@hostname', '123', 'xmpphp', 'hostname', $printlog=true, $loglevel=XMPPHP_Log::LEVEL_INFO);
it gives this error $conn = new XMPPHP_XMPP('222.119.250.34',5222, '[email protected]', '123', 'shubh', '222.119.250.34', $printlog=True, $loglevel=XMPPHP_Log::LEVEL_INFO);
1446102665 [INFO]: Connecting to tcp://hostname(e.g.:222.119.250.34):5222 1446102665 [INFO]: Starting TLS encryption 1446102666 [INFO]: Attempting Auth... 1446102666 [INFO]: Trying DIGEST-MD5 (available : DIGEST-MD5,PLAIN) 1446102666 [ERROR]: Auth failed! Fatal error: Maximum execution time of 60 seconds exceeded in /opt/lampp/htdocs/xmppinvite/examples/XMPPHP/XMLStream.php on line 409
Login into openfire admin panel and check hostname server etc it should be 222.119.250.34 ip address.
openfire admin credential should be
user: shubh and pass: 123
I have given credential of user now after providing the credential of admin it gives following error
1446104689 [INFO]: Connecting to tcp://ipaddress:5222 1446104689 [ERROR]: Could not connect. 1446104694 [INFO]: Connecting to tcp://ipaddress:5222 1446104694 [ERROR]: Could not connect. 1446104699 [INFO]: Connecting to tcp://ipaddress:5222 1446104699 [ERROR]: Could not connect. 1446104704 [INFO]: Connecting to tcp://ipaddress:5222 1446104704 [INFO]: Starting TLS encryption 1446104704 [INFO]: Attempting Auth... 1446104704 [INFO]: Trying DIGEST-MD5 (available : DIGEST-MD5,PLAIN) 1446104704 [INFO]: Auth success! 1446104704 [INFO]: Bound to admin@canopus-pc/admin 1446104704 [INFO]: Session started
its not error see authentication done and session has been started . you made connection. these things are printing because ptrint_log is true
@varunjoshi12 Just a note, you're using XMPPHP, which isn't this project. You can find a fork of XMPPHP here: https://github.com/cweiske/xmpphp (the original was on Google Code, but that has shut down).