Currently there is no configuration setting for skipping mode selection. You need to modify sources for it.
Here is the patch:
diff -Naur 3.1.14/src/modeminit.c smstools3/src/modeminit.c
--- 3.1.14/src/modeminit.c 2010-09-20 12:31:43.000000000 +0300
+++ smstools3/src/modeminit.c 2011-02-28 12:27:03.000000000 +0200
@@ -1506,26 +1506,29 @@
}
// -----------------------------------------------------------------------------------------------
- writelogfile(LOG_INFO, 0, "Selecting PDU mode");
- strcpy(command,"AT+CMGF=0\r");
- retries=0;
- do
+ if (DEVICE.select_pdu_mode) // 3.1.15.
{
- retries++;
- put_command(command, answer, sizeof(answer), 1, EXPECT_OK_ERROR);
- if (strstr(answer, "ERROR"))
- if (retries < 2)
- if (t_sleep(errorsleeptime))
- return 7;
- }
- while (retries < 2 && !strstr(answer,"OK"));
- if (strstr(answer,"ERROR"))
- {
- // 3.1: more detailed error message:
- p = get_gsm_error(answer);
- writelogfile0(LOG_ERR, 1, tb_sprintf("Error: Modem did not accept mode selection%s%s", (*p)? ", " : "", p));
- alarm_handler0(LOG_ERR, tb);
- return 5;
+ writelogfile(LOG_INFO, 0, "Selecting PDU mode");
+ strcpy(command,"AT+CMGF=0\r");
+ retries=0;
+ do
+ {
+ retries++;
+ put_command(command, answer, sizeof(answer), 1, EXPECT_OK_ERROR);
+ if (strstr(answer, "ERROR"))
+ if (retries < 2)
+ if (t_sleep(errorsleeptime))
+ return 7;
+ }
+ while (retries < 2 && !strstr(answer,"OK"));
+ if (strstr(answer,"ERROR"))
+ {
+ // 3.1: more detailed error message:
+ p = get_gsm_error(answer);
+ writelogfile0(LOG_ERR, 1, tb_sprintf("Error: Modem did not accept mode selection%s%s", (*p)? ", " : "", p));
+ alarm_handler0(LOG_ERR, tb);
+ return 5;
+ }
}
// -----------------------------------------------------------------------------------------------
diff -Naur 3.1.14/src/smsd_cfg.c smstools3/src/smsd_cfg.c
--- 3.1.14/src/smsd_cfg.c 2010-09-21 12:15:07.000000000 +0300
+++ smstools3/src/smsd_cfg.c 2011-02-28 12:26:19.000000000 +0200
@@ -344,6 +344,7 @@
devices[i].verify_pdu = 0;
devices[i].loglevel_lac_ci = 6;
devices[i].log_not_registered_after = 0;
+ devices[i].select_pdu_mode = 1;
}
startup_err_str = NULL;
startup_err_count = 0;
@@ -1680,6 +1681,12 @@
if (strcasecmp(name,"log_not_registered_after")==0)
NEWDEVICE.log_not_registered_after=atoi(ask_value(NEWDEVICE.name, name, value));
else
+ if (strcasecmp(name,"select_pdu_mode")==0)
+ {
+ if ((NEWDEVICE.select_pdu_mode = yesno_check(ask_value(NEWDEVICE.name, name, value))) == -1)
+ startuperror(yesno_error, name, value);
+ }
+ else
startuperror("Unknown setting for modem %s: %s\n", NEWDEVICE.name, name);
}
}
diff -Naur 3.1.14/src/smsd_cfg.h smstools3/src/smsd_cfg.h
--- 3.1.14/src/smsd_cfg.h 2010-09-20 14:11:26.000000000 +0300
+++ smstools3/src/smsd_cfg.h 2011-02-28 12:25:26.000000000 +0200
@@ -230,6 +230,7 @@
int verify_pdu; // 3.1.14.
int loglevel_lac_ci; // 3.1.14.
int log_not_registered_after; // 3.1.14.
+ int select_pdu_mode; // 3.1.15.
} _device;
// NOTE for regular run intervals: effective value is at least delaytime.
'diff' Syntax Highlight powered by GeSHi Save the patch as
/tmp/patch. Then
cd smstools3/src and run
patch < /tmp/patch. Recompile with
make, and replace executable:
cp -p smsd.exe $(which smsd.exe). In
/etc/smsd.conf, add a new setting for modem:
select_pdu_mode = no, and restart smsd.