it must work with your modem. 4999 can sometimes come because the modems do have different behaviors regarding the time between getting PIN and giving OK on this.
Some modems (e.g. md720-3 will give you immediately the OK when the PIN is valid).
Some modems (e.g. TC65 will give you OK not before logging into providers network)
and further more consider about the signal quality and the signal strength which can delay the process.
the application was build primary for md720-3. means with other modems (especially the TC/MC-series) the library-given timeout is too short --> 4999. But the next time you trigger init-routine it must be good!
If it is NOT OK neither, then lets go into detail because it must be something different which causes the error...