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
This commit is contained in:
Keith Whyte 2019-01-28 12:16:24 +01:00 committed by Harald Welte
parent 336add4990
commit db2336a9f5
1 changed files with 8 additions and 2 deletions

View File

@ -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;
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(mncc.calling.number, call->source, sizeof(mncc.calling.number));
OSMO_STRLCPY_ARRAY(mncc.calling.number, call->source);
}
if (conn->app->use_imsi_as_id) {
snprintf(mncc.imsi, 15, "%s", call->dest);