Skip to content

Commit

Permalink
add code for update call status
Browse files Browse the repository at this point in the history
  • Loading branch information
Deepak-learner committed Aug 3, 2021
1 parent e101eb3 commit e311cd4
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
7 changes: 7 additions & 0 deletions src/interfaces/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -811,6 +811,13 @@ export interface INewLivechatOfflineMessageAPI {
message: string // Message text
}

export interface webrtcMessage {
callId: string
rid:string
status:string
user:string
}

/** Result structure for Livechat Offline Message */
export interface ILivechatOfflineMessageResultAPI {
message: string
Expand Down
3 changes: 2 additions & 1 deletion src/lib/api/Livechat.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import {
INewLivechatNavigationAPI,
INewLivechatCustomFieldAPI,
INewLivechatOfflineMessageAPI,
webrtcMessage,
INewLivechatCustomFieldsAPI,
ILivechatRoom,
INewLivechatRoomCredentialAPI,
Expand Down Expand Up @@ -40,7 +41,7 @@ export default class ApiLivechat extends ApiBase {
}
async deleteVisitor () { return (await this.del(`livechat/visitor/${this.credentials.token}`)).visitor }
async updateVisitorStatus (status: string) { return (await this.post(`livechat/visitor.status`, { token: this.credentials.token, status })).status }
async updateCallStatus (callStatus: string) { return (await this.post(`livechat/visitor.callStatus`, { token: this.credentials.token, callStatus })).callStatus}
async updateCallStatus (callStatus: string, rid: string) { return (await this.post(`livechat/visitor.callStatus`, { token: this.credentials.token, callStatus, rid })).callStatus}
async nextAgent (department: string = '') { return (await this.get(`livechat/agent.next/${this.credentials.token}`, { department })).agent }
async agent ({ rid }: any) { return (await this.get(`livechat/agent.info/${rid}/${this.credentials.token}`)).agent }
async message (id: string, params: ILivechatRoom) { return (await this.get(`livechat/message/${id}`, { token: this.credentials.token, ...params })).message }
Expand Down

0 comments on commit e311cd4

Please sign in to comment.