summaryrefslogtreecommitdiffstats
path: root/src/ivcall.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/ivcall.c')
-rw-r--r--src/ivcall.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/src/ivcall.c b/src/ivcall.c
index 5aca741..28cf890 100644
--- a/src/ivcall.c
+++ b/src/ivcall.c
@@ -391,10 +391,18 @@ int go(void) {
goto fail;
}
- snprintf(buf, sizeof(buf), "AT&L%s\n", source_msn);
- if (tty_command(fd, buf, "OK\r\n", COMMAND_TIMEOUT) < 0) {
- fprintf(stderr, "Initialisation failure.\n");
- goto fail;
+ if (answer) {
+ snprintf(buf, sizeof(buf), "AT&L%s\n", source_msn);
+ if (tty_command(fd, buf, "OK\r\n", COMMAND_TIMEOUT) < 0) {
+ fprintf(stderr, "Initialisation failure.\n");
+ goto fail;
+ }
+ } else {
+ snprintf(buf, sizeof(buf), "AT&E%s\n", source_msn);
+ if (tty_command(fd, buf, "OK\r\n", COMMAND_TIMEOUT) < 0) {
+ fprintf(stderr, "Initialisation failure.\n");
+ goto fail;
+ }
}
if (answer)