Skip to content

Commit 1f68809

Browse files
committed
Add a sugar method to inbound call session
1 parent 9b539bc commit 1f68809

File tree

3 files changed

+891
-1129
lines changed

3 files changed

+891
-1129
lines changed

package.json

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "ringcentral-web-phone",
3-
"version": "2.1.6",
3+
"version": "2.1.7",
44
"repository": {
55
"type": "git",
66
"url": "git+https://github.com/ringcentral/ringcentral-web-phone.git"
@@ -34,7 +34,7 @@
3434
},
3535
"dependencies": {
3636
"blueimp-md5": "^2.19.0",
37-
"fast-xml-parser": "^5.2.1",
37+
"fast-xml-parser": "^5.2.3",
3838
"sdp-transform": "^2.15.0",
3939
"uuid": "^11.1.0"
4040
},
@@ -43,22 +43,23 @@
4343
"@rollup/plugin-commonjs": "^28.0.3",
4444
"@rollup/plugin-node-resolve": "^16.0.1",
4545
"@types/blueimp-md5": "^2.18.2",
46-
"@types/node": "^22.15.3",
46+
"@types/node": "^22.15.28",
4747
"@types/sdp-transform": "^2.4.9",
4848
"@types/uuid": "^10.0.0",
4949
"buffer": "^6.0.3",
5050
"dotenv-override-true": "^6.2.2",
5151
"events": "^3.3.0",
5252
"manate": "^2.0.0",
53-
"parcel": "^2.14.4",
53+
"parcel": "^2.15.2",
5454
"process": "^0.11.10",
55-
"rollup": "^4.40.1",
55+
"rollup": "^4.41.1",
5656
"stream-browserify": "^3.0.0",
5757
"string_decoder": "^1.3.0",
5858
"timers-browserify": "^2.0.12",
5959
"tsx": "^4.19.4",
6060
"typescript": "^5.8.3",
6161
"wait-for-async": "^0.7.13",
6262
"yarn-upgrade-all": "^0.7.5"
63-
}
63+
},
64+
"packageManager": "[email protected]+sha512.a6b2f7906b721bba3d67d4aff083df04dad64c399707841b7acf00f6b133b7ac24255f2652fa22ae3534329dc6180534e98d17432037ff6fd140556e2bb3137e"
6465
}

src/call-session/inbound.ts

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,21 @@ class InboundCallSession extends CallSession {
1919
this.emit("ringing");
2020
}
2121

22+
// for inbound calls from call queue, there will be p-rc-api-call-info header:
23+
// p-rc-api-call-info: callAttributes=queue-call,reject;callerIdName=WIRELESS CALLER;displayInfo=queueName;displayInfoSub=callerIdName;queueName=Tyler's call queue
24+
public get rcApiCallInfo() {
25+
return Object.fromEntries(
26+
this.sipMessage.headers["p-rc-api-call-info"]
27+
.split(";")
28+
.map((pair) => pair.trim())
29+
.filter(Boolean)
30+
.map((pair) => {
31+
const [key, ...rest] = pair.split("=");
32+
return [key, rest.join("=")]; // Handles '=' in value
33+
}),
34+
) as { callerIdName?: string; queueName?: string };
35+
}
36+
2237
public async confirmReceive() {
2338
await this.sendRcMessage(callControlCommands.ClientReceiveConfirm);
2439
}

0 commit comments

Comments
 (0)