I found why this was happening.
I was using this method and it disables the automatic network monitoring by itself. I commented the if condition so I can use both and it's working now.
void linphone_core_set_network_reachable(LinphoneCore* lc,bool_t isReachable) {
//first disable automatic mode
if (lc->auto_net_state_mon) {
ms_message("Disabling automatic network state monitoring");
lc->auto_net_state_mon=FALSE;
}
set_network_reachable(lc,isReachable, ms_time(NULL));
}Please, advise me if that is not the best way to do that.