Xmpp icon indicating copy to clipboard operation
Xmpp copied to clipboard

Example?

Open bandroidx opened this issue 12 years ago • 14 comments

Is there any kind of example or docs on how to use this to send a gtalk message?

bandroidx avatar Jul 13 '13 03:07 bandroidx

This would be really awesome!

jfsimon avatar Jul 30 '13 13:07 jfsimon

Ya please if any example with openfire for groupchat

pratik1230 avatar Dec 03 '13 13:12 pratik1230

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.

varunjoshi12 avatar Oct 27 '15 07:10 varunjoshi12

Hi varun

which xmpp server you using ejabberd , openfire ?

pratik1230 avatar Oct 29 '15 06:10 pratik1230

to connect your lampp server should open following ports 5222,5280,9090,9091 etc

pratik1230 avatar Oct 29 '15 06:10 pratik1230

Hi pratik, i am using openfire n i have i enabled 9090,5222 port after that this error comes.

varunjoshi12 avatar Oct 29 '15 06:10 varunjoshi12

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

pratik1230 avatar Oct 29 '15 06:10 pratik1230

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

varunjoshi12 avatar Oct 29 '15 06:10 varunjoshi12

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);

pratik1230 avatar Oct 29 '15 06:10 pratik1230

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

varunjoshi12 avatar Oct 29 '15 07:10 varunjoshi12

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

pratik1230 avatar Oct 29 '15 07:10 pratik1230

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

varunjoshi12 avatar Oct 29 '15 07:10 varunjoshi12

its not error see authentication done and session has been started . you made connection. these things are printing because ptrint_log is true

pratik1230 avatar Oct 29 '15 07:10 pratik1230

@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).

alexmace avatar Oct 29 '15 08:10 alexmace