Commit Graph

14 Commits

Author SHA1 Message Date
Guido Günther
6f44a7c7fd emergency-call-types: Add emergency numbers from service provider db
This scales better than using a built in array.

Closes: https://gitlab.gnome.org/GNOME/calls/-/issues/714
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
8de3c90b66 emergency-call-types: Use lower case country codes
The provider info db has it that way.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
5d751f3143 emergency-calls-manager: Init emergency type database
We so far did this on first access. Let's rather do it explicitly
so we notice problems early on startup.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
f95370eddc emergency-call-types: Make data structures public
This allows us to use them in tests

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
b5e944193e emergency-call-types: Make emergency data hash table dynamic
So far we referenced all compiled in data but we want to add
entries from the provider info database soon so use allocated
memories for all entries.

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
ee198d2073 emergency-call-types: Make hash table static
This is only meant to be used from this compilation unit

Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
52555030fb emergency-call-types: Use strv builder
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Guido Günther
3e7f5e77ab emergency-call-types: Fix copyright year and holder
The files were created 2022, the header stating 2021 is a copy and paste
error. Fix a typo while at that.

Gbp-Dch: Ignore
Signed-off-by: Guido Günther <agx@sigxcpu.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/790>
2025-10-16 13:45:49 +00:00
Boris Shtrasman
b640733424 emergency-call-types: add Israeli emergency numbers
Signed-off-by: Boris Shtrasman <41102-borissh@users.noreply.gitlab.gnome.org>
Part-of: <https://gitlab.gnome.org/GNOME/calls/-/merge_requests/785>
2025-07-19 00:43:55 +03:00
Daniel Rusek
58d2474f28 emergency-call-types: Add Czech Republic 2024-02-28 09:11:45 +00:00
Guido Günther
3a467d85ad emergency-call-types: Add EU countries
They all support 112.
2024-02-10 17:10:14 +01:00
Guido Günther
4951cf5b3b emergency-call-types: Use hash for flag lookups too 2024-02-10 17:09:45 +01:00
Guido Günther
aaefc0443a emergency-call-types: Allow to lookup emergency numbers by country code
We build a hash as cache to speed up lookups. As this is a one time
thing we just do it once and don't bother to free it up.

We currently assume that all numbers can be used for the location based
lookups. Should that change we want to add a flag indicating that.
2024-02-10 17:09:37 +01:00
Guido Günther
b087bea16b Resolve emergency number types
We add a small hardcoded table for now. Future versions
will improve this to parse this out of ASOPs eccdata.

If we can't determine the type of a number we add it verbatim.
2023-04-06 16:37:59 +00:00