This add a script to use either the user hook or the default one.
Sometime we checked the user hook or a default code. We move this
default code in a defaut hook.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
If a menu already is open while receiving a call, the dedicated menu
could not open itself. It prevent completly the user to pickup the call.
We add a notification to open this menu manually.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
There was a hole in the event logging where we start a call that the
contact hang up. As we dont have an event for outgoing call,
modemmonitor think this is a missed call.
Adding a dedicated event file help modemmonitor to know what happen.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This make cached event to pilles up and prevent some incoming call
events to works correctly.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
* The sxmo_modemmonitor.sh will now run a new sxmo_modemcall.sh
dedicated menu to Pickup, Hangup or Mute the call. It will not write
notifications anymore.
* We now can mute the ring with the new pickup menu. With the default
hook, this will stop the ringtone like the missed_call would do.
* The sxmo_modemcall.sh now use a new sxmo_proximitylock.sh which
will lock the screen when putting the phone in front of the ear. This
script should be smart enough to work smoothly with a crust context.
To achieve this, the proximity_lock will only disable the initial
lock (the one who want to go back in crust after some seconds) if the
phone moved a little bit and is not in your pocket. So forgetting the
phone in a table or not earing the ring in your bag will not empty the
battery. You'll find the phone in crust with notifications.
* The sxmo_modemcall.sh do not monitor finished calls anymore. We leave
it with hangup or being killed by sxmo_modemmonitor.sh. This simplify
the call script and prevent double deleting mmcli calls. I had to use
pids and wait commands to fix and issue and make the script killeable
by the monitor.
Plus, only the monitor will now delete calls. The call script should be
precise on what happen using cached files.
* Discarded and hanged up calls are two different behavior with
different script (by default use the same linked ones)
* Fixed a bug where sometime ringing was started twice. I think this is
cause by the new checkforincomingcalls in the connected state change. We
now use a file to test if the call already has been managed.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Sometime, the modem will give 0611924312 as incoming text or
call number instead of +33611924312 (example in france).
This cause two issues cause of format missmatch:
* Notifications sometime come from "Unknown" when we actually know
the contact
* Text/Dial menu entries are duplicated with "Unknown" persons
We try here to fix boths issues with a simple idea. We will fallback
to a default prefix when it is missing (on phone like numbers,
composed of 10 numbers).
This prefix is an environment variable that cause 0 impact if missing.
* sxmo_contacts.sh will fix the recent numbers prefixes with the default
* sxmo_modemmonitor.sh will also fix the prefix with the default one
This should solve missmatch issues as both will use country code format
I only recommend to always store contacts in the prefixed format in the
contacts.tsv file.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
If modemmonitor crash for some reason, status bar is not updated. The
reason is that statusbar check if modemmonitor is running, which it is
when trying to shutdown itself.
We change the way modemmonitor is detected using a single modem state
file. If the file is not present, then the monitor is considered not
running.
This single file permit to add more state in the future, without adding
any more files.
We also add a sleep 1, look like it is required to have instand status
bar update.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
* Draft files are assigned to each number:
Stored here ".local/share/modem/+33666666666/draft.txt"
We automatically edit this single file, making crash or unexpected
edition issue to leave intact saved draft.
* Simplification of some logics
Having a known draft file instead of using a TEXT var simplify lots
of things
* EDITOR is not run in a subshell
Some editors as kakoune got issues with that. Futhermore, it will be
usefull for some other development as making all menu ssh mode
compatible
* Remove modem check
As we now got draft, why do we care if modem is up or down ?
* Display the contact name instead of it number in the conversation
Or use "Unknown Number (+337798676)"
* Unify display message notif adding possibilities to bypass the
main menu
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This reverts commit 3bb3fb6094.
We cannot use this special less argument as it is not busybox less
compatible.
I add busybox aliases to not reproduce the error in the future.
Signed-off-by: Stacy Harper <contact@stacyharper.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
This code uses fewer programs and the code now matches the code for
getting phone number of incoming text.
Signed-off-by: Anjandev Momi <anjan@momi.ca>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Use dbus to monitor for missed calls. Missed calls used to work but had a
regression due to the work to make text/calls used dbus. This adds the proper
dbus hook for missed calls as well and also changes the incoming call
notification to allow for multiple incoming calls (theoretically).
Tested for a single caller and transitioning the pickup notification
into a missed call notification and all is working good.
Breaking change. Make sure you send an email to the mailing list
telling users to move their
$XDG_CONFIG_HOME/{modem,notifications} files/folders to
$XDG_DATA_HOME
Signed-off-by: Anjandev Momi <anjan@momi.ca>
The hook must be run asynchronously. This allow ringtones to be played
using mpv by exemple.
Signed-off-by: Reed Wade <reedwade@misterbanal.net>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
We quote the sms path on notificationwrite to prevent buggy commands.
mn: This patch fixes texts from numbers like "CREDIT AGRICOLE"
Signed-off-by: Reed Wade <reedwade@misterbanal.net>
Signed-off-by: Anjandev Momi <anjan@momi.ca>
Instead of looping over mmcli commands to check for incoming
calls and texts every 3s, use dbus-monitor to tell us when
something is coming in. This should save some battery life
as well as reduce the delay in new call/msg notification.
I was running on the latest released scripts, so have not
strictly tested this with git master. Note that I dropped
the call to checkmissedcalls. Perhaps we should still run
that at firststart?
Signed-off-by: Serge Hallyn <serge@hallyn.com>
Signed-off-by: Maarten van Gompel <proycon@anaproy.nl>
Ensure contacts from modem and contacts lists are all fully qualified phone numbers (starting with + and carrying a country prefix). This effectively filters out older/incompatible entries.
Picking up call can be done from both dunst notification & notifications menu;
so for more consistency / less bugs the Pickup menu entry has been removed.
Summary of changes:
1. Always use the sxmo_notificationwrite.sh script to write notifications
rather then sometimes using echo to the DIR
2. Reorder args for notiffile spec to be action as 1st line, watchfile 2nd, and
rest as msg; this way msg can be multiple lines without propogating bugs
3. Write calls as a standard notification via sxmo_notificationwrite.sh
4. Use datestamps from notification files instead of filename, this way (3)
works without extra logic
5. Various style fixes