-
Notifications
You must be signed in to change notification settings - Fork 748
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
JsSIP 3.7.1 doesn't allow sending DTMF during EarlyMedia #689
Comments
Wow, your pointing a 13 year old forum content. Can you try this patch: diff --git a/lib/RTCSession.js b/lib/RTCSession.js
index 7003c25..dcb41c3 100644
--- a/lib/RTCSession.js
+++ b/lib/RTCSession.js
@@ -962,7 +962,11 @@ module.exports = class RTCSession extends EventEmitter
}
// Check Session Status.
- if (this._status !== C.STATUS_CONFIRMED && this._status !== C.STATUS_WAITING_FOR_ACK)
+ if (
+ this._status !== C.STATUS_CONFIRMED &&
+ this._status !== C.STATUS_WAITING_FOR_ACK &&
+ this._status !== C.STATUS_1XX_RECEIVED
+ )
{
throw new Exceptions.InvalidStateError(this._status);
} Please also try what would happen if you call |
I thought an old post from Iñaki would still be pretty convincing! 😉
I tried that and similarly patched DTMF.js diff --git a/lib/RTCSession/DTMF.js b/lib/RTCSession/DTMF.js
index d27b4ac..5665c40 100644
--- a/lib/RTCSession/DTMF.js
+++ b/lib/RTCSession/DTMF.js
@@ -48,9 +48,9 @@ module.exports = class DTMF extends EventEmitter
this._direction = 'outgoing';
// Check RTCSession Status.
- if (this._session.status !== this._session.C.STATUS_CONFIRMED &&
- this._session.status !== this._session.C.STATUS_WAITING_FOR_ACK)
- {
+ if (
+ this._session.status !== this._session.C.STATUS_CONFIRMED &&
+ this._session.status !== this._session.C.STATUS_WAITING_FOR_ACK &&
+ this._session.status !== this._session.C.STATUS_1XX_RECEIVED
+ ) {
throw new Exceptions.InvalidStateError(this._session.status);
}
but apparently there's still something wrong: |
You don't specify whether you were trying to send the DTMF after receiving 100 or 1XX. I'm certain it won't work before 1XX, not 100% sure if it would after 1XX. |
Sorry, you're right, but the error looks exactly the same to me, in both conditions. This is the console log of a sendDTMF() call just after a SIP 100 Trying:
And this is the log just after a 183 Session progress:
|
Just a note that this also exists in 3.9.1, and also in sendInfo. A similar patch also doesn't fix that one; _dialog is null when it goes to do the actual send. |
Does the 183 response has a Contact header? |
The 183 in an above comment doesn't have any Contact header so indeed there is no early dialog established yet and hence JsSIP cannot send in-dialog requests to the remote (because there is no remote URI yet). |
In my case, it looks like this before I try to send dtmf: JsSIP:Transport received text message: SIP/2.0 183 Session Progress So in my case, yes, there's a contact header. |
this need to change to sip server of frontend developer ? I tried this but did not work . async DTMFCall(tone) {
} |
JsSIP 3.7.1 seems to have the same issue described here:
https://twinklephone.yahoogroups.narkive.com/aXB3Vk5Q/twinkle-doesn-t-allow-sending-dtmf-during-earlymedia
TLDR: Sending a DTMF tone with
JsSIP.RTCSession.sendDTMF()
after a "183 Session Progress" and before a "SIP/2.0 200 OK" should be possibile, but JsSIP raises an "INVALID_STATE_ERROR: Invalid status: 2" error instead.The text was updated successfully, but these errors were encountered: