# can a modem be smart enough to ...?



## view (Jan 31, 2005)

Hi all,

here is my problem:

I need my PC to call my mobile phone when certain event occures, through a dial-up connection. 
For that purpose I've created an *internet connection* (although i don't really need internet), with blank for username&password, and just my mobile phone number.

Than I wrote a batch file:

*DIAL.bat*

```
@ECHO OFF

:loop
Echo Trying to Dial up..................................
rasdial MyMobile

if NOT %ERRORLEVEL% ==0 goto failed

Exit
:failed
cls

Echo Failed to connect......will retry

goto loop
```
..but the problem with this script is that it can't stop calling (can't exit the loop).

So, if I answer the call (on my mobile) and subsequently close the connection (this is what I need, just to be noticed about certain event on my PC), this script starts to call again, and loops until I answer again, and so on, over and over.

Than I tried the following TEST.bat script, to establish a reason for this:

*TEST.bat*

```
@ECHO OFF

Echo Trying to Dial up..................................
rasdial MyMobile

Echo The error level is %ERRORLEVEL%

pause
```
..and i've got:


```
Trying to Dial up..................................
Connecting to MYMOBILE...

Remote Access error 676 - The phone line is busy.

For more help on this error:
        Type 'hh netcfg.chm'
        In help, click Troubleshooting, then Error Messages, then 676
The error level is 676
Press any key to continue . . .
```
..although the phone line apparently was not busy.

The reason for that (i think) is the script can't get %ERRORLEVEL% ==0 value, because %ERRORLEVEL% ==0 probably means a connection with *an other modem* is established, means handshake process is accomplished successfully. 
In my case, i don't have any modem on the other side, but just my mobile, so %ERRORLEVEL% will be <>0 in any way, thus script will not leave the loop.:4-dontkno 

Is there some workaround to exit outside the loop when I answer my mobile phone?
Can modem notice that called phone doesn't ring anymore?


Many thanks


----------



## Terrister (Apr 18, 2005)

I am going to transfer this to the programing forum.


----------



## Volt-Schwibe (Jan 12, 2003)

if you can send text messages to your phone, which most phone accept, you could set up a macro script to send you a test message instead.

this would avoid the modem trying to understand it's talking to a person, and not a voice mail.

that script might include dialing the internet, unless you have another connection.


----------

