botium-connector-voip 0.0.25 → 0.0.26
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -589,6 +589,16 @@ class BotiumConnectorVoip {
|
|
|
589
589
|
tts_body: this.caps[Capabilities.VOIP_TTS_BODY] || null
|
|
590
590
|
}
|
|
591
591
|
};
|
|
592
|
+
_info('initcall_sent', {
|
|
593
|
+
sipCallerAddress: request.SIP_CALLER_ADDRESS,
|
|
594
|
+
sipRegistrarUri: request.SIP_CALLER_REGISTRAR_URI,
|
|
595
|
+
sipCalleeUri: request.SIP_CALLEE_URI,
|
|
596
|
+
sipCallerUsername: request.SIP_CALLER_USERNAME,
|
|
597
|
+
sipProxy: request.SIP_PROXY || null,
|
|
598
|
+
iceEnable: request.ICE_ENABLE,
|
|
599
|
+
sttUrl: request.STT_CONFIG && request.STT_CONFIG.stt_url,
|
|
600
|
+
ttsUrl: request.TTS_CONFIG && request.TTS_CONFIG.tts_url
|
|
601
|
+
});
|
|
592
602
|
debug$3(JSON.stringify(request, null, 2));
|
|
593
603
|
this.ws.send(JSON.stringify(request));
|
|
594
604
|
this.ws.on('error', err => {
|
|
@@ -729,9 +739,22 @@ class BotiumConnectorVoip {
|
|
|
729
739
|
return;
|
|
730
740
|
}
|
|
731
741
|
if (parsedData && parsedData.type === 'callinfo' && parsedData.status === 'unauthorized') {
|
|
742
|
+
_info('callinfo_sip_unauthorized', {
|
|
743
|
+
sessionId: this.sessionId,
|
|
744
|
+
event: parsedData.event || null,
|
|
745
|
+
sipCallerUsername: this.caps[Capabilities.VOIP_SIP_CALLER_USERNAME],
|
|
746
|
+
sipRegistrarUri: this.caps[Capabilities.VOIP_SIP_CALLER_REGISTRAR_URI]
|
|
747
|
+
});
|
|
732
748
|
reject(new Error('Error: Cannot open a call: SIP Authorization failed'));
|
|
733
749
|
}
|
|
734
750
|
if (parsedData && parsedData.type === 'callinfo' && parsedData.status === 'forbidden' && parsedData.event === 'onCallRegState') {
|
|
751
|
+
_info('callinfo_sip_reg_failed', {
|
|
752
|
+
sessionId: this.sessionId,
|
|
753
|
+
event: parsedData.event || null,
|
|
754
|
+
sipCallerAddress: this.caps[Capabilities.VOIP_SIP_CALLER_ADDRESS],
|
|
755
|
+
sipCallerUsername: this.caps[Capabilities.VOIP_SIP_CALLER_USERNAME],
|
|
756
|
+
sipRegistrarUri: this.caps[Capabilities.VOIP_SIP_CALLER_REGISTRAR_URI]
|
|
757
|
+
});
|
|
735
758
|
reject(new Error('Error: Sip Registration failed'));
|
|
736
759
|
}
|
|
737
760
|
if (parsedData && parsedData.type === 'callinfo' && parsedData.status === 'connected') {
|
|
@@ -758,8 +781,20 @@ class BotiumConnectorVoip {
|
|
|
758
781
|
});
|
|
759
782
|
}
|
|
760
783
|
}
|
|
784
|
+
if (parsedData && parsedData.type === 'callinfo' && !['initialized', 'unauthorized', 'forbidden', 'connected', 'disconnected'].includes(parsedData.status)) {
|
|
785
|
+
_info('callinfo_unknown_status', {
|
|
786
|
+
sessionId: this.sessionId,
|
|
787
|
+
status: parsedData.status || null,
|
|
788
|
+
event: parsedData.event || null
|
|
789
|
+
});
|
|
790
|
+
}
|
|
761
791
|
if (parsedData && parsedData.type === 'error') {
|
|
762
792
|
flushPendingBotMsgs('error');
|
|
793
|
+
_info('ws_error_msg', {
|
|
794
|
+
sessionId: this.sessionId,
|
|
795
|
+
message: parsedData.message || null,
|
|
796
|
+
code: parsedData.code || null
|
|
797
|
+
});
|
|
763
798
|
this.end = true;
|
|
764
799
|
reject(new Error(`Error: ${parsedData.message}`));
|
|
765
800
|
sendBotMsg(new Error(`Error: ${parsedData.message}`));
|