Sending offline commands to freeswitch

17 views
Skip to first unread message

stony999

unread,
Oct 15, 2008, 9:48:28 AM10/15/08
to Liverpie Support
Hello Alex,

the way I understand how liverpie works is that
- it sends a command to freeswitch in the state machine controller
- waits until command is ready by receiving the appropriate answer
from freeswitch
- hits again the state machine controller

However I would like to actions to a call while it is still
proceeding. E.g.
- react on heartbeat event
- react on dtmf event
- start recording
- stop recording
- play sound

Is it possible to have liverpie e.g. react on a heartbeat event (every
20 seconds) or on a dtmf event and then play a sound file to an uuid
in certain cases (e.g. "your call limit is almost reached")?

This would be really great and would offer things which e.g. asterisk
would never be able to achieve.

Best regards
Peter

alexand...@gmail.com

unread,
Nov 14, 2008, 3:20:15 AM11/14/08
to Liverpie Support
Hello Peter,

Apologies for the inexcusably late reply.

I have just release Livepie 0.3 which triggers the webapp on DTMF
events also. Not on heartbeats though. However, this allows for far
better flexibility.

You can play sounds very easily using the playback command; you just
have to do it in response to some programmable event (like after a
read, or after a random DTMF).

If you don't mind, I'll also post a reply to your comment on the
Freeswitch wiki. By the way, don't you think that belongs rather in
the 'discussions' section?

Alex

Peter P GMX

unread,
Nov 17, 2008, 9:13:22 AM11/17/08
to liverpie...@googlegroups.com
Hello Alex,

thanks for your reply. Regarding
"By the way, don't you think that belongs rather in the 'discussions'
section?"
I agree that this normally does. In this case we had a very hard time
with Liverpie and there wasn't any response the the latest open
questions, the project seemed to be completely dead. So it should be a
"normal" behaviour to show the limits of the application to other users.

Btw. Is the described behaviour changed in the new Liverpie version? In
the version we had (0.2), Liverpie receives the latest responses in a
receive buffer and then takes the complete receive buffer as one reply,
although it sometimes containes 2 replies or only 1 1/2.
Ok. I just reviewed the code. It is still the same code part.

Best regards
Peter


al...@indigenious.ro schrieb:

Peter P GMX

unread,
Nov 17, 2008, 9:26:29 AM11/17/08
to liverpie...@googlegroups.com
Addendum:

The way I did it was in principle the following:
every time a request comes in:
- get the data,
- split it by "\n\n"
- and put it in an receive buffer array.
- Then process the receive buffer array (and delete processed entries)
until it's empty.

In practise it is important to see whether the answer was complete or
not. This was the tricky part as it involves to look into the
packet/hash and see which information is actually needed to define this
answer as a complete package.

Best regards
Peter

Peter P GMX schrieb:

Alexandru Deva

unread,
Nov 17, 2008, 9:56:37 AM11/17/08
to liverpie...@googlegroups.com
Hi Peter,

If you look at the code, I am constantly merging the parameters received from Freeswitch, so in that sense it really doesn't matter if the answer is complete or not. I was aware of this, but I didn't consider it a shortcoming, since I don't see how this is relevant.

Can you please explain to me in what context it is important that the webapp receive the answer from FS in one complete chunk? I'm not sure I can figure this out.

Thanks,

  Alex

Peter P GMX

unread,
Nov 17, 2008, 10:57:20 AM11/17/08
to liverpie...@googlegroups.com
Hello Alex,

here is a case which cause Problems.
Image you receice two responses in one package. Both responses contain
the same parameters (not all, but some of them overlap by name). The way
it is parsed now is that the parameters overwrite each other which leads
to unexpected results. I also look for the content length when an answer
comes in.
Best regards
Peter

Alexandru Deva schrieb:
> > al...@indigenious.ro <mailto:al...@indigenious.ro> schrieb:
> >
> >> Hello Peter,
> >>
> >> Apologies for the inexcusably late reply.
> >>
> >> I have just release Livepie 0.3 which triggers the webapp on DTMF
> >> events also. Not on heartbeats though. However, this allows for far
> >> better flexibility.
> >>
> >> You can play sounds very easily using the playback command; you
> just
> >> have to do it in response to some programmable event (like after a
> >> read, or after a random DTMF).
> >>
> >> If you don't mind, I'll also post a reply to your comment on the
> >> Freeswitch wiki. By the way, don't you think that belongs rather in
> >> the 'discussions' section?
> >>
> >> Alex
> >>
> >> On Oct 15, 3:48 pm, stony999 <prometheus...@gmx.net
Reply all
Reply to author
Forward
0 new messages