-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
rtpengine.offer is having issues #4
Comments
It sounds like either the 'offer' message is not making it to rtpengine, or the response from rtpengine is not making it back. Can you check the rtpengine logs first, to make sure it is receiving the 'offer' command? If so, the issue may be that the ip address the drachtio app is running on is not reachable from rtpengine....is the drachtio app behind a nat or something? What IPs are the app and rtpengine running on? |
Thanks for the quick reply, I'm running rtpengine docker using below command: docker run -it --rm --name rtpengine -p 22222:22222/udp rtpengine Previously I was not providing port like this '22222:22222/udp', it might causing that issue, after making this change it now gets back from the rtp.offer() method but its now giving an error. Error: Steps I'm doing -Now after running these two (i.e. drachtio & rtpengine) have registered a user (which was created on Blink) on drachtio i.e. on 172.17.0.2, then added a contact in my Blink client whose sip address is sip:[email protected] (here 172.16.17.28 is my machine's IP address), once I made a call it reaches to the 'invite' handler but sends the above mentioned error in response Code const rtpConfig = {
|
which docker image are you using? I think you need to expose the rtp ports as well. Try this and let me know if this resolves the error you are seeing:
|
actually, try this:
|
I'm providing the min & max ports from the config, here are my config details: I've cloned the repository from https://github.com/davehorton/docker-rtpengine Here is the error log after making call from Blink to my own IP: [1559625897.292638] INFO: Creating metadata directory "/tmp/metadata". |
The above issue has been resolved by increasing the number of ports in the config file, although its a workaround but after making following change it started working, Now I'm facing another issue which comes in Scenario is, an account has been registered on drachtio on machine A, I called on my own IP using Blink, when it comes on 'invite' handler, rtpengine.offer(rtpConfig,
Object.assign(details, { 'sdp': req.body, 'record call': 'yes' }))
.then((rtpResponse) => {
console.log(`got response from rtpengine: ${JSON.stringify(rtpResponse)}`);
if (rtpResponse && rtpResponse.result === 'ok')
return rtpResponse.sdp;
throw new Error('rtpengine failure');
})
.then((sdpB) => {
console.log(`rtpengine offer returned sdp ${sdpB}`);
return srf.createB2BUA(req, res, dest, {
localSdpB: sdpB,
localSdpA: getSdpA.bind(null, details)
});
})
.then(({ uas, uac }) => {
console.log('call connected with media proxy');
uas.on('destroy', () => uac.destroy());
uac.on('destroy', () => uas.destroy());
})
.catch((err) => {
console.error(`Error proxying call with media: ${err}: ${err.stack}`);
}); When the const rtpConfig = {
"host": "IP Address of Machine A where rtpengine is running",
"port": 22222,
"local-port": 2223
};
return rtpengine.answer(rtpConfig, Object.assign(details, {
'sdp': remoteSdp,
'to-tag': res.getParsedHeader('To').params.tag,
'ICE': 'remove'
}))
.then((response) => {
if (response.result !== 'ok')
throw new Error(`Error calling answer: ${response['error-reason']}`);
return response.sdp;
}); Creating answer throws an error at runtime.
My question is where should I get this 'to-tag' to create an answer or is there anything I'm doing wrong? |
A few things: First, I see that I had an issue in a recent checkin to
If you still find you are getting that error about no ports available, that would be very strange. As far as your specific scenario, it sounds like you are running two drachtio servers, and the call flow is client A --> server A --> server B --> client B Is there some reason you are running two drachtio sip servers in this scenario? i.e. why aren't clients A and B registering to the same server? This is leading to your problem, which is that you are calling This all seems needlessly complex to me, but maybe I don't understand what you are trying to accomplish. If you want to see an example of an app that allows sip phones to register and call each other, and webrtc clients to do the same, and further to make and receive calls on a SIP trunk to the PSTN, please have a look at https://github.com/davehorton/drachtio-basic-registrar. |
Here is my use case, We have a SIP proxy server say The caller sends an invite to the callee, and the callee sends the answer respectively. |
OK, I think the issue is you are not understanding exactly how rtpengine 'offer' and 'answer' work. You shouldn't be calling 'offer' from the UAC side of the callflow, and then 'answer' from the UAS side. You call offer / answer as a pair, both from the same side (either UAC, or UAS, or both). Stepping back, you need to decide whether you need to run two instances of rtpengine or one. You basically have two SIP elements here, and it's not clear to me if they have different functions.
When your app on Completely separately, over on your app on So you are calling two sets of offer/answer pairs, each from one of the servers. https://github.com/davehorton/drachtio-basic-registrar may be a better example for you to look at |
In my scenario, user will be making call from some SIP client e.g. Blink, which will be handled by the 'invite' handler of drachtio, at this place I've the SDP of caller i.e. coming from Blink, now the application will then interact with a webrtc client (the other party to interact with) to get its SDP and exchange the two SDPs between them to make a connection, here we need to make this happen via webrtc, for which we've installed rtpengine, currently the problem I'm facing is that whenvever I called rtpengine.offer method, it never comes back (not even in catch flow), instead it cancels the call after few seconds.
The text was updated successfully, but these errors were encountered: