Skip to content

Commit 0b77581

Browse files
committed
fix: ensure Content-Type header is included in JsSIP INFO requests
1 parent 6029bf9 commit 0b77581

1 file changed

Lines changed: 6 additions & 4 deletions

File tree

static/phone_jssip.html

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2484,16 +2484,18 @@ <h3>Transfer Call</h3>
24842484
const bodyStr = JSON.stringify(parsed);
24852485

24862486
try {
2487-
// JsSIP 3.x sends custom INFO via session.sendRequest().
2488-
// Fallback: if that fails, try constructing the request through the UA.
2487+
// JsSIP 3.x: RTCSession.sendRequest() drops the `contentType`
2488+
// option — it only forwards `extraHeaders` and `body` to the
2489+
// dialog. So the Content-Type header MUST be supplied via
2490+
// extraHeaders, otherwise the server receives ct=None.
2491+
const extraHeaders = ['Content-Type: ' + contentType];
24892492
if (typeof session.sendRequest === 'function') {
24902493
session.sendRequest('INFO', {
2494+
extraHeaders: extraHeaders,
24912495
body: bodyStr,
2492-
contentType: contentType,
24932496
});
24942497
} else {
24952498
// Older JsSIP API: use session.request.sendRequest directly
2496-
const extraHeaders = ['Content-Type: ' + contentType];
24972499
session.request.sendRequest('INFO', {
24982500
extraHeaders: extraHeaders,
24992501
body: bodyStr,

0 commit comments

Comments
 (0)