Comments (17)
It looks like this is where the CANCEL event is emitted:
drachtio-srf/lib/drachtio-agent.js
Line 593 in 97d8317
SipMessage
passed to the event listenerfrom drachtio-srf.
Thank you for your answer.
But I already tried to do that,
req.on('cancel', async (cancelReq) => {
...
});
But I think cancelReq.headers
is not define.
Actually, I double checked that cancelReq
is undefined in that case.
Is it a req
object from CANCEL?
from drachtio-srf.
@xquanluu can you comment? I think we just dealt with this requirement recently
from drachtio-srf.
Take a look at this example:
expectCancel(uri) {
this.srf.invite((req, res) => {
req.on('cancel', (cancelReq) => {
const headers = cancelReq.headers;
console.log(headers);
})
this.srf.createB2BUA(req, res, uri)
.then(({uas, uac}) => {
throw new Error('unexpected dialog success - expected CANCEL from uac');
})
.catch((err) => {
debug(`expectCancel: expected a final 487, got ${err}`);
if (err.status === 487) return;
throw err;
});
});
}
Output:
{
via: 'SIP/2.0/UDP 172.29.0.2:5060;branch=z9hG4bK-1-1-0;rport=5060',
from: 'sipp sip:[email protected]:5060;tag=1SIPpTag001',
to: 'service sip:[email protected]:5060',
'call-id': '[email protected]',
cseq: '1 CANCEL',
reason: 'SIP;cause=200;text="Call completed elsewhere"',
'content-length': '0'
}
from drachtio-srf.
Not sure is what you are looking for? @calvet27
from drachtio-srf.
You may want to play with this testcase:
https://github.com/drachtio/drachtio-srf/blob/main/test/scripts/b2b.js#L24
from drachtio-srf.
Can you give me version information about supporting cancelReq
?
from drachtio-srf.
Can you use drachtio-srf: 4.5.28
drachtio-server: latest
from drachtio-srf.
I use 4.4.18. After updating to 4.5.28, I will let you know the results.
from drachtio-srf.
Can I get you tag information of the latest drachtio?
Is it same with 0.8.22?
from drachtio-srf.
Yes it's correct.
from drachtio-srf.
@xquanluu
But it looks different.
0.8.22 does not give me cancel object but latest give me.
I updated drachtio-srf to 4.5.26.
Any advice?
from drachtio-srf.
Can you tell me how you build and deployed drachtio? via docker?
from drachtio-srf.
@xquanluu
Yes. I installed Drachtio SIP Server via Docker. The image is from Docker hub.
Drachtio
I had some tests to compare 0.8.22 and latest and then I noticed that the only the latest one worked properly.
cancelReq
is undefined with 0.8.22 and Drachtio SRF 4.5.26 was used for both cases.
from drachtio-srf.
hmm. Strange but yes please use latest tag.,
0.8.2 was released 2 months ago, from that time up to now there is no official release yet.
from drachtio-srf.
I'm sorry to make you confused. Now 0.8.22 works properly.
Close this issue! Thank you for your support!
from drachtio-srf.
Closing this issue.
from drachtio-srf.
Related Issues (20)
- Replacing use of console.error with an event emitter HOT 6
- 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
- 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.
- 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.