Let me explain the scenario before arival at the solution.
- It's about connect/disconnect of GPRS sessions using a Mobile phone with an Indian Telecom Service Provider.
- It's a dial-up service which involves PPP.
- Windows XP, SP3 and with Sony Ericsson PC Suite
Problem: Usually when operator services requests over GPRS, they keep a validated session to bill accordingly. When session is closed so should be connection. Sometimes, my operator kept connection open but session closed. All the requests were dropped(not sure how). Usual session period is/was 50 minutes, after which I used to make a Dial-Up call using scheduled tasks. DLL approach was not helping as explained in the question.
However, few days back I came across, "rasdial" utility. Below two simple lines addressed the problem easily:
rasdial "AirTel_GPRS" /DISCONNECT
rasdial "AirTel_GPRS"
I've a created a .bat file with above commands, scheduled it every 50 minutes. Now I've an almost uninterrupted GPRS connection for downloads. :-)
And sevaral posts on stackoverflow regarding rasdial.
Thank you.