Skip to content

Commit

Permalink
Modify the destination email address of a transfer to match the agent…
Browse files Browse the repository at this point in the history
…_id value
  • Loading branch information
yoryer committed Feb 11, 2022
1 parent 77096fe commit 50612e6
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
5 changes: 4 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,10 @@
"description": "Toky Phone JS SDK v1",
"main": "./dist/toky-sdk-alpha.js",
"module": "./dist/toky-sdk-alpha.js",
"types": "./dist/types/index.d.ts",
"types": "./dist/types/src/index.d.ts",
"files": [
"dist"
],
"author": "Toky Team",
"directories": {
"example": "example",
Expand Down
2 changes: 2 additions & 0 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Client } from './client'
import { SessionUA } from './session'
import {
ClientStatus,
SessionStatus,
Expand All @@ -10,6 +11,7 @@ import { Media } from './media'

export default {
TokyClient: Client,
TokySession: SessionUA,
TokyMedia: Media,
ClientStatus,
SessionStatus,
Expand Down
1 change: 1 addition & 0 deletions src/session.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1041,6 +1041,7 @@ export class SessionUA extends EventEmitter implements ISession {

// TODO: maybe we can verify the agent existence
if (type === TransferEnum.AGENT) {
destination = destination.replace('@', '__')
extraHeaders.push(`X-Referred-To-Agent: ${destination}`)
}

Expand Down

0 comments on commit 50612e6

Please sign in to comment.