Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
B
BoxDialer
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kulya
BoxDialer
Commits
45ee8cdd
Commit
45ee8cdd
authored
Jun 11, 2024
by
Muhammadali
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
verison: 4.8.87, fixed bud of video tag
parent
df4c2b99
Changes
4
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
10779 additions
and
10778 deletions
+10779
-10778
.gitignore
.gitignore
+1
-0
package-lock.json
package-lock.json
+10746
-10746
package.json
package.json
+1
-1
boxDIaler.js
src/lib/boxDIaler.js
+31
-31
No files found.
.gitignore
View file @
45ee8cdd
.DS_STORE
node_modules
dist
prod
scripts/flow/*/.flowconfig
.flowconfig
*~
...
...
package-lock.json
View file @
45ee8cdd
This diff is collapsed.
Click to expand it.
package.json
View file @
45ee8cdd
{
"name"
:
"boxdialer"
,
"version"
:
"4.8.8
5
"
,
"version"
:
"4.8.8
7
"
,
"description"
:
""
,
"main"
:
"src/boxDialer.js"
,
"scripts"
:
{
...
...
src/lib/boxDIaler.js
View file @
45ee8cdd
/** @format */
import
{
toast
}
from
'
react-hot-toast
'
;
import
{
toast
}
from
'
react-hot-toast
'
;
import
outcomingringTone
from
'
../sounds/ringtone.wav
'
;
import
waitRingTone
from
'
../sounds/ringbacktone.wav
'
;
import
pickSound
from
'
../sounds/dtmf.wav
'
;
import
{
WebSocketInterface
,
UA
}
from
'
jssip
'
;
import
{
WebSocketInterface
,
UA
}
from
'
jssip
'
;
import
tugpng
from
'
../img/tug.png
'
;
import
packageJson
from
'
../../package.json
'
;
...
...
@@ -66,13 +66,13 @@ export class BoxDialer {
this
.
played
=
true
;
});
this
.
isRestarting
=
false
;
this
.
videoRemote
=
document
.
createElement
(
'
video
'
);
this
.
videoLocal
=
document
.
createElement
(
'
video
'
);
//
this.videoRemote = document.createElement('video');
//
this.videoLocal = document.createElement('video');
this
.
remoteAudio
=
document
.
createElement
(
'
audio
'
);
this
.
remoteAudio
.
autoplay
=
true
;
document
.
body
.
appendChild
(
this
.
videoRemote
);
document
.
body
.
appendChild
(
this
.
videoLocal
);
//
document.body.appendChild(this.videoRemote);
//
document.body.appendChild(this.videoLocal);
document
.
body
.
appendChild
(
this
.
remoteAudio
);
this
.
ringtone
=
new
Audio
(
outcomingringTone
);
...
...
@@ -87,7 +87,7 @@ export class BoxDialer {
};
this
.
options
=
{
eventHandlers
:
this
.
uaEvents
(),
mediaConstraints
:
{
audio
:
true
,
video
:
false
},
eventHandlers
:
this
.
uaEvents
(),
mediaConstraints
:
{
audio
:
true
,
video
:
false
},
};
}
...
...
@@ -182,7 +182,7 @@ export class BoxDialer {
});
window
.
navigator
.
mediaDevices
.
getUserMedia
({
audio
:
true
})
.
getUserMedia
({
audio
:
true
})
.
then
(
function
(
stream
)
{
console
.
log
(
'
User_Danied_Media_Access
'
,
'
You let me use your mic!
'
,);
})
...
...
@@ -274,7 +274,7 @@ export class BoxDialer {
greeting
.
addEventListener
(
'
click
'
,
cbk
);
}
onSoundType
({
type
,
bool
})
{
onSoundType
({
type
,
bool
})
{
this
.
ringtone
.
remove
();
this
.
waitRingTone
.
remove
();
this
.
pickSound
.
remove
();
...
...
@@ -321,7 +321,7 @@ export class BoxDialer {
}
}
sipRegister
=
({
number
,
secret
,
wsurl
,
isIce
})
=>
{
sipRegister
=
({
number
,
secret
,
wsurl
,
isIce
})
=>
{
try
{
if
(
window
?.
alovoice_setversion
&&
packageJson
?.
version
)
{
window
.
alovoice_setversion
(
packageJson
?.
version
);
...
...
@@ -438,7 +438,7 @@ export class BoxDialer {
this
.
showNotification
(()
=>
{
this
.
answerButtonClick
();
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
true
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
true
});
this
.
setGuiPhoneState
({
funcName
:
'
modalState
'
,
stateCode
:
'
connectingIncoming
'
,
funcParam
:
{
bool
:
true
,
callType
:
'
incoming
'
,
...
...
@@ -457,7 +457,7 @@ export class BoxDialer {
this
.
callSession
.
on
(
'
accepted
'
,
()
=>
{
console
.
log
(
'
%c newRTCSession accepted:
'
,
'
font-size: 22px; color: yellow;
'
,
e
,);
// the call has answered
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
setGuiPhoneState
({
funcName
:
'
modalState
'
,
stateCode
:
'
connected
'
,
funcParam
:
{
bool
:
true
,
callType
:
'
connected
'
,
...
...
@@ -519,7 +519,7 @@ export class BoxDialer {
bool
:
false
,
type
:
null
,
});
this
.
stopInnerTimer
();
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
closeBxCall
();
this
.
hangupButtonClick
();
this
.
setGuiPhoneState
({
...
...
@@ -616,7 +616,7 @@ export class BoxDialer {
return
sipState
&&
uiStates
[
sipState
]
?
uiStates
[
sipState
]
:
''
;
}
callBxMethods
({
bxMethodName
,
bxFuncParams
,
callback
})
{
callBxMethods
({
bxMethodName
,
bxFuncParams
,
callback
})
{
if
(
window
.
BX24
&&
window
.
BX24
.
placement
)
{
window
?.
BX24
.
placement
.
call
(
bxMethodName
,
bxFuncParams
,
callback
);
}
else
if
(
window
.
alovoicePhone
&&
window
.
alovoicePhone
.
callMethods
)
{
...
...
@@ -636,13 +636,13 @@ export class BoxDialer {
}
}
setGuiPhoneState
({
stateCode
,
funcName
,
funcParam
})
{
console
.
log
(
'
boxdialer_setGuiPhoneState_states:
'
,
{
stateCode
,
funcName
,
funcParam
})
setGuiPhoneState
({
stateCode
,
funcName
,
funcParam
})
{
console
.
log
(
'
boxdialer_setGuiPhoneState_states:
'
,
{
stateCode
,
funcName
,
funcParam
})
if
(
window
?.
alovoice_wsphone
&&
!!
stateCode
?.
length
)
{
console
.
log
(
'
this_getBxUiState_stateCode
'
,
stateCode
,
this
.
getBxUiState
(
stateCode
),);
this
.
callBxMethods
({
bxMethodName
:
'
CallCardSetUiState
'
,
bxFuncParams
:
{
uiState
:
this
.
getBxUiState
(
stateCode
)
},
bxFuncParams
:
{
uiState
:
this
.
getBxUiState
(
stateCode
)
},
callback
:
(
e
)
=>
{
console
.
log
(
e
,
`CallCardSetUiState method done
${
e
}
`
);
},
...
...
@@ -659,23 +659,23 @@ export class BoxDialer {
console
.
log
(
`%c BXLOG:`
,
datas
,
'
background-color: red;
'
);
}
onSessionEvent
({
type
,
event
})
{
onSessionEvent
({
type
,
event
})
{
}
selectUser
()
{
BX
.
Runtime
.
loadExtension
(
'
ui.entity-selector
'
).
then
((
exports
)
=>
{
const
{
Dialog
,
TagSelector
}
=
exports
;
const
{
Dialog
,
TagSelector
}
=
exports
;
const
dialog
=
new
BX
.
UI
.
EntitySelector
.
Dialog
({
// targetNode: button,
enableSearch
:
true
,
multiple
:
false
,
context
:
'
MY_MODULE_CONTEXT
'
,
entities
:
[{
id
:
'
user
'
,
// пользователи
options
:
{
selectFields
:
[
'
ufPhoneInner
'
]
},
options
:
{
selectFields
:
[
'
ufPhoneInner
'
]
},
},
{
id
:
'
department
'
,
// структура компании: выбор только пользователей
},],
events
:
{
'
_Item:onSelect
'
:
(
event
)
=>
{
const
{
item
}
=
event
.
getData
();
const
{
item
}
=
event
.
getData
();
const
dialog
=
event
.
getTarget
();
const
selectedItems
=
dialog
.
getSelectedItems
();
...
...
@@ -693,7 +693,7 @@ export class BoxDialer {
});
}
// call_connected;
// call_connected;
setSipStateChangeCallback
(
callback
,
funcName
)
{
this
.
onSipStateChange
[
funcName
]
=
callback
.
bind
(
this
);
}
...
...
@@ -731,7 +731,7 @@ export class BoxDialer {
}
skipButtonClick
()
{
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
hangupButtonClick
();
}
...
...
@@ -745,23 +745,23 @@ export class BoxDialer {
muteButtonClick
()
{
let
{
audio
}
=
this
.
callSession
.
isMuted
();
let
{
audio
}
=
this
.
callSession
.
isMuted
();
if
(
audio
)
{
this
.
callSession
.
unmute
();
console
.
log
(
'
muteButtonClick_unmute
'
);
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callMute
:
false
});
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callMute
:
false
});
}
else
{
this
.
callSession
.
mute
();
console
.
log
(
'
muteButtonClick_mute
'
);
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callMute
:
true
});
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callMute
:
true
});
}
}
answerButtonClick
()
{
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
callSession
?.
answer
(
this
.
options
);
this
.
callSession
.
connection
.
addEventListener
(
'
addstream
'
,
(
event
)
=>
{
this
.
remoteAudio
.
srcObject
=
event
.
stream
;
...
...
@@ -771,15 +771,15 @@ export class BoxDialer {
holdButtonClick
()
{
let
{
local
}
=
this
.
callSession
.
isOnHold
();
let
{
local
}
=
this
.
callSession
.
isOnHold
();
console
.
log
(
'
local:
'
,
local
);
if
(
local
)
{
this
.
callSession
.
unhold
();
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callHold
:
false
});
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callHold
:
false
});
}
else
{
this
.
callSession
.
hold
();
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callHold
:
true
});
this
.
onSipStateChange
[
'
setCallEvents
'
]({
callHold
:
true
});
}
}
...
...
@@ -788,7 +788,7 @@ export class BoxDialer {
}
hangupButtonClick
()
{
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
onSoundType
({
type
:
'
ring
'
,
bool
:
false
});
this
.
onSipStateChange
.
innerCallerModal
({
bool
:
false
,
type
:
null
,
from
:
''
,
});
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment