Getting Started With Plivo

1,100 views
Skip to first unread message

AC

unread,
May 9, 2012, 10:33:33 AM5/9/12
to plivo...@googlegroups.com
Hi all,

I have installed FS+PLIVO with clintberry.com instructions.

I have loaded the dialplan example from clintberry.com ...

But, when I dialed 1005 … not answered … I have changed the port in “DEFAULT_ANSWER_URL” from 80 … 8084 … 8088 … in some case I hear a free line …

where I wrong ?

regards
AC

Mike

unread,
May 9, 2012, 3:49:46 PM5/9/12
to plivo...@googlegroups.com
Hi,

do you have a webserver ready to serve your Plivo XML ?

Is DEFAULT_ANSWER_URL pointing to this webserver ?
--
--

Michael Ricordeau
Co-Founder Plivo

mi...@plivo.com
http://www.plivo.com
twitter @mricordeau
linkedin http://fr.linkedin.com/in/michaelricordeau

AC

unread,
May 10, 2012, 5:10:16 AM5/10/12
to Plivo Users
Hi,
I think yes ... the DEFAULT_ANSWER_URL point to http://127.0.0.1:8084/answered
... and when I call 1005 ... I have "free line tone"

How to check if my webserver is ready to serve XML ?

regards
antonello

On 9 Mag, 21:49, Mike <m...@plivo.com> wrote:
> Hi,
>
> do you have a webserver ready to serve your Plivo XML ?
>
> Is DEFAULT_ANSWER_URL pointing to this webserver ?
>
> On Wed, May 9, 2012 at 4:33 PM, AC <antone...@carlomagno.net> wrote:
> > Hi all,
>
> > I have installed FS+PLIVO with clintberry.com instructions.
>
> > I have loaded the dialplan example from clintberry.com ...
>
> > But, when I dialed 1005 … not answered … I have changed the port in
> > “DEFAULT_ANSWER_URL” from 80 … 8084 … 8088 … in some case I hear a free line
> > …
>
> > where I wrong ?
>
> > regards
> > AC
>
> --
> --
>
> Michael Ricordeau
> Co-Founder Plivo
>
> m...@plivo.comhttp://www.plivo.com
> twitter @mricordeau
> linkedinhttp://fr.linkedin.com/in/michaelricordeau

Venky

unread,
May 10, 2012, 5:11:24 AM5/10/12
to plivo...@googlegroups.com
http://127.0.0.1:8084/answered  should return the required xml for the calls to work and should be reachable by plivo from a public ip.


Regards
Venky

AC

unread,
May 10, 2012, 5:21:44 AM5/10/12
to Plivo Users
Hi Venky,

I had already tried but it always returns a blank page.

I have tried also in root command line with CURL .. but always blank
page

antonello

Venky

unread,
May 10, 2012, 5:25:54 AM5/10/12
to plivo...@googlegroups.com
Try doing view source on that blank page and see if it shows some xml?

Regards
Venky

AC

unread,
May 10, 2012, 5:42:14 AM5/10/12
to Plivo Users
Blank !

My ubuntu is configured with:

apache works on port 80
DEFAULT_ANSWER_URL = http://127.0.0.1:8084/answered/

I tried these url:

from another machine:

http://192.168.1.44 = apache response with home page
http://192.168.1.44/answered = apache response with blank page
http://192.168.1.44:8084/answered/ = apache response with error

I must configure apache with listening on another ports ?



On 10 Mag, 11:25, Venky <ve...@plivo.com> wrote:
> Try doing view source on that blank page and see if it shows some xml?
>
> Regards
> Venky
>
>
>
>
>
>
>
> On Thu, May 10, 2012 at 2:51 PM, AC <antone...@carlomagno.net> wrote:
> > Hi Venky,
>
> > I had already tried but it always returns a blank page.
>
> > I have tried also in root command line with CURL .. but always blank
> > page
>
> > antonello
>
> > On 10 Mag, 11:11, Venky <ve...@plivo.com> wrote:
> > >http://127.0.0.1:8084/answeredshould return the required xml for the

Antonello Carlomagno

unread,
May 10, 2012, 6:13:23 AM5/10/12
to plivo...@googlegroups.com
Hi Venky,

if you have time you can connect to my virtual machine to see where wrong.

I am going crazy !!

Antonello

2012/5/10 AC <anto...@carlomagno.net>:

AC

unread,
May 10, 2012, 12:15:35 PM5/10/12
to Plivo Users
I have checked the listen ports:

80 -> apache2
8084 -> python
8088 -> python
8089 -> python

but in DEFAULT_ANSWER_URL what port I must use ?


On 10 Mag, 12:13, Antonello Carlomagno <a.carloma...@gmail.com> wrote:
> Hi Venky,
>
> if you have time you can connect to my virtual machine to see where wrong.
>
> I am going crazy !!
>
> Antonello
>
> 2012/5/10 AC <antone...@carlomagno.net>:
>
>
>
>
>
>
>
> > Blank !
>
> > My ubuntu is configured with:
>
> > apache works on port 80
> > DEFAULT_ANSWER_URL =http://127.0.0.1:8084/answered/
>
> > I tried these url:
>
> > from another machine:
>
> >http://192.168.1.44   =  apache response with home page
> >http://192.168.1.44/answered   =  apache response with blank page
> >http://192.168.1.44:8084/answered/   =  apache response with error
>
> > I must configure apache with listening on another ports ?
>
> > On 10 Mag, 11:25, Venky <ve...@plivo.com> wrote:
> >> Try doing view source on that blank page and see if it shows some xml?
>
> >> Regards
> >> Venky
>
> >> On Thu, May 10, 2012 at 2:51 PM, AC <antone...@carlomagno.net> wrote:
> >> > Hi Venky,
>
> >> > I had already tried but it always returns a blank page.
>
> >> > I have tried also in root command line with CURL .. but always blank
> >> > page
>
> >> > antonello
>
> >> > On 10 Mag, 11:11, Venky <ve...@plivo.com> wrote:
> >> > >http://127.0.0.1:8084/answeredshouldreturn the required xml for the

Mike

unread,
May 10, 2012, 12:32:26 PM5/10/12
to plivo...@googlegroups.com
DEFAULT_ANSWER_URL points to the url you want .

The flow of an inbound call is like that :

Inbound Call => Freeswitch => Plivo => HTTP GET/POST to DEFAULT_ANSWER_URL

You can use apache, nginx, ... any server talking HTTP .
Plivo doesn't provide the XML flow, you need to host on a webserver
the XML call flow .

When a call comes to Plivo, Plivo is fetching HTTP DEFAULT_ANSWER_URL
and retrieve the XML
you have set/you are hosting and parse this XML to make the call flow
for the call .

So on your side, you can for example use apache2 + php :
if you have apache2 listening on port 80 and you have a php script in
/var/www/xml.php
so you can point DEFAULT_ANSWER_URL to http://127.0.0.1/xml.php

xml.php will be responsible for returning XML with right syntax
according to Plivo docs .

AC

unread,
May 11, 2012, 4:00:20 AM5/11/12
to Plivo Users
Hi Mike

thanks, I thought that Apache read the XML files natively.

therefore, for TTS I must install on server a TTS engine, correct ?

what do you recommend that is compatible with FS + PLIVO?

regards
Antonello

On 10 Mag, 18:32, Mike <m...@plivo.com> wrote:
> DEFAULT_ANSWER_URL points to the url you want .
>
> The flow of an inbound call is like that :
>
> Inbound Call => Freeswitch => Plivo => HTTP GET/POST to DEFAULT_ANSWER_URL
>
> You can use apache, nginx, ... any server talking HTTP .
> Plivo doesn't provide the XML flow, you need to host on a webserver
> the XML call flow .
>
> When a call comes to Plivo, Plivo is fetching HTTP DEFAULT_ANSWER_URL
> and retrieve the XML
> you have set/you are hosting and parse this XML to make the call flow
> for the call .
>
> So on your side, you can for example use apache2 + php :
> if you have apache2 listening on port 80 and you have a php script in
> /var/www/xml.php
> so you can point DEFAULT_ANSWER_URL tohttp://127.0.0.1/xml.php
> >> >> > >http://127.0.0.1:8084/answeredshouldreturnthe required xml for the

stewart small

unread,
Jan 9, 2013, 6:16:18 PM1/9/13
to plivo...@googlegroups.com
I am having similar issues with my plivo+freeswitch installation after following the tutorial on clintberry.com


I’m having trouble when dailing 1005 after creating the index.php file in the answer directory under my webroot. When I dail I get “failed with reason NORMAL_CLEARING”

I am using Clint's custom dailplan.xml and made all the configuration changes he mentioned. I am using FSComm as the softphone from a windows vista machine. I am running freeswitch and plivo in unbuntu 12.10 on a separate physical machine than the one the softphone is installed on.

Any help would be much appreciated. Thanks

Chris Backes

unread,
Jan 31, 2013, 12:06:36 AM1/31/13
to plivo...@googlegroups.com
stewart - can you provide your index.php contents? when you navigate to that file with your browser (http://x.x.x.x/index.php) do you receive any errors? 

stewart small

unread,
Feb 1, 2013, 10:19:17 PM2/1/13
to plivo...@googlegroups.com
Hi Clint,

When I navigate to the index.php I see no errors actually all I see is a blank page.

The contents of my index.php are below:
<?xml version="1.0" encoding="UTF-8" ?>
<Response>
     <Speak>Hello World</Speak>
</Response>

Thanks for taking the time to help with this



--
You received this message because you are subscribed to the Google Groups "Plivo Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to plivo-users...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Brad Rhoads

unread,
May 3, 2013, 3:56:03 PM5/3/13
to plivo...@googlegroups.com
I'm trying to get this exact example working too. If I dial 1005, I get tones, beep beep beep, beep beep beep, and then hang up. The fs_cli log is shown at:


If I hit the index.php I see this in the error log:

PHP Parse error:  syntax error, unexpected T_STRING in /var/www/drupal7/answer/index.php on line 1

Any ideas?

I wonder of the instructions might not be complete? There no reference to php at all or plivo.php in particular.

Derek Wildman

unread,
May 3, 2013, 4:05:35 PM5/3/13
to plivo...@googlegroups.com

Would you be able to paste bin the index.php please and I will take a look.

Have you tried using the freeswitch examples from their website. I have been following them and learned far much more on how freeswitch likes to run.

Brad Rhoads

unread,
May 3, 2013, 4:32:23 PM5/3/13
to plivo...@googlegroups.com
We're trying to follow this tutorial:

index.php has precisely the following code. It seems that the idea is that should just be echoed as the response. Should this work?

<?xml version="1.0" encoding="UTF-8" ?>
<Response>
     <Speak>Hello World</Speak>
</Response>

I found the php examples git hub here:


But I'm not sure what's what. I'm trying to get started with a simple example. Which example there would be a good starting point?

Thanks!
---------------------------
www.maf.org/rhoads
www.ontherhoads.org

Derek Wildman

unread,
May 3, 2013, 4:46:57 PM5/3/13
to plivo...@googlegroups.com

Ah okay. To keep it simple change index.php to index.xml basically in a php document it is meant to start with <?php which at the moment its starting with <?xml that will clear your syntax errors. Now go to your browser and load the index.xml file and you should see the output with your response.

Try and make a call to your extension and see if you get the correct response.

Cheers,

Derek

Tony Miller

unread,
May 3, 2013, 5:48:45 PM5/3/13
to plivo...@googlegroups.com
Brad,

You can do what Derek said to resolve the immediate problem. Do not forget to also change the answer url in Plivo config to say index.xml instead of index.php.

Alternatively, you can use this code in your index.php to resolve the syntax errors and make things work:

<?php
/* Render RESTXML */
header("content-type: text/xml");
echo "<?xml version=\"1.0\" encoding=\"UTF-8\"?>";
?>
<Response>
<Speak>Hello World</Speak>
</Response>

You did the right thing by looking at Plivo PHP examples on github. Download that entire repository and put it in your webroot (/var/www). Look at /examples/phonemenu/phonemenu.php for an excellent start at understanding how you can use Plivo for setting up an IVR/answering machine. In fact, I have a modified version of phonemenu.php set as my DEFAULT_ANSWER_URL in Plivo config.

Clint: If you happen to read this, given how high-ranked your blog is on Plivo setup searches, please update your blog article so other Plivo newbies do not face the same issue :)

Tony

Brad Rhoads

unread,
May 3, 2013, 6:15:16 PM5/3/13
to plivo...@googlegroups.com
Thanks! If works now.

---------------------------
www.maf.org/rhoads
www.ontherhoads.org

Tony Miller

unread,
May 3, 2013, 7:07:34 PM5/3/13
to plivo...@googlegroups.com
Yay! Dig into the Plivo PHP examples and have fun :)

stewart small

unread,
Jun 3, 2013, 10:45:16 PM6/3/13
to plivo...@googlegroups.com
Hi Brad,

Sorry I'm  responding to this soooooo, late. I gave up on Plivo. I found it very difficult to work with and the documentation sparse. Unfortunately It no longer falls in my plans of things to learn. I may be open to it again down the road.

Regards,
Stewart


--
You received this message because you are subscribed to a topic in the Google Groups "Plivo Users" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/plivo-users/7bozZ37_U7A/unsubscribe?hl=en.
To unsubscribe from this group and all its topics, send an email to plivo-users...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages