Hello,
in the server, you could modify
APE_Server/scripts/commands/inlinepush.js, to something like:
...
var chan = Ape.getChannelByName(params.channel);
if (!$defined(chan)) {
Ape.mkChan(params.channel);
var chan = Ape.getChannelByName(params.channel);
if (!$defined(chan)) {
return ["401", "UNKNOWN_CHANNEL and unable to create,
sorry"];
}
}
chan.pipe.sendRaw(params.raw, params.data);
...
havent tried that though.
then restart aped (make sure it is restarted, it starts also if it
cannot bind on the port).
hth
Stefan
Szerb Tamás wrote:
Based on the Demos/Controller (anyway, $data won't equal to "OK" since
it is JSON'ed reply comes back) I'd like to invoke the test.php (/usr/
bin/php5 test.php):
$ /usr/bin/php5 test.php
string(246) "http://ape.localhost:6969/?%5B%7B%22cmd%22%3A%22inlinepush
%22%2C%22params%22%3A%7B%22password%22%3A%22testpasswd%22%2C%22raw
%22%3A%22postmsg%22%2C%22channel%22%3A%22testchannel%22%2C%22data%22%3A
%7B%22message%22%3A%22Test%20Message%22%7D%7D%7D%5D"
Error sending message, server response is :
<pre>[{"time":"1271422707","raw":"ERR","data":
{"code":"401","value":"UNKNOWN_CHANNEL"}}]</pre>t...@clamshell:/var/
ape/ape-jsf/Demos/Controller$
until I'd hit the page with browse
http://ape.localhost/Demos/Controller/demo.html
then again:
$ /usr/bin/php5 test.php
string(246) "http://ape.localhost:6969/?%5B%7B%22cmd%22%3A%22inlinepush
%22%2C%22params%22%3A%7B%22password%22%3A%22testpasswd%22%2C%22raw
%22%3A%22postmsg%22%2C%22channel%22%3A%22testchannel%22%2C%22data%22%3A
%7B%22message%22%3A%22Test%20Message%22%7D%7D%7D%5D"
Error sending message, server response is :
<pre>[{"time":"1271422807","raw":"pushed","data":{"value":"ok"}}]</
pre>t...@clamshell:/var/ape/ape-jsf/Demos/Controller$
which is understandable, because demo.html creates the channel:
'testchannel'. My question, is there any way to modify this demo to
make sure that test.php creates the channel if it's not exisiting yet,
and the demo.html will use it if it's already created?
If it's not possible (please disprove me), please let me know how
could I implement to send a simple message without any channel?
Cheers,
toma
--
Stefan Sayer
VoIP Services Consulting and Development
Warschauer Str. 24
10243 Berlin
tel:+491621366449
sip:[email protected]
email/xmpp:[email protected]
--
You received this message because you are subscribed to the Google
Groups "APE Project" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/ape-project?hl=en
---
APE Project (Ajax Push Engine)
Official website : http://www.ape-project.org/
Git Hub : http://github.com/APE-Project/