Missing some hints to start

15 views
Skip to first unread message

stony999

unread,
Oct 13, 2008, 7:02:06 PM10/13/08
to Liverpie Support
I read your installation and usage hints and used a standard example.
I do net get it to work. I think I am missing something in between
your hints.

What did I do?
I startet the server and it started. I dial a number in freeswitch and
I receive a request in liverpie.

Mon Oct 13 22:40:53 UTC 2008: New Connection
Mon Oct 13 22:40:53 UTC 2008: Turning on Verbose Mode
Mon Oct 13 22:40:53 UTC 2008: Data Received (content-type: command/
reply):
<a huige number of parameters>
Mon Oct 13 22:40:53 UTC 2008: Sending:
myevents

Mon Oct 13 22:40:53 UTC 2008: Resetting webapp state machine...
Mon Oct 13 22:40:53 UTC 2008: Error - could not reach the webapp:
Connection refused - connect(2)
Mon Oct 13 22:40:53 UTC 2008: Data Received (content-type: command/
reply):
Content-Type: command/reply
Reply-Text: +OK Events Enabled


Mon Oct 13 22:40:53 UTC 2008: Waiting for params[content_type] to be
command/reply.
Mon Oct 13 22:40:53 UTC 2008: Calling webapp... (with cookie: nil)
Mon Oct 13 22:40:53 UTC 2008: Error - could not reach the webapp:
Connection refused - connect(2)
Mon Oct 13 22:40:53 UTC 2008: PROBLEM: Didn't get any response from
webapp
UNBIND

I think I must at least create a controller in a Rails app. So I
created an ivr controller apps/controller/ivr_controller.rb and point
the freeswitch routing to this controller. I startet the Rails app on
Port 3002.

I receive now
Mon Oct 13 22:56:01 UTC 2008: Resetting webapp state machine...
Mon Oct 13 22:56:01 UTC 2008: Got webapp response for reset method,
with cookie:
_Liverpie_test_session=BAh7BzoObmV4dF9zdGVwIhBzYXlfd2VsY29tZSIKZmxhc2hJQzonQWN0aW9u
%250AQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D--
c2ece2779642783a87247b0e884b16f12437c856; path=/
Mon Oct 13 22:56:01 UTC 2008: Data Received (content-type: command/
reply):
Content-Type: command/reply
Reply-Text: +OK Events Enabled


Mon Oct 13 22:56:01 UTC 2008: Waiting for params[content_type] to be
command/reply.
Mon Oct 13 22:56:01 UTC 2008: Calling webapp... (with cookie:
"_Liverpie_test_session=BAh7BzoObmV4dF9zdGVwIhBzYXlfd2VsY29tZSIKZmxhc2hJQzonQWN0aW9u
%250AQ29udHJvbGxlcjo6Rmxhc2g6OkZsYXNoSGFzaHsABjoKQHVzZWR7AA%253D%253D--
c2ece2779642783a87247b0e884b16f12437c856; path=/")
Mon Oct 13 22:56:02 UTC 2008: Error - code(422) -
Mon Oct 13 22:56:02 UTC 2008: PROBLEM: Didn't get any response from
webapp

Also opening the webpage http://ip/apps/state_machine doen't work. It
always gives an empty page with no code inside.

I think there are lacking some things in between. What am I doing
wrong?


Alex Deva

unread,
Oct 14, 2008, 1:28:19 AM10/14/08
to liverpie...@googlegroups.com
Hello, stony999,

Your problem isn't with Liverpie -- as you say yourself, your webapp can't even be connected to, not even from the browser. Liverpie says so ("could not reach the webapp").

If your webapp runs on port 3002, then you should:

a. Include the port number in the address you type in your browser, i.e.: http://ip:3002/apps/state_machine and then make sure it responds with valid YAML in the browser.
b. Make sure the data given in the configuration file liverpie.yml is accurate.

On your second attempt you seem to have managed to start the webapp and Liverpie is able to call the state machine reset method, but for some reason your webapp crashes thereafter or returns a non-200 HTTP code. I suggest you have a look in your application's log (log/development.log in your Rails app) and see what goes wrong there.

As a rule, it only makes sense to fire up Liverpie once you can successfully use your webapp from within a browser, getting valid and correct YAML responses for each call.

Good luck,

  Alex

stony999

unread,
Oct 14, 2008, 6:26:09 PM10/14/08
to Liverpie Support
Thanks for your hints.

I does run now mostly, however the application stops with the sleep
api call.
See output of ngrep:
T 192.168.178.35:8084 -> 192.168.178.55:51994 [AP]
api sleep 1000
#
T 192.168.178.55:51994 -> 192.168.178.35:8084 [AP]
Content-Type: api/response
Content-Length: 26
##
T 192.168.178.55:51994 -> 192.168.178.35:8084 [AP]
sleep: Command not found!

I did a "show api" in the CLI and it indeed didn't show a sleep
command. I check out the newest FS SVN version, built it, but no
change.

Any idea how to enable this?

Also with the old build the read application worked correctly, but
with the current it doesn't work with Liverpie correctly. I can log
correct dtmf events while grepping the network traffic, however
Liverpie does not recognize them most oft the times. Strange.

Any idea?

Alex Deva

unread,
Oct 15, 2008, 1:55:14 AM10/15/08
to liverpie...@googlegroups.com
Hi,

The "sleep" command is, as you figured out, part of the FS API and
therefore out of Liverpie's control. The good news is that I was just
using it as a no-op, so you can feel free to replace it with any
other kind of costless command, like setting a dummy variable or
something.

Regarding "read", there's really nothing for recognize, since DTMF
recognition is performed strictly inside FS. The "read" command
handles DTMF recognition and then populates an FS variable with the
DTMF digits that were read; all Liverpie does then is to forward this
variable (together with everything else) towards your webapp as an
HTTP parameter.

Therefore it follows that if in your webapp you get the wrong DTMF
response, it's because that's how FS had set it in the corresponding
variable (Liverpie really doesn't interfere and has no hand in
detecting the actual DTMF codes).

Perhaps you're having a hardware or drivers problem? Try using "read"
within a dialplan IVR and see how it behaves there. Or perhaps from
the CLI if that's possible.

As a sidenote, I've had huge problems with Asterisk and DTMF
recognition, and it turned out it was because of my PSTN-to-VoIP
provider. Are you calling directly into FS with a softphone? Try that
first.

Good luck,

Alex

stony999

unread,
Oct 15, 2008, 9:40:54 AM10/15/08
to Liverpie Support
Thanks for your hints, Alex,

the bad thing is that my statemachine simply stops after sending the
sleep command (I expect it waits for a right answer from Freeswitch).
However freeswitch runs smoothly in our environmnet, accepts DTMFs in
IVR, accepts passords in conferences and so on.
Since the new compilation of freeswitch I can see the pushed key in
the dtmf var when I ngrep the network traffic. But I do not see all of
the dtmfs on the lieverpie console anymore (not every time an event
are generated).




Reply all
Reply to author
Forward
0 new messages