Re: [PATCH] Interactive mode for fakesmsc
Stipe Tolj <[email protected]>
| Newsgroups | gmane.comp.mobile.kannel.devel |
|---|---|
| Organization | tolj.org system architecture |
| Message-ID | <[email protected]> |
Alejandro Guerrieri wrote:
> Dear list,
>
> I've made a patch for fakesmsc to implement a sort of "Interactive Mode".
>
> The patch modifies fakesmsc as follows:
>
> If you call fakesmsc without any message, instead of panicking it
> enters "interactive mode", meaning that listens on stdin for "fake MO"
> messages.
>
> Syntax for messages is the same as with regular non-interactive mode
> (123 456 text Hello world), though no quotation marks are necessary.
> One message per line, newline sends the message.
>
> If you run kannel on localhost:10000 that means that you can call
> fakesmsc without any switches and start typing your messages on stdin
> and get the responses on stdout.
>
> I've implemented it using select() on stdin so fgets doesn't block (it
> timeouts and continues) and new messages are displayed on stdout
> without the need to type anything. I've set a buffer of 256 bytes and
> a timeout of 1 second, it could be easily changed from a couple of
> defines on top of fakesmsc.c
>
> I've found it quite useful to emulate user interaction on a more
> "human" way (for trivias and similar sms games, for example, where
> messages are very context-dependent).
>
> Of course it could be theoretically possible to wrap this with
> tcpserver or a similar beast and implement a socket based client from
> a higher level language, but I didn't tried yet.
>
> Patch it's here:
>
> http://www.magicom-bcn.net/kannel/fakesmsc_interactive_mode.patch
>
> A small excerpt explaining the new functionality for the userguide is
> also included.
>
> Hope it helps somebody.
Hi Alejandro,
thanks a lot for patch submission!
This sounds definatly like a "feature add" for Kannel. I will try to clear up a
time slot for reviewing this up to this end of week-end.
If anyone of the others may please test and review and vote, so we have a more
consensus decission on commitment.
Stipe
-------------------------------------------------------------------
Kölner Landstrasse 419
40589 Düsseldorf, NRW, Germany
tolj.org system architecture Kannel Software Foundation (KSF)
http://www.tolj.org/ http://www.kannel.org/
mailto:st_{at}_tolj.org mailto:stolj_{at}_kannel.org
-------------------------------------------------------------------