Comments (8)
OK, just published [email protected], which adds
findDialogById(stackDialogId), and
findDialogByCallIDAndFromTag(callId, tag)
Note: these functions require [email protected] or above (currently the head of the 'develop' branch), which formats dialog ids as {Call-ID};from-tag={from-tag}.
additionally, if you have a reference to a dialog (uas or uac) that was created by Srf#createB2BUA
then dialog.other
will be a reference to the paired dialog.
So handling attended transfer should be a matter of:
- parsing the Refer-To header (I think I need to add a utility function somewhere to make that easier, probably in drachtio-sip), then
- calling
findDialogByCallIDAndFromTag(callId, tag)
to retrieve the dialog being replaced, then - reinviting the paired dialog by calling
Dialog#modify
ondialog.other
.
I'll leave this issue open for now until you have time to test.
from drachtio-srf.
Thanks very much for the gist with the ladder diagram, that illustrates the problem clearly.
I'm not sure I totally follow the logic above (I think I'm confused by what seems the reverse use of 'every' instead of simply 'find'), but it seems like the issue is that we need to retrieve an existing dialog (the transferree dialog) from the internal map of dialogs that srf keeps. And we need to do that by Call-ID, is that correct?
Should we just add a public method to Srf to return a dialog by call-id?
Unfortunately, it is the case that a call-id could be used on two different dialogs, though that is undesirable and somewhat unlikely (the app would have to force the call-id on different legs).
Perhaps we could also add some standard implementation for attended transfer to https://github.com/davehorton/drachtio-fn-b2b-sugar ?
from drachtio-srf.
also, let's try not to assume that the format of the dialog id is the calling =+[";uas"|";uac"] quite yet. I'm looking into changing that to be more correctly some combination of the callid and from tag
from drachtio-srf.
I'm testing a new branch in drachtio-server called 'dialog-naming' to test a change in assigning dialog ids -- they will now be ${callid};from-tag=${fromTag}
, which will be more strictly correct. So hold off on any hardcoding in your app of dialog id construction, and once I merge this branch I will add a public method in Srf to return a dialog given the call-id and the from tag, which I think will support the attended transfer scenario nicely
from drachtio-srf.
Yeah, I think that will work since the Replaces headers includes the from-tag
and to-tag
. But, the hard part is that we actually need the dialog on the other side of the B2BUA call, since that is the dialog we need to update for the transfer.
Here is an example of the current dialog map:
srf._dialogs = [
121314, # call B
891011;uas, # call B
4567, # call A
1234;uas # call A
]
So, currently, if the Replaces
header has the Call-ID 4567
, I actually need to update the 1234;uas
dialog.
from drachtio-srf.
ah, ok, then here is what I think we do:
first, I've already merged the change to the develop branch of drachtio-server to format the dialog id as suggested above. This is in version v0.8.2-rc2, which you will need to test against once all of this is ready.
In upcoming [email protected], I will add two methods:
Srf#findDialogById(stackDialogId)
Srf#findDialogByCallIDAndFromTag(callId, tag)
also, as part of createB2BUA the {uas, uac} SipDialogs that are returned will each have a reference to each other via the 'other' property, e.g.
uas.other === uac && uac.other === uas
So therefore, your code should (I think) only have to:
- parse the Refer-To header in the REFER, get the call-id and from tag
- call srf.findDialogByCallIDAndFromTag(callId, tag) to retrieve the dialog being replaced
- then send the re-INVITE on dlg.other
Does that make sense?
I want to add a test case for this before I push the changes
from drachtio-srf.
Yeah, that makes sense and will work great. Thanks!
from drachtio-srf.
I was able to test. This worked great! Thank you so much
from drachtio-srf.
Related Issues (20)
- PRACK interoperability not working HOT 3
- B2BUA 200 response missing SDP HOT 4
- OPTIONS request that causes a problem HOT 4
- Upgrade UUID to version 8 to avoid warnings for 3.4.0 HOT 2
- Broken links in https://drachtio.org/api HOT 1
- 407 response with re-Invite HOT 1
- ON Bye message in UAC/UAS , URl is replaced as placeholder and i am not getting bye message on the client HOT 1
- How can Srf client know about the loss of TCP/WS connection from SIP client to Drachtio server HOT 26
- how to place a call with asterisk HOT 3
- How to set SIP transport for createUac HOT 8
- SipError: Sip non-success response: 408 HOT 4
- createB2BUA can forward UAS Cancel request to UAC Cancel request.
- Can I get the headers of received CANCEL? HOT 17
- Do both Drachtio and SRF support SIP REPLACE?
- Public IP in Contact Header in #createUAS HOT 2
- Request-Line change request in SRF HOT 3
- Server error: unable to find dialog for dialog id provided HOT 1
- Getting periodic 486 and 503 errors HOT 3
- Srf types not updated correctly sometime after 4.5.23 HOT 3
- Capture all SIP messages in SIP Dialogs HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from drachtio-srf.