unterwulf wrote
I have no such a modem, but I took a look at smsd behaviour during telnet negotiation using netcat as a telnet server and I see that smsd continuously sends telnet_login if there is no enough delay between login and password prompt.
So the session looks like:
smsd> AT
telnet> login:
smsd> <telnet_login>
telnet> Password:
smsd> <telnet_login>
telnet> anything else
smsd> <telnet_login>
Hi,
I've applied the full patch that you included below this, and I'm still getting this same behaviour (smsd is continually re-sending the username....)
See tcpdump output:
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 3:13, ack 4, win 12672, length 10
0x0000: 4500 0032 003d 0000 4006 f526 c0a8 020c E..2.=..@..&....
0x0010: c0a8 0206 0017 e9bd 453f 3215 014e 34f8 ........E?2..N4.
0x0020: 5018 3180 70a3 0000 7573 6572 6e61 6d65 P.1.p...username
0x0030: 3a20 :.
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 13, win 5840, length 0
0x0000: 4500 0028 89be 4000 4006 2baf c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34f8 453f 321f .........N4.E?2.
0x0020: 5010 16d0 7c28 0000 P...|(..
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [P.], seq 4:10, ack 13, win 5840, length 6
0x0000: 4500 002e 89bf 4000 4006 2ba8 c0a8 0206 E.....@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34f8 453f 321f .........N4.E?2.
0x0020: 5018 16d0 8583 0000 766f 6970 0d0a P.......voip..
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [.], ack 10, win 11088, length 0
0x0000: 4500 0028 003e 0000 4006 f52f c0a8 020c E..(.>..@../....
0x0010: c0a8 0206 0017 e9bd 453f 321f 014e 34fe ........E?2..N4.
0x0020: 5010 2b50 67a2 0000 0000 0000 0000 P.+Pg.........
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 13:14, ack 10, win 12672, length 1
0x0000: 4500 0029 003f 0000 4006 f52d c0a8 020c E..).?..@..-....
0x0010: c0a8 0206 0017 e9bd 453f 321f 014e 34fe ........E?2..N4.
0x0020: 5018 3180 eb68 0000 7600 0000 0000 P.1..h..v.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 14, win 5840, length 0
0x0000: 4500 0028 89c0 4000 4006 2bad c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3220 .........N4.E?2.
0x0020: 5010 16d0 7c21 0000 P...|!..
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 14:15, ack 10, win 12672, length 1
0x0000: 4500 0029 0040 0000 4006 f52c c0a8 020c E..).@..@..,....
0x0010: c0a8 0206 0017 e9bd 453f 3220 014e 34fe ........E?2..N4.
0x0020: 5018 3180 f267 0000 6f00 0000 0000 P.1..g..o.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 15, win 5840, length 0
0x0000: 4500 0028 89c1 4000 4006 2bac c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3221 .........N4.E?2!
0x0020: 5010 16d0 7c20 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 15:16, ack 10, win 12672, length 1
0x0000: 4500 0029 0041 0000 4006 f52b c0a8 020c E..).A..@..+....
0x0010: c0a8 0206 0017 e9bd 453f 3221 014e 34fe ........E?2!.N4.
0x0020: 5018 3180 f866 0000 6900 0000 0000 P.1..f..i.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 16, win 5840, length 0
0x0000: 4500 0028 89c2 4000 4006 2bab c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3222 .........N4.E?2"
0x0020: 5010 16d0 7c1f 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 16:17, ack 10, win 12672, length 1
0x0000: 4500 0029 0042 0000 4006 f52a c0a8 020c E..).B..@..*....
0x0010: c0a8 0206 0017 e9bd 453f 3222 014e 34fe ........E?2".N4.
0x0020: 5018 3180 f165 0000 7000 0000 0000 P.1..e..p.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 17, win 5840, length 0
0x0000: 4500 0028 89c3 4000 4006 2baa c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3223 .........N4.E?2#
0x0020: 5010 16d0 7c1e 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 17:19, ack 10, win 12672, length 2
0x0000: 4500 002a 0043 0000 4006 f528 c0a8 020c E..*.C..@..(....
0x0010: c0a8 0206 0017 e9bd 453f 3223 014e 34fe ........E?2#.N4.
0x0020: 5018 3180 545a 0000 0d0a 0000 0000 P.1.TZ........
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 19, win 5840, length 0
0x0000: 4500 0028 89c4 4000 4006 2ba9 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3225 .........N4.E?2%
0x0020: 5010 16d0 7c1c 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 19:29, ack 10, win 12672, length 10
0x0000: 4500 0032 0044 0000 4006 f51f c0a8 020c E..2.D..@.......
0x0010: c0a8 0206 0017 e9bd 453f 3225 014e 34fe ........E?2%.N4.
0x0020: 5018 3180 5991 0000 7061 7373 776f 7264 P.1.Y...password
0x0030: 3a20 :.
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 29, win 5840, length 0
0x0000: 4500 0028 89c5 4000 4006 2ba8 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 322f .........N4.E?2/
0x0020: 5010 16d0 7c12 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 29:30, ack 10, win 12672, length 1
0x0000: 4500 0029 0045 0000 4006 f527 c0a8 020c E..).E..@..'....
0x0010: c0a8 0206 0017 e9bd 453f 322f 014e 34fe ........E?2/.N4.
0x0020: 5018 3180 3759 0000 2a00 0000 0000 P.1.7Y..*.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 30, win 5840, length 0
0x0000: 4500 0028 89c6 4000 4006 2ba7 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3230 .........N4.E?20
0x0020: 5010 16d0 7c11 0000 P...|...
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [P.], seq 10:16, ack 30, win 5840, length 6
0x0000: 4500 002e 89c7 4000 4006 2ba0 c0a8 0206 E.....@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 34fe 453f 3230 .........N4.E?20
0x0020: 5018 16d0 8583 0000 766f 6970 0d0a P.......voip..
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [.], ack 16, win 11088, length 0
0x0000: 4500 0028 0046 0000 4006 f527 c0a8 020c E..(.F..@..'....
0x0010: c0a8 0206 0017 e9bd 453f 3230 014e 3504 ........E?20.N5.
0x0020: 5010 2b50 678b 0000 0000 0000 0000 P.+Pg.........
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 30:31, ack 16, win 12672, length 1
0x0000: 4500 0029 0047 0000 4006 f525 c0a8 020c E..).G..@..%....
0x0010: c0a8 0206 0017 e9bd 453f 3230 014e 3504 ........E?20.N5.
0x0020: 5018 3180 3752 0000 2a00 0000 0000 P.1.7R..*.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 31, win 5840, length 0
0x0000: 4500 0028 89c8 4000 4006 2ba5 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3231 .........N5.E?21
0x0020: 5010 16d0 7c0a 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 31:32, ack 16, win 12672, length 1
0x0000: 4500 0029 0048 0000 4006 f524 c0a8 020c E..).H..@..$....
0x0010: c0a8 0206 0017 e9bd 453f 3231 014e 3504 ........E?21.N5.
0x0020: 5018 3180 3751 0000 2a00 0000 0000 P.1.7Q..*.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 32, win 5840, length 0
0x0000: 4500 0028 89c9 4000 4006 2ba4 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3232 .........N5.E?22
0x0020: 5010 16d0 7c09 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 32:33, ack 16, win 12672, length 1
0x0000: 4500 0029 0049 0000 4006 f523 c0a8 020c E..).I..@..#....
0x0010: c0a8 0206 0017 e9bd 453f 3232 014e 3504 ........E?22.N5.
0x0020: 5018 3180 3750 0000 2a00 0000 0000 P.1.7P..*.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 33, win 5840, length 0
0x0000: 4500 0028 89ca 4000 4006 2ba3 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3233 .........N5.E?23
0x0020: 5010 16d0 7c08 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 33:34, ack 16, win 12672, length 1
0x0000: 4500 0029 004a 0000 4006 f522 c0a8 020c E..).J..@.."....
0x0010: c0a8 0206 0017 e9bd 453f 3233 014e 3504 ........E?23.N5.
0x0020: 5018 3180 374f 0000 2a00 0000 0000 P.1.7O..*.....
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 34, win 5840, length 0
0x0000: 4500 0028 89cb 4000 4006 2ba2 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3234 .........N5.E?24
0x0020: 5010 16d0 7c07 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 34:36, ack 16, win 12672, length 2
0x0000: 4500 002a 004b 0000 4006 f520 c0a8 020c E..*.K..@.......
0x0010: c0a8 0206 0017 e9bd 453f 3234 014e 3504 ........E?24.N5.
0x0020: 5018 3180 5443 0000 0d0a 0000 0000 P.1.TC........
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 36, win 5840, length 0
0x0000: 4500 0028 89cc 4000 4006 2ba1 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3236 .........N5.E?26
0x0020: 5010 16d0 7c05 0000 P...|...
IP 192.168.2.12.23 > 192.168.2.6.59837: Flags [P.], seq 36:65, ack 16, win 12672, length 29
0x0000: 4500 0045 004c 0000 4006 f504 c0a8 020c E..E.L..@.......
0x0010: c0a8 0206 0017 e9bd 453f 3236 014e 3504 ........E?26.N5.
0x0020: 5018 3180 379b 0000 6261 6420 7573 6572 P.1.7...bad.user
0x0030: 6e61 6d65 206f 7220 7061 7373 776f 7264 name.or.password
0x0040: 2121 210d 0a !!!..
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [.], ack 65, win 5840, length 0
0x0000: 4500 0028 89cd 4000 4006 2ba0 c0a8 0206 E..(..@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3253 .........N5.E?2S
0x0020: 5010 16d0 7be8 0000 P...{...
IP 192.168.2.6.59837 > 192.168.2.12.23: Flags [P.], seq 16:22, ack 65, win 5840, length 6
0x0000: 4500 002e 89ce 4000 4006 2b99 c0a8 0206 E.....@.@.+.....
0x0010: c0a8 020c e9bd 0017 014e 3504 453f 3253 .........N5.E?2S
0x0020: 5018 16d0 8583 0000 766f 6970 0d0a P.......voip..
I'm using a portech MV-370.
My config file has this:
[portechmv370]
device = @X.X.X.X:23
telnet_crlf = yes
telnet_login = voip
telnet_password = 1234
telnet_login_prompt = username:
telnet_password_prompt = password:
telnet_cmd_prompt = module1, module2, state1, state2, info.
telnet_cmd = module1
init = ATV1
The log file shows this:
2012-03-16 16:59:49,5, portechmv370: Modem handler 0 has started. PID: 20314. Will only send messages.
2012-03-16 16:59:49,6, portechmv370: Checking if modem is ready
2012-03-16 16:59:49,7, portechmv370: -> AT
2012-03-16 16:59:49,7, portechmv370: Command is sent, waiting for the answer
2012-03-16 16:59:59,7, portechmv370: put_command expected (OK)|(ERROR), timeout occurred. 1.
2012-03-16 16:59:59,7, portechmv370: <- username: voip password: ***** bad username or password!!! exit...
2012-03-16 16:59:59,7, portechmv370: -> .
2012-03-16 16:59:59,7, portechmv370: Command is sent, waiting for the answer
2012-03-16 17:00:04,7, portechmv370: put_command expected (OK)|(ERROR), timeout occurred. 2.
2012-03-16 17:00:04,7, portechmv370: <-
2012-03-16 17:00:05,7, portechmv370: -> AT
2012-03-16 17:00:05,7, portechmv370: Command is sent, waiting for the answer
Any assistance or hints that you can offer would be greatly appreciated.
Regards,
Adam