Disconecting GPRS by operator to take payment


Hi all,
I have another from tricky question series.
My Fastrack is connected to remote server through GPRS as a TCP socket client. Session is established by WIP library and is always active.
From time to time (depends on GSM operator) GPRS session is deactivated to charge for GPRS.
I couldn’t catch any network event that session is disconnected in such a situation. Is it possible?
Thanks for replay.



What, exactly, do you mean by that

Don’t see why that should have anything to do with it!

Quite possibly not - but see viewtopic.php?f=16&t=3167&p=11799&hilit=be+designed+specifically+cope+with+such+conditions#p11799

Maybe you could implement a periodic “keep-alive” signal to stop the operator closing the session…?




You can’t catch the GPRS disconnect from within WIP - but if you subscribe to the ADL GPRS events, you can be notified on the REGISTER and UNREGISTER events.

Have a look at adl_gprsSubscribe() and the associated ADL_GPRS_EVENT_ME_UNREG and ADL_GPRS_EVENT_ME_ATTACH events.

Works for me.

ciao, Dave



Shouldn’t WIP be monitoring these itself?

Shouldn’t it give a WIP_BERR_IP_DISCONNECTED or whatever to indicate that the Bearer has failed?

So how should one react to those events?

eg, Should ADL_GPRS_EVENT_ME_UNREG be taken as equivalent to WIP_BERR_IP_DISCONNECTED (or whatever) - so you take your normal recovery action for that WIP event…?




In my opinion, yes - most certainly. However, in my experience, it doesn’t. See the tail of viewtopic.php?f=16&t=2947#p10813 thread for a discussion on this effect.

I do the following:
For a ADL_GPRS_EVENT_ME_UNREG, I call wip_bearerStop() to close the connection cleanly (release memory etc).
For a ASL_GPRS_EVENT_ME_ATTACH, I attempt to re-establish the connection (wip_netInit(), wip_bearerOpen(), wip_bearerSetOpts()).

Note that I return ADL_GPRS_FORWARD as the return code for the event handler - this ensures that the events are proagated to other parts of the OS that are registered to recieve the events…

ciao, Dave



Is it a good idea to use WIP library and GPRS subscription at the same time? Does it not lead to any errors or unpredictable behaviour? Is terminal working stable?
And one more thing. What exactly is happening with WIP library when GPRS session is interrupted by CSD connection. I have noticed that no events related to GPRS WIP are happening.
I have noticed that without detaching GPRS, when CSD call is connected, I can’t send and receive nothing through GPRS. It is normal behaviour. After call ends, GPRS session is re-established. Is in this situation GPRS connection frozen? I have noticed that if call is longer than 5 minutes, GPRS WIP error occures WIP_CERR_TIMEOUT. It means that GPRS is some how active. Is this behaviour defined and described somewhere?




I wouldn’t have thought so - but the WIP library (in my experience) currently cannot deal with the Network being disconnected - thus my use of the ADL GPRS events. Note that I am not doing any control of the GPRS flow using the ADL GPRS fuctions - only catching the Register/unregister events then calling WIP library routines to do the disconnect/cleanup etc.

I suspect that closing the GPRS connection using the ADL GPRS functions when the connection was opened using WIP is probably a recipe for disaster!

Yes. The Wavecom modem (and many other phones) cannot do concurrent GPRS and CSD connections. I have seen this mentioned in the documentation and elsewhere on the forum. Don’t know why - may be a limitation of the GSM network?

ciao, Dave



I wonder if this is actually WIP trying to be “helpful” i[/i]?

That is, WIP is hoping that the connection will recover (maybe it has its own internal recovery mechanisms) - so it doesn’t (initially) notify the application :question:

IF this is the case, it is extremely bad that it is not clearly documented. :angry:

It would also bad if there was no way for the application to control or configure it. :angry:

WIP’s handling of GPRS failure cases does seem to be particularly poor - eg, see also: viewtopic.php?f=16&t=2733 :angry:



I know that it works like that. Excluding the fact that it is not the best solution to have class A modems (theoretically both GSM and GPRS are abled to work at the same time) and don’t support software alowing that.
I am only wondering if you have experience about that. I have continuous TCP/IP session open wit socket server. WIP library is taking care of the connection on modems site. I have also subscription to CSD data calls. Without disconnecting GPRS session WIP library is friezing it (GPRS) during CSD call. I have not receiving any events related to this. After call ends GPRS is reestablished. Is this behaviour documented somewhere?
What exactly is happening with GPRS session?
What is more thanks davidc for advice with handling “rare” GPRS events. I will try this. Maybe the problem with WIP library is, that when GPRS sesion is disconnected or connected by external “thing” (e.g. network, ADL) WIP library don’t receive any events and don’t know nothing about it. I thing that I have read something like that but I am not sure.

Cheers, Marcin