Closed GoogleCodeExporter closed 9 years ago
We have stated to work on the issue. In the meanwhile, if you want to add this
feature, here is the steps:
1. Add an observer for network change in -didFinishLaunchingWithOptions:
[[NSNotificationCenter defaultCenter]
addObserver:self selector:@selector(onNetworkEvent:) name:kNgnNetworkEventArgs_Name object:nil];
2. Implement -onNetworkEvent: like this:
-(void) onNetworkEvent:(NSNotification*)notification {
NgnNetworkEventArgs *eargs = [notification object];
switch (eargs.eventType) {
case NETWORK_EVENT_STATE_CHANGED:
default:
{
NgnNSLog(TAG,@"NetworkEvent reachable=%@ networkType=%i",
[NgnEngine getInstance].networkService.reachable ? @"YES" : @"NO", [NgnEngine getInstance].networkService.networkType);
if([NgnEngine getInstance].networkService.reachable){
BOOL onMobileNework = ([NgnEngine getInstance].networkService.networkType & NetworkType_WWAN);
if(onMobileNework){ // 3G, 4G, EDGE ...
//MediaSessionMgr::defaultsSetBandwidthLevel(tmedia_bl_medium); // QCIF, SQCIF
}
else {// WiFi
//MediaSessionMgr::defaultsSetBandwidthLevel(tmedia_bl_unrestricted);// SQCIF, QCIF, CIF ...
}
// unregister the application and schedule another registration
BOOL on3G = onMobileNework; // Downgraded to 3G even if it could be 4G or EDGE
BOOL use3G = [[NgnEngine getInstance].configurationService getBoolWithKey:NETWORK_USE_3G];
if(on3G && !use3G){
// [self networkAlert:kNetworkAlertMsgThreedGNotEnabled];
[[NgnEngine getInstance].sipService stopStackSynchronously];
}
else { // "on3G and use3G" or on WiFi
// stop stack => clean up all dialogs
[[NgnEngine getInstance].sipService stopStackSynchronously];
[[NgnEngine getInstance].sipService registerIdentity];
}
}
break;
}
}
}
Original comment by boss...@yahoo.fr
on 8 Jul 2011 at 12:28
Original comment by boss...@yahoo.fr
on 23 Jul 2011 at 4:57
Original issue reported on code.google.com by
kir...@emergingbanking.com
on 7 Jul 2011 at 6:35