Skip to content

Commit 4fef477

Browse files
author
Ian
committed
working to add failure to send notifications to message component / alerting the alert factory of messages being unable to send from sms.callpipe
1 parent 2e18ec1 commit 4fef477

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

frontend/components/Alerts/AlertFactory.vue

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,11 @@ export default {
4141
emitter.on('template-save-failed', (payload)=>{
4242
this.AddAlert(payload);
4343
})
44+
emitter.on('message-failed', (payload:AlertData)=>{
45+
console.log("message failed to send make an alert about it");
46+
this.AddAlert(payload);
47+
48+
})
4449
},
4550
methods: {
4651
AddAlert(arg:AlertData){

frontend/lib/SIP.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,15 @@ function RunSIPConnection(username: string, password: string, server: string, ow
283283
const luaSkipResponse = await luaSkip(message);
284284
//console.log(`[SIP.outbound-message] Response ${response}`);
285285
console.log(`[luaSkip] Response ${luaSkipResponse}`);
286-
286+
console.log(luaSkipResponse.status);
287+
message.status = luaSkipResponse.status;
288+
message.statusText = luaSkipResponse.statusText;
289+
if(message.status == 200){
290+
emitter.emit('message-failed', message);
291+
}
292+
else{
293+
emitter.emit('message-sent', message);
294+
}
287295
//add message to state
288296
if(message.cpim && message.cpim.headers['Group-UUID']){
289297
const cpimThreadID = calculateCPIMThreadID(message.cpim, message.direction, message.to, message.from);

0 commit comments

Comments
 (0)