|
|
SMS Server Tools 3 Community |
Welcome, Guest. Please login or register. |
Sat Apr 20, 2024 13:27 |
This topic is locked
Page: 1
Author |
Post |
|
#1 Fri Feb 25, 2011 20:59, 160 months ago.
|
Member
Registered: Feb 2011
Location: Reykjavik, Iceland
|
Operating system name and version: Linux, Debian Squeeze Version of smsd: 3.1.14 Smsd installed from: sources Name and model of a modem / phone: Siemens Cinerion MC55i Interface: rs232 serial connection over a usb<->serial dongle
Hi... I apologize in advance if I am asking a question that has aldready had an answer. If so, my google-fu is not strong enough.
Is there a way to configure smstools3 (via Voicecall parameter) to time out, and hang up after X many seconds, regardless if someone answers or not?
The idea being: We are running monitoring system at work, Nagios. And we have people on call 24/7. There are certain events that we want to notify, not only with sms, but also with a phone call. And in order to reach as many people as we can in as short a span of time as possible, I have the idea of: send sms out, then phone the person in question - letting the phone ring for 10-15 seconds, hang up, and move to the next recipient. (For our settings, this would be sufficient.)
I have been playing a bit around with the Voicecall parameters, currently with: voicecall_cpas = yes voicecall_ignore_modem_response = yes voicecall_hangup_ath = yes
(using the defaults, with no explicit settings made no changes.)
The "spool-file" I created looks like: To: +XXXXXXXXX Voicecall: yes
TONE: TIME: 5 2 #
But no go. I haven't found out yet, how I can get my modem to hangup while dialing, after a timeout.
Am I missing something obvious?
Cheers, and thanks in advance.
|
|
#2 Fri Feb 25, 2011 22:03, 160 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
With default settings, TIME: n should hang up the call properly. However, if voicecall_cpas or voicecall_clcc is used, timeout is not handled in the current version. Right now I'm unable to check and test this issue, but will do it as soon as I can.
After changing any settings in smsd.conf, you surely have restarted the smsd, right?
|
|
#3 Fri Feb 25, 2011 22:11, 160 months ago.
|
Member
Registered: Feb 2011
Location: Reykjavik, Iceland
Topic owner
|
Yes, I run the smsd with the -t switch, and I press CTRL-C in between, so yes.
When I had no explicit settings for "voicecall*" (voicecall_cpas / voicecall_clcc), the timeout didn't work either.
I tried the following in minicom (when smsd was not running) ATDTxxxxxxxxxx;
and the phone rang. I then pressed <enter> and I got a hangup, in minicom. If this helps?
Thanks for a speedy answer for a smstool newbie :-)
Cheers, and thanks, -- EinarI
|
|
#4 Fri Feb 25, 2011 22:48, 160 months ago.
|
Member
Registered: Feb 2011
Location: Reykjavik, Iceland
Topic owner
|
Ok... I found out a solution. Not quite clear, and it seems I just missed trying that one.
I changed the "spoolfile" to have contents like:
To: +XXXXXXXX Voicecall: yes
TIME: 10
That is, I changed the content from: "TONE: TIME: 5 2 #" to simply: "TIME: 10" and that seems to have worked :-)
Thanks again :-)
-- EinarI
|
|
#5 Sat Feb 26, 2011 13:05, 160 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
You have increased the timeout, and with the new content smsd will play default tones, if a call is answered. The content "TONE: TIME: 10 2 #" should also work as expected. I think that you could re-run tests, with loglevel = 7, and very carefully check from the log what is happening. With default settings, 3.1.14 does the following: 2011-02-26 13:52:16,6, GSM1: I have to make a voice call to 35840XXXXXXX, with (2 times) DTMF # 2011-02-26 13:52:16,7, GSM1: -> ATD+35840XXXXXXX; 2011-02-26 13:52:16,7, GSM1: Command is sent 2011-02-26 13:52:16,7, GSM1: Waiting for 10 seconds 2011-02-26 13:52:26,6, GSM1: The result of a voice call was 2011-02-26 13:52:26,7, GSM1: -> ATH 2011-02-26 13:52:26,7, GSM1: Command is sent, waiting for the answer. (5) 2011-02-26 13:52:26,7, GSM1: <- OK 2011-02-26 13:52:26,6, GSM1: Moved file /var/spool/sms/checked/voicecall2 to /var/spool/sms/sent/voicecall2-TONE__TIME__10_2__ In this case the result is empty in the log, and "Result: OK" is written to the sent file. This will be changed in the next version, in this case the result will be "Timeout". Also the timeout will work with voicecall_cpas and voicecall_clcc too. If you want to apply the patch, here it is. Save the following as /tmp/patch, then cd smstools3/src and run patch < /tmp/patch. Then recompile and test... diff -Naur 3.1.14/src/smsd.c smstools3/src/smsd.c --- 3.1.14/src/smsd.c 2010-09-21 12:47:47.000000000 +0300 +++ smstools3/src/smsd.c 2011-02-26 14:37:35.000000000 +0200 @@ -4549,6 +4549,10 @@
wait_time = time(0);
+ // 3.1.15: + if (!wait_delay) + wait_delay = 150; + put_command(command, answer, sizeof(answer), 24, expect);
for (;;) @@ -4641,7 +4645,9 @@ } }
- if (time(0) > wait_time + 150) + // 3.1.15: + //if (time(0) > wait_time + 150) + if (time(0) > wait_time + wait_delay) { strcpy(voicecall_result, "Timeout"); writelogfile(LOG_INFO, 0, "The result of a voice call was %s", voicecall_result); @@ -4702,6 +4708,11 @@ t_sleep(1); } while (time(0) < wait_time +wait_delay); + + // 3.1.15: + if (!(*answer)) + strcpy(answer, "Timeout"); + change_crlf(cut_emptylines(cutspaces(strcpy(voicecall_result, answer))), ' '); // 3.1.7: writelogfile(LOG_INFO, 0, "The result of a voice call was %s", voicecall_result); 'diff' Syntax Highlight powered by GeSHi
|
|
#6 Wed Mar 16, 2011 18:05, 159 months ago.
|
Administrator
Registered: May 2009
Location: Jyväskylä, Finland
|
Is this issue still active?
|
|
#7 Wed Mar 16, 2011 20:46, 159 months ago.
|
Member
Registered: Feb 2011
Location: Reykjavik, Iceland
Topic owner
|
Hi, and sorry for a late reply.
No, this issue has been resolved successfully :-)
What was confusing me was the docs... when I read them, they seemed to imply that the use of the 'voicecall' parameter should have a body like:
TONE: TIME: 15 2
Where in fact, it was sufficient for me to use:
TIME: 20
to get my results.
But, I'm a happy camper now, and next step for me is to write a bit around the event handler, and work a bit with the statistics provided :-)
So, I'm a happy camper, and thank you very much for your assistance in this matter. And thanks for following through as well.
Cheers, -- EinarI
|
This topic is locked
Page: 1
Time in this board is UTC.
|
|
|
|
|
|
|