aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith <keith@rhizomatica.org>2019-01-28 12:16:24 +0100
committerHarald Welte <laforge@gnumonks.org>2019-02-14 22:51:58 +0100
commitdb2336a9f5f0104ca0403be4a15b38415bb95e4e (patch)
tree5445a490874c6ba8c5d9b5c9c020b3a352723282
parent336add4990191011ec6b8f621593e24b2ad5e324 (diff)
Support International Caller ID
When the SIP call source contains + as first character, set the TON to International so that the MS displays caller ID correctly Change-Id: Idcfa31aff90e04dd0aa3583957f288889b1bbefe
-rw-r--r--src/mncc.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/mncc.c b/src/mncc.c
index ea6a9fc..5d220ba 100644
--- a/src/mncc.c
+++ b/src/mncc.c
@@ -775,8 +775,14 @@ int mncc_create_remote_leg(struct mncc_connection *conn, struct call *call)
mncc.fields |= MNCC_F_CALLING;
mncc.calling.plan = GSM48_NPI_ISDN_E164;
- mncc.calling.type = GSM48_TON_UNKNOWN;
- osmo_strlcpy(mncc.calling.number, call->source, sizeof(mncc.calling.number));
+
+ if (call->source && call->source[0] == '+') {
+ mncc.calling.type = GSM48_TON_INTERNATIONAL;
+ OSMO_STRLCPY_ARRAY(mncc.calling.number, call->source + 1);
+ } else {
+ mncc.calling.type = GSM48_TON_UNKNOWN;
+ OSMO_STRLCPY_ARRAY(mncc.calling.number, call->source);
+ }
if (conn->app->use_imsi_as_id) {
snprintf(mncc.imsi, 15, "%s", call->dest);