| pj_status_t pjsua_acc_set_registration | ( | pjsua_acc_id | acc_id, |
| pj_bool_t | renew | ||
| ) |
Update registration or perform unregistration. If registration is configured for this account, then initial SIP REGISTER will be sent when the account is added with pjsua_acc_add(). Application normally only need to call this function if it wants to manually update the registration or to unregister from the server.
| acc_id | The account ID. |
| renew | If renew argument is zero, this will start unregistration process. |
--
You received this message because you are subscribed to the Google Groups "CSipSimple Development" group.
To unsubscribe from this group and stop receiving emails from it, send an email to csipsimple-de...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
Yes, It's already totally possible just by using settings !! :-)
If you want the app to stay registered on WiFi (and automatically start /stop when WiFi is available) just enable the setting "enable for incoming > WiFi" (and also enable for outgoing). If you want the app to automatically stop on background when it's 3g disable the setting "enable for incoming >3g" and keep the outgoing for 3g enabled.
This way the app will ensure that it will not stay registered on 3g and will just start 'on demand' when on 3g (basically when you go in a CSipSimple ui that allows to make a sip call). And it will automatically connect when WiFi is reconnected!
(Side note : keep in mind that in android to quit a user interface activity you must use the back key and not the home key.)
So all this lifetime management already exists in CSipSimple and works very well. Do not reinvent the wheel. All you need to do, is to use the configuration api of CSipSimple lib to select the lifetime behavior of the app regarding network. And that's it. Do not bother with registration etc etc. CSipSimple lib will take care of that and probably better that what you might think initially because it will manage hard network cuts and registration cleanup at next restart etc.
Advise : try to use the core app first and to understand the settings already available. The features available should already cover most real sip client needs and integration to Android. Making a custom version of the app should be only about non sip features (something only on your service) and about using the config api to automatically setup for your service (and this should normally be done using the wizard activity approach).
For anything else related to sip, it either already exists, either, if not, it probably makes sense to have in the main app. In the later case it means that you should contribute that to the core project. Just a reminder, the code of CSipSimple is GPL/LGPL (with pjsip commercial license). So in any case all source code you will modify related to sip in java must be opensourced and is a potential contribution. So when dealing with a need related to sip, thinks first about how you could contribute that if not already done. Play the game of GPL, it's what make you save money and time currently (and in the future), what make all the apps base on csipsimple (including yours) better, and what provides all users better experience, and so, what makes world better ;-).
Best regards
Regis.
Hi RegisThanks a lot for the info and advice. Yes, we will honor the GPL/LGPL if we make the related changes.I tried this setting ( assuming wifi/3g are handled the same way) :wifi with incoming disable,wifi with outgoing enabledthen use back key to the sip main dialpad screen, the sip account showed de-active, then re-actived, then it said sip registered.According to your description, it seems should stay unregistered, only when I make an outgoing sip call it will try to register, right? is it a bug?
Read the code SipServic.java, there is a function:public boolean isConnectivityValid() {if(prefsWrapper.getPreferenceBooleanValue(PreferencesWrapper.HAS_BEEN_QUIT, false)) {return false;}boolean valid = prefsWrapper.isValidConnectionForIncoming();if(activitiesForOutgoing.size() > 0) {valid |= prefsWrapper.isValidConnectionForOutgoing();}return valid;}it seems it does not differentiate the outgoing and incoming setting??