mirror of
https://github.com/jambonz/chrome-extension-dialer.git
synced 2026-01-25 02:08:05 +00:00
added xquanluu fix and corrected sipServerAddress
This commit is contained in:
@@ -233,22 +233,24 @@ export const Phone = forwardRef(
|
|||||||
unregisteredReasonRef.current = "";
|
unregisteredReasonRef.current = "";
|
||||||
}
|
}
|
||||||
setStatus("disconnected");
|
setStatus("disconnected");
|
||||||
if (isRestartRef.current) {
|
setIsOnline(false);
|
||||||
createSipClient();
|
setIsSwitchingUserStatus(false);
|
||||||
isRestartRef.current = false;
|
if (sipUA.current) {
|
||||||
|
sipUA.current.stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (args.error) {
|
if (args.error) {
|
||||||
toast({
|
toast({
|
||||||
title: `Cannot connect to ${sipServerAddressRef.current}, ${args.reason}`,
|
title: `Cannot connect to ${sipServerAddressRef.current}${
|
||||||
|
args.reason ? `, ${args.reason}` : ""
|
||||||
|
}`,
|
||||||
status: "warning",
|
status: "warning",
|
||||||
duration: DEFAULT_TOAST_DURATION,
|
duration: DEFAULT_TOAST_DURATION,
|
||||||
isClosable: true,
|
isClosable: true,
|
||||||
});
|
});
|
||||||
if (sipUA.current) {
|
} else if (isRestartRef.current) {
|
||||||
sipUA.current.stop();
|
createSipClient();
|
||||||
}
|
isRestartRef.current = false;
|
||||||
// isRestartRef.current = true;
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
// Call Status
|
// Call Status
|
||||||
@@ -295,9 +297,9 @@ export const Phone = forwardRef(
|
|||||||
addCallHistory,
|
addCallHistory,
|
||||||
setIsSwitchingUserStatus,
|
setIsSwitchingUserStatus,
|
||||||
setStatus,
|
setStatus,
|
||||||
sipServerAddress,
|
|
||||||
startCallDurationCounter,
|
startCallDurationCounter,
|
||||||
toast,
|
toast,
|
||||||
|
setIsOnline
|
||||||
]);
|
]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
Reference in New Issue
Block a user