diff options
author | Andreas Eversberg <jolly@eversberg.eu> | 2016-11-13 06:04:54 +0100 |
---|---|---|
committer | Andreas Eversberg <jolly@eversberg.eu> | 2016-11-13 06:04:54 +0100 |
commit | 4dacec9cebb76437cef70e42aacffbfef9658fe5 (patch) | |
tree | d64b380be2739e29717de25819caeeaaf7204606 /src | |
parent | 52b1ac65f4b502178e6f4f9a8af8fd6ac0ee7ec8 (diff) |
A-Netz: Use Operator number 010 when calling from mobile station
Also use no caller ID (NULL). The call control code processes the
caller ID and dialed number correctly.
Diffstat (limited to 'src')
-rw-r--r-- | src/anetz/anetz.c | 2 | ||||
-rw-r--r-- | src/common/call.c | 15 |
2 files changed, 9 insertions, 8 deletions
diff --git a/src/anetz/anetz.c b/src/anetz/anetz.c index 6f04c63..aaa5286 100644 --- a/src/anetz/anetz.c +++ b/src/anetz/anetz.c @@ -274,7 +274,7 @@ void anetz_receive_tone(anetz_t *anetz, int tone) int rc; PDEBUG(DANETZ, DEBUG_INFO, "1750 Hz signal from mobile station is gone, setup call.\n"); - rc = call_in_setup(callref, "", "0"); + rc = call_in_setup(callref, NULL, "010"); if (rc < 0) { PDEBUG(DANETZ, DEBUG_NOTICE, "Call rejected (cause %d), sending release tone.\n", -rc); anetz_release(anetz); diff --git a/src/common/call.c b/src/common/call.c index 7817502..478cfd9 100644 --- a/src/common/call.c +++ b/src/common/call.c @@ -686,10 +686,9 @@ int call_in_setup(int callref, const char *callerid, const char *dialing) abort(); } - if (!strcmp(dialing, "0")) - dialing = "operator"; - - PDEBUG(DCALL, DEBUG_INFO, "Incoming call from '%s' to '%s'\n", callerid, dialing); + PDEBUG(DCALL, DEBUG_INFO, "Incoming call from '%s' to '%s'\n", callerid ? : "unknown", dialing); + if (!strcmp(dialing, "010")) + PDEBUG(DCALL, DEBUG_INFO, " -> Call to Operator '%s'\n", dialing); if (use_mncc_sock) { uint8_t buf[sizeof(struct gsm_mncc)]; @@ -700,8 +699,10 @@ int call_in_setup(int callref, const char *callerid, const char *dialing) mncc->msg_type = MNCC_SETUP_IND; mncc->callref = callref; mncc->fields |= MNCC_F_CALLING; - strncpy(mncc->calling.number, callerid, sizeof(mncc->calling.number) - 1); - mncc->calling.type = 4; /* caller ID is of type 'subscriber' */ + if (callerid) { + strncpy(mncc->calling.number, callerid, sizeof(mncc->calling.number) - 1); + mncc->calling.type = 4; /* caller ID is of type 'subscriber' */ + } // otherwise unknown and no number mncc->fields |= MNCC_F_CALLED; strncpy(mncc->called.number, dialing, sizeof(mncc->called.number) - 1); mncc->called.type = 0; /* dialing is of type 'unknown' */ @@ -732,7 +733,7 @@ int call_in_setup(int callref, const char *callerid, const char *dialing) } call.callref = callref; call_new_state(CALL_CONNECT); - if (callerid[0]) { + if (callerid) { strncpy(call.station_id, callerid, call.dial_digits); call.station_id[call.dial_digits] = '\0'; } |