Git Product home page Git Product logo

Comments (19)

mike-plivo avatar mike-plivo commented on July 29, 2024

ok added feature in dev branch :

If you set both attributes, you are tracking B legs hangup in Dial element .

In the http request you will find parameters below :
DialALegUUID
DialBLegUUID
DialBLegHangupCause

So now you can test it (sorry not tested again, I'm reinstalling my test server) :

cd /path/to/plivo/install
cd src/plivo
git pull
git checkout -b dev origin/dev

Now you are in dev branch

Restart plivo to test =)

To come back to stable version :
git checkout master

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

Unfortunately didn't work. It looks like the answered event sent the b leg params instead or something, because I am expecting a To param, but I see things like called_no instead:

2011-07-12 17:10:19,963 outbound_server[32805]: INFO: (2) Requested to http://127.0.0.1:8000/_plivo/incoming/answered/ with {'direction': 'inbound', 'called_no': 'plivo', 'from_no': '1000', 'sched_hangup_id': '', 'call_uuid': '93f891d7-21ab-4602-a071-8c24ff375514', 'aleg_request_uuid': '', 'aleg_uuid': ''}

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

That is upon answering the inbound call. I never made it to ending the call.

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

Maybe the dev version is quite out of date?

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024
  • dev is up to date =)
  • maybe I didn't understand your request :
    in my mind, it was :
  1. "A leg" Inbound call is starting a restxml scenario (by fetching answer url)

  2. In this restxml, you have a Dial Element to dial a "B Leg" and bridge it with "A Leg" (the incoming call) :
    <Dial BLegHangupAction="MyURL" BLegHangupMethod="POST" ... />

  3. When "B Leg" channel hangs up, "MYURL" must be fetched (else there is a bug)

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

That's the correct description of the feature. It seems I was checking out an old dev branch. I got the correct one running but got the following error:

2011-07-13 13:41:19,001 outboundserver[38482]: ERROR: (6) 'Dial' object has no attribute 'get_channel_unique_id'
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6) Traceback (most recent call last):
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6)   File "/Library/Python/2.6/site-packages/plivo-0.1.0-py2.6.egg/plivo/rest/freeswitch/outboundsocket.py", line 386, in _run
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6)     self.process_call()
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6)   File "/Library/Python/2.6/site-packages/plivo-0.1.0-py2.6.egg/plivo/rest/freeswitch/outboundsocket.py", line 414, in process_call
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6)     self.execute_xml()
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6)   File "/Library/Python/2.6/site-packages/plivo-0.1.0-py2.6.egg/plivo/rest/freeswitch/outboundsocket.py", line 549, in execute_xml
2011-07-13 13:41:19,002 outboundserver[38482]: ERROR: (6)     element_instance.run(self)
2011-07-13 13:41:19,003 outboundserver[38482]: ERROR: (6)   File "/Library/Python/2.6/site-packages/plivo-0.1.0-py2.6.egg/plivo/rest/freeswitch/elements.py", line 128, in run
2011-07-13 13:41:19,003 outboundserver[38482]: ERROR: (6)     result = execute(outbound_socket)
2011-07-13 13:41:19,003 outboundserver[38482]: ERROR: (6)   File "/Library/Python/2.6/site-packages/plivo-0.1.0-py2.6.egg/plivo/rest/freeswitch/elements.py", line 565, in execute
2011-07-13 13:41:19,003 outboundserver[38482]: ERROR: (6)     % (self.bleg_hangup_url, self.bleg_hangup_method, self.get_channel_unique_id())
2011-07-13 13:41:19,003 outboundserver[38482]: ERROR: (6) AttributeError: 'Dial' object has no attribute 'get_channel_unique_id'

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

Also, I think the names of the attributes should be camel-case to match the rest of the API (bLegHangupAction & bLegHangupMethod)

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

ok fixed error and changed to camel-case style in last dev commit =)

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

With Venky we were thinking about something more simple :

when doing Dial with "action" and "method", why not just adding B leg uuid in the parameters posted into http request ?

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

because action does a redirect, but I want the XML to continue executing

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

New Exception:

Traceback (most recent call last):
  File "core.pyx", line 337, in gevent.core.__simple_handler (gevent/core.c:4494)
TypeError: send_to_url() takes at most 4 arguments (5 given)
Failed to execute callback for active_event fd=-1 flags=INIT
  cb  = <built-in method switch of greenlet.greenlet object at 0x1035b2390>
  arg = ( ( <plivo.rest.freeswitch.inboundsocket.RESTInboundSocket object at 0x1035afb50>,
            u'http://127.0.0.1:8000/_plivo/b-leg/hung_up',
            { 'DialALegUUID': u'f3fa8ce9-021b-4d36-9618-053338130756',
              'DialBLegHangupCause': u'UNALLOCATED_NUMBER',
              'DialBLegUUID': u'fa06b595-0552-4122-99a6-922f9ab04c90'},
            u'POST'),
          { })

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

fixed

I was thinking something again :
we can use "action" and "method" and add B leg uuid in the parameters posted into http request
and add one extra attribute to Dial element : "redirect" :
By default redirect flag will be set to "true".
When it will be set to "false", the call won't be redirected to the http response but the http request will be fired.

<Dial action="MYURL" method="POST" redirect="false"> ... </Dial>

In the http request you will get same params as for B leg callback :

  • DialBLegUUID
  • DialHangupCause
  • DialALegUUID

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

That solution sounds good to me.

On Jul 18, 2011, at 3:36, [email protected] wrote:

fixed

I was thinking something again :
we can use "action" and "method" and add B leg uuid in the parameters posted into http request
and add one extra attribute to Dial element : "redirect" :
By default redirect flag will be set to "true".
When it will be set to "false", the call won't be redirected to the http response but the http request will be fired.

...

In the http request you will get same params as for B leg callback :

  • DialBLegUUID
  • DialHangupCause
  • DialALegUUID

Reply to this email directly or view it on GitHub:
https://github.com/plivo/plivo/issues/18#issuecomment-1593365

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

ok perfect I will do that today and will update helpers :)

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

Hi matt, try the last master branch revision, all things have been merged now.

So you can use now :

<Dial action="MYURL" method="POST" redirect="false"> ... </Dial>

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

This works but there is no DialBLegUUID posted.

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

ok I'm going to fix that today

from plivoframework.

mike-plivo avatar mike-plivo commented on July 29, 2024

ok fixed in last commit in master branch =)

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

It's all working! Thanks!

from plivoframework.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.