Skip to content

Commit

Permalink
option to replace leading + in received caller id
Browse files Browse the repository at this point in the history
  • Loading branch information
olivluca committed Mar 29, 2020
1 parent 560669f commit e72926b
Show file tree
Hide file tree
Showing 10 changed files with 73 additions and 9 deletions.
2 changes: 1 addition & 1 deletion luci-app-svd/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=luci-app-svd
PKG_VERSION:=1.9
PKG_VERSION:=1.10
PKG_RELEASE:=1

PKG_BUILD_DIR := $(BUILD_DIR)/$(PKG_NAME)
Expand Down
4 changes: 4 additions & 0 deletions luci-app-svd/files/luasrc/model/cbi/svd/main.lua
Original file line number Diff line number Diff line change
Expand Up @@ -84,4 +84,8 @@ busy_tone=s:option(Value,"busy_tone",translate("Custom busy tone"), translate("D
busy_tone.optional=true
busy_tone.rmempty=true

cid_intnl_prefix=s:option(Value,"cid_intnl_prefix",translate("International prefix for caller id"), translate("Replace leading + in received caller id with this prefix"))
cid_intnl_prefix=true
cid_intnl_prefix=true

return m
11 changes: 10 additions & 1 deletion luci-app-svd/files/po/ca/svd.po
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,8 @@ msgstr "Definició d'un to d'ocupat personalitzat en format asterisk,"

#: luasrc/model/cbi/svd/main.lua:75
msgid "Definition of a custom dial tone in asterisk format,"
msgstr "Definició d'un to d'invitació a marcar personalitzat en format asterisk,"
msgstr ""
"Definició d'un to d'invitació a marcar personalitzat en format asterisk,"

#: luasrc/model/cbi/svd/main.lua:79
msgid "Definition of a custom ring tone in asterisk format,"
Expand Down Expand Up @@ -220,6 +221,10 @@ msgstr ""
"funcioni, aquí és pot especificar la direcció de la interfície de xarxa a "
"usar."

#: luasrc/model/cbi/svd/main.lua:87
msgid "International prefix for caller id"
msgstr "Prefix internacional per a l'identificador de trucada"

#: luasrc/view/svd_status.htm:81
msgid "Last message"
msgstr "Darrer missatge"
Expand Down Expand Up @@ -322,6 +327,10 @@ msgstr "Registrador"
msgid "Remove prefix"
msgstr "Elimina prefixe"

#: luasrc/model/cbi/svd/main.lua:87
msgid "Replace leading + in received caller id with this prefix"
msgstr "Reemplaça el + a l'identificador de trucada rebut amb aquest prefix"

#: luasrc/model/cbi/svd/dialplan.lua:19
msgid "Replace with"
msgstr "Substitueix amb"
Expand Down
13 changes: 11 additions & 2 deletions luci-app-svd/files/po/es/svd.po
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
msgid ""
msgstr ""
"Project-Id-Version: \n"
"PO-Revision-Date: 2020-03-25 17:30+0100\n"
"PO-Revision-Date: 2020-03-29 15:00+0200\n"
"Last-Translator: Luca Olivetti <[email protected]>\n"
"Language-Team: Spanish <>\n"
"Language: es\n"
Expand Down Expand Up @@ -106,7 +106,8 @@ msgstr "Dec db (por defecto 0)"

#: luasrc/model/cbi/svd/main.lua:83
msgid "Definition of a custom busy tone in asterisk format,"
msgstr "Definición de un todo de linea ocupada personalizado en formato asterisk,"
msgstr ""
"Definición de un todo de linea ocupada personalizado en formato asterisk,"

#: luasrc/model/cbi/svd/main.lua:75
msgid "Definition of a custom dial tone in asterisk format,"
Expand Down Expand Up @@ -218,6 +219,10 @@ msgstr ""
"En caso de tener más de una interfaz de red y la detección automática no "
"funcione, aquí se puede especificar la dirección ip de la interfaz a usar."

#: luasrc/model/cbi/svd/main.lua:87
msgid "International prefix for caller id"
msgstr "Prefijo internacional para el identificador de llamada"

#: luasrc/view/svd_status.htm:81
msgid "Last message"
msgstr "Ultimo mensaje"
Expand Down Expand Up @@ -322,6 +327,10 @@ msgstr "Registrador"
msgid "Remove prefix"
msgstr "Quitar prefijo"

#: luasrc/model/cbi/svd/main.lua:87
msgid "Replace leading + in received caller id with this prefix"
msgstr "Remplaza el + en el identificador de llamada recibido con este prefijo"

#: luasrc/model/cbi/svd/dialplan.lua:19
msgid "Replace with"
msgstr "Remplazar con"
Expand Down
17 changes: 14 additions & 3 deletions luci-app-svd/files/po/it/svd.po
Original file line number Diff line number Diff line change
Expand Up @@ -105,15 +105,18 @@ msgstr "Dec db (per difetto 0)"

#: luasrc/model/cbi/svd/main.lua:83
msgid "Definition of a custom busy tone in asterisk format,"
msgstr "Definizione di un segnale di occupato personalizzato in formato asterisk,"
msgstr ""
"Definizione di un segnale di occupato personalizzato in formato asterisk,"

#: luasrc/model/cbi/svd/main.lua:75
msgid "Definition of a custom dial tone in asterisk format,"
msgstr "Definizione di un segnale di libero personalizzato in formato asterisk,"
msgstr ""
"Definizione di un segnale di libero personalizzato in formato asterisk,"

#: luasrc/model/cbi/svd/main.lua:79
msgid "Definition of a custom ring tone in asterisk format,"
msgstr "Definizione di un segnale di chiamando personalizzato in formato asterisk,"
msgstr ""
"Definizione di un segnale di chiamando personalizzato in formato asterisk,"

#: luasrc/controller/svd/svd.lua:13 luasrc/model/cbi/svd/dialplan.lua:4
msgid "Dialplan"
Expand Down Expand Up @@ -219,6 +222,10 @@ msgstr ""
"funzionasse, qui si può specificare l'indirizzo dell'interfaccia che si "
"vuole usare."

#: luasrc/model/cbi/svd/main.lua:87
msgid "International prefix for caller id"
msgstr "Prefisso internazionale per l'identificatore di chiamata"

#: luasrc/view/svd_status.htm:81
msgid "Last message"
msgstr "Ultimo messaggio"
Expand Down Expand Up @@ -322,6 +329,10 @@ msgstr "Registratore"
msgid "Remove prefix"
msgstr "Eliminare prefisso"

#: luasrc/model/cbi/svd/main.lua:87
msgid "Replace leading + in received caller id with this prefix"
msgstr "Sostituisce il + nell'identificatore di chiamata ricevuto con questo prefisso"

#: luasrc/model/cbi/svd/dialplan.lua:19
msgid "Replace with"
msgstr "Sostituire con"
Expand Down
8 changes: 8 additions & 0 deletions luci-app-svd/files/po/templates/svd.pot
Original file line number Diff line number Diff line change
Expand Up @@ -199,6 +199,10 @@ msgid ""
"be used."
msgstr ""

#: luasrc/model/cbi/svd/main.lua:87
msgid "International prefix for caller id"
msgstr ""

#: luasrc/view/svd_status.htm:81
msgid "Last message"
msgstr ""
Expand Down Expand Up @@ -297,6 +301,10 @@ msgstr ""
msgid "Remove prefix"
msgstr ""

#: luasrc/model/cbi/svd/main.lua:87
msgid "Replace leading + in received caller id with this prefix"
msgstr ""

#: luasrc/model/cbi/svd/dialplan.lua:19
msgid "Replace with"
msgstr ""
Expand Down
4 changes: 2 additions & 2 deletions svd/Makefile
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
include $(TOPDIR)/rules.mk

PKG_NAME:=svd
PKG_VERSION:=1.9
PKG_RELEASE:=2
PKG_VERSION:=1.10
PKG_RELEASE:=1
PKG_BUILD_DEPENDS:=libab

PKG_FIXUP:=libtool
Expand Down
14 changes: 14 additions & 0 deletions svd/svd/src/svd_cfg.c
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,7 @@ struct uci_main {
char *dial_tone;
char *ring_tone;
char *busy_tone;
char *cid_intnl_prefix;
};

static int
Expand Down Expand Up @@ -193,6 +194,8 @@ main_add(struct uci_map *map, void *section)
g_conf.ring_tone = strdup(a->ring_tone);
if (a->busy_tone)
g_conf.busy_tone = strdup(a->busy_tone);
if (a->cid_intnl_prefix)
g_conf.cid_intnl_prefix = strdup(a->cid_intnl_prefix);
return 0;
}

Expand Down Expand Up @@ -238,6 +241,10 @@ static struct uci_optmap main_uci_map[] =
UCIMAP_OPTION(struct uci_main, busy_tone),
.type = UCIMAP_STRING,
.name = "busy_tone",
},{
UCIMAP_OPTION(struct uci_main, cid_intnl_prefix),
.type = UCIMAP_STRING,
.name = "cid_intnl_prefix",
},
};

Expand Down Expand Up @@ -1183,6 +1190,13 @@ conf_show( void )
SU_DEBUG_3(("] : "));
}

SU_DEBUG_3(("cid_intnl_prefix["));
if( g_conf.cid_intnl_prefix ){
SU_DEBUG_3(("%s] : ", g_conf.cid_intnl_prefix));
} else {
SU_DEBUG_3(("] : "));
}

SU_DEBUG_3((" led[%s] : ", g_conf.voip_led));
SU_DEBUG_3(("ports[%d:%d]\n",
g_conf.rtp_port_first,
Expand Down
1 change: 1 addition & 0 deletions svd/svd/src/svd_cfg.h
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,7 @@ struct svd_conf_s {/*{{{*/
char * dial_tone; /* Custom dial tone (asterisk style string). */
char * ring_tone; /* Custom ringing tone (asterisk style string). */
char * busy_tone; /* Custom busy tone (asterisk style string). */
char * cid_intnl_prefix; /* Replace + with this string in caller id */
} g_conf;/*}}}*/

/** @} */
Expand Down
8 changes: 8 additions & 0 deletions svd/svd/src/svd_ua.c
Original file line number Diff line number Diff line change
Expand Up @@ -743,6 +743,14 @@ DFS
free(cid);
cid = strdup("0");
}
if (cid && cid[0]=='+' && g_conf.cid_intnl_prefix) {
int prefixlen = strlen(g_conf.cid_intnl_prefix);
char * ccid = (char *) malloc(strlen(cid)+prefixlen); //no need to add one for the termination since we're removin the +
strcpy(ccid,g_conf.cid_intnl_prefix);
strcpy(ccid+prefixlen, cid+1);
free(cid);
cid=ccid;
}
SU_DEBUG_0(("INCOMING CALL TO %s, caller id %s, caller name %s\n", contact, cid, cname2));

if (!sip_account) {
Expand Down

0 comments on commit e72926b

Please sign in to comment.