freepbx Workflow
Согласно документации freepbx:
Spy /Whisper /Barge в указанном расширении. < /p>
Использование: < /p>
- Наберите локальный расширение с 556 Prefix к Spy < /li>
, пока не сталкивается на активном канале. Mode < /li>
DTMF 5 - режим Whisper < /li>
DTMF 6 - режим баржи < /li>
< /ul>
< /li>
< /ul>
< /> blockquote>
. и попытка реализовать функциональность Whisper: < /p>
init: async () => {
if (ua && ua.isConnected()) return;
JsSIP.debug.disable("JsSIP:*");
const session = await getSession();
if (!session) throw new Error("No active session found. Please log in.");
const sipExtension = session.user.sip_config.sip_extension;
const sipSecret = session.user.sip_config.sip_secret;
if (!sipExtension || !sipSecret)
throw new Error("SIP credentials not found in session.");
const socket = new JsSIP.WebSocketInterface("wss://domain/ws");
const configuration = {
sockets: [socket],
uri: `sip:${sipExtension}@[domain]`,
password: sipSecret,
display_name: "Client",
};
ua = new JsSIP.UA(configuration);
// Various event handlers...
ua.on("registered", () => {
status = "Connected to PBX";
// Successfully registered
});
ua.on("newRTCSession", (data) => {
// Session handling...
});
ua.start();
},
whisperCall: async (sipConfig) => {
console.log("Whispering to:", sipConfig);
if (!ua)
throw new Error("SIP user agent is not initialized. Call init first.");
if (currentSession)
throw new Error(
"Another call is in progress. End the current call first."
);
const targetUri = `sip:${sipConfig.sip_extension}@${SIP_DOMAIN}`;
// Store the session from the call
currentSession = ua.call(targetUri);
// Add event listener for when the call is connected
currentSession.on("confirmed", () => {
// Only send DTMF after the call is established
currentSession.sendDTMF(5, { transportType: "RFC2833" });
console.log("DTMF tone sent");
});
if (!currentSession) throw new Error("Failed to initiate whisper.");
return currentSession;
}
< /code>
проблема < /h2>
Когда я устанавливаю вызов с использованием JSSIP, я не уверен, нужно ли мне префекции с помощью «556», как это было бы с обычным телефоном, или если мне нужно справиться с тем, что в структуре SIP URI. DTMF Тон "5" Чтобы войти в режим Whisper после установки вызова, он, по -видимому, не распознается сервером FreePBX. - Когда мой агент находится в вызове с клиентом как администратор, я хочу шептать моему агенту
Подробнее здесь: https://stackoverflow.com/questions/796 ... ge-feature