Sometimes you can have multiple registrations for the same extension across multiple SIP profiles. This adds the functionality to fire an event for each unique SIP profile. I also added a check to see if we have already send an event for a profile since you don't want multiple events fired one SIP profile.
This is a dialplan approach to fix the feature key sync loop/race with yealink phones. This aproach may also need to be extended to the Call Forward dialplans as well. It limits the number of simultaneous calls for a particular user to change their DND/Forwarding status to a single call at a time. This prevents the infinite loops that the yealinks can get into if the user presses the DND button too quickly with feature key sync enabled.
I am also reverting the lua fix because it was not reliable and can still easily allow the loop to occur.
Transcriptions using Google were broken after last commit.
transcribe_alternate_language was not defined anywhere it Google would return 400 error.
Added variable to fix the issue
This renames `get_profile` to `get_profiles` which either returns nil for no profiles or a array of unique profiles.
Then each function that used to take the single sip_profile was updated to take this array and send events to each profile the user is part of.
The follow me update code in do_not_disturb.lua was being executed even when the follow me uuid didn't exist. Let me know if this is the wrong approach to fix this in lua, I'm not particularly well versed in this but this seemed to have fixed it in my testing.
I have some concerns about this section of code in general though, it seems that enabling server side DND will turn off follow me, but then turning off DND won't return follow me to its original state. Is this the intended behavior? and if so we might need to make a workaround.
Zero should not be wrapped in double quotes as it's causing an SQL error.
PGRES_FATAL_ERROR
2021-03-11 10:30:47.738673 [ERR] switch_pgsql.c:680 Error executing query:
ERROR: invalid input syntax for type numeric: "'0'"
LINE 1: ...p/c8505148-1b02-4f6f-9157-b5cf64ebcc4d.tif','','','''0''',''...
^
Track whether or not a message was actually left in the voicemail box. Previously we only knew that voicemail answered, now we know whether the caller left a message.
Callers who didn't leave a message now show up in the "Cancelled" call filter in xml_cdr.php
Bonus: Fixed a bug with the originating_leg_uuid that was breaking extension summary from a previous commit and some other minor bugs/typos.
We found that callers were not hearing the tone_stream if they pressed "#" to bypass the voicemail greeting. Inserting a very brief silence_stream seems to fix the issue.