aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/anetz/anetz.c2
-rw-r--r--src/common/call.c15
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';
}