Git Product home page Git Product logo

Comments (9)

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

hi,
maybe it will be better to get a callback when :

  • bridge begins between A and B legs
  • bridge ends between A and B legs

?

from plivoframework.

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

A new idea :

when one B leg answers (so the first endpoint which answers), getting an event posted to a callbackUrl with params :
DialBLegUUID : B leg uuid
DialALegUUID : A leg uuid
DialBLegStatus : answer
CallUUID : A leg uuid (the one doing the Dial)

when B leg hangup, getting an event posted to a callbackUrl with params :
DialBLegUUID : B leg uuid
DialALegUUID : A leg uuid
DialBLegStatus : hangup
DialBLegHangupCause : B leg hangup cause
CallUUID: A leg uuid (the one doing the Dial)

The important thing is if you are dialing more than one B leg :

  • you will get one callback hangup http request for each B leg.
  • you will get one http request for B leg answer if someone answers
  • Each B leg which doesn't answer has DialBLegHangupCause set to "LOSE_RACE" in hangup callback

from plivoframework.

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

or when LOSE_RACE for a B leg we can drop the http request, so you will only get the B leg which answered.

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

I don't know what LOSE_RACE is, but when the b leg answered would be fine.

from plivoframework.

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

ok done

Now you can do:

<Dial callbackUrl="MYURL" callbackMethod="POST"> .... </Dial>

If one B leg answers, a POST http request is sent to MYURL with params :
DialBLegUUID : B leg uuid
DialALegUUID : A leg uuid
DialBLegStatus : answer
CallUUID : A leg uuid (the one doing the Dial)

If this same B legs hangup, a POST http request is sent to MYURL with params : :
DialBLegUUID : B leg uuid
DialALegUUID : A leg uuid
DialBLegStatus : hangup
DialBLegHangupCause : B leg hangup cause
CallUUID: A leg uuid (the one doing the Dial)

Note that if no B leg answers, no http request will be fired.

IMPORTANT :
The config file in plivo has changed so I recommend you remove your current plivo install and reinstall it from scratch
(not FS only plivo)
Note that now, hangup http request is handled in plivo-rest for both incoming and outgoing calls.

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

Thanks Mike. I'm trying this now.

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

Also, can you add this to plivohelper-python?

from plivoframework.

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

Already added to all helpers =)

from plivoframework.

mattwilliamson avatar mattwilliamson commented on July 29, 2024

Looks like the helper already supports it :)

This is working perfectly. Thanks a ton!

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.