Diffstat (limited to 'noncore/apps/opie-console/dialer.cpp') (more/less context) (show whitespace changes)
-rw-r--r-- | noncore/apps/opie-console/dialer.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/noncore/apps/opie-console/dialer.cpp b/noncore/apps/opie-console/dialer.cpp index 90e2b6c..89a0e8d 100644 --- a/noncore/apps/opie-console/dialer.cpp +++ b/noncore/apps/opie-console/dialer.cpp | |||
@@ -104,73 +104,74 @@ void Dialer::dial(const QString& number) | |||
104 | { | 104 | { |
105 | trydial(number); | 105 | trydial(number); |
106 | } | 106 | } |
107 | else break; | 107 | else break; |
108 | } | 108 | } |
109 | 109 | ||
110 | if(usercancel) | 110 | if(usercancel) |
111 | { | 111 | { |
112 | reject(); | 112 | reject(); |
113 | } | 113 | } |
114 | } | 114 | } |
115 | 115 | ||
116 | void Dialer::trydial(const QString& number) | 116 | void Dialer::trydial(const QString& number) |
117 | { | 117 | { |
118 | if(state != state_cancel) | 118 | if(state != state_cancel) |
119 | { | 119 | { |
120 | switchState(state_preinit); | 120 | switchState(state_preinit); |
121 | // ... | 121 | // ... |
122 | QString response = receive(); | 122 | QString response = receive(); |
123 | } | 123 | } |
124 | 124 | ||
125 | if(state != state_cancel) | 125 | if(state != state_cancel) |
126 | { | 126 | { |
127 | switchState(state_init); | 127 | switchState(state_init); |
128 | send("ATZ"); | 128 | //send("ATZ"); |
129 | send(m_profile.readEntry("InitString")); | ||
129 | QString response2 = receive(); | 130 | QString response2 = receive(); |
130 | } | 131 | } |
131 | 132 | ||
132 | if(state != state_cancel) | 133 | if(state != state_cancel) |
133 | { | 134 | { |
134 | switchState(state_options); | 135 | switchState(state_options); |
135 | 136 | ||
136 | send("ATM0L0"); | 137 | send("ATM0L0"); |
137 | QString response3 = receive(); | 138 | QString response3 = receive(); |
138 | } | 139 | } |
139 | 140 | ||
140 | if(state != state_cancel) | 141 | if(state != state_cancel) |
141 | { | 142 | { |
142 | switchState(state_dialtone); | 143 | switchState(state_dialtone); |
143 | 144 | ||
144 | send("ATX1"); | 145 | send("ATX1"); |
145 | QString response4 = receive(); | 146 | QString response4 = receive(); |
146 | } | 147 | } |
147 | 148 | ||
148 | if(state != state_cancel) | 149 | if(state != state_cancel) |
149 | { | 150 | { |
150 | switchState(state_dialing); | 151 | switchState(state_dialing); |
151 | 152 | ||
152 | send(QString("ATDT %1").arg(number)); | 153 | send(QString("%1 %2").arg(m_profile.readEntry("DialPrefix1")).arg(number)); |
153 | QString response5 = receive(); | 154 | QString response5 = receive(); |
154 | } | 155 | } |
155 | 156 | ||
156 | if(state != state_cancel) | 157 | if(state != state_cancel) |
157 | { | 158 | { |
158 | switchState(state_online); | 159 | switchState(state_online); |
159 | } | 160 | } |
160 | } | 161 | } |
161 | 162 | ||
162 | void Dialer::send(const QString& msg) | 163 | void Dialer::send(const QString& msg) |
163 | { | 164 | { |
164 | QString m = msg; | 165 | QString m = msg; |
165 | int bytes; | 166 | int bytes; |
166 | QString termination; | 167 | QString termination; |
167 | 168 | ||
168 | termination = m_profile.readEntry("Termination"); | 169 | termination = m_profile.readEntry("Termination"); |
169 | if(termination == "\n") m = m + "\n"; | 170 | if(termination == "\n") m = m + "\n"; |
170 | else if(termination == "\r") m = m + "\r"; | 171 | else if(termination == "\r") m = m + "\r"; |
171 | else m = m + "\r\n"; | 172 | else m = m + "\r\n"; |
172 | 173 | ||
173 | bytes = write(0, m.local8Bit(), strlen(m.local8Bit())); | 174 | bytes = write(0, m.local8Bit(), strlen(m.local8Bit())); |
174 | if(bytes < 0) | 175 | if(bytes < 0) |
175 | { | 176 | { |
176 | reset(); | 177 | reset(); |