1

I'm using pjsip in my android chat application(using pjsua2). All things is good and I can register and make call with others successfully. default re-registration of pjsua2 is 300s and after this time a re-register request will send to server. And I know how to change this time , but some times I need to call re-registration manually depends on some events. how can I call re-registration and send registration to server manually.

Hosein Kord
  • 187
  • 2
  • 15

1 Answers1

1

If someone need to call re-registration with pjsua2, call bellow function from Account class :

public void setRegistration(boolean renew) throws java.lang.Exception {
    pjsua2JNI.Account_setRegistration(swigCPtr, this, renew);
}
Hosein Kord
  • 187
  • 2
  • 15
  • can you please let me know how can i change default reregistration delay 300 second after sip failure registration at https://stackoverflow.com/questions/64241763/how-to-change-default-time-delay-300-second-pjsua-2-android-retry-registratio – tomtom Oct 09 '20 at 08:16
  • And how can i pause and unpause video streaming during a video call , provided voice call stays . (just like feature on whats app - u can hide and unhide video during a call) ...at https://stackoverflow.com/questions/63702759/how-to-pause-and-unpause-video-transmission-using-android-pjsua-2/64259445#64259445 – tomtom Oct 09 '20 at 08:18
  • Hasein Kord can you please guide me I am getting this error? account.cpp !pjsua_acc_set_registration(id, renew) error: Invalid value or argument (PJ_EINVAL) (status=70004) [../src/pjsua2/account.cpp:1029] – Dharmesh Patel Nov 02 '21 at 11:36
  • @DharmeshPatel , It's better not call setRegistration as I said , You should change this configs (setFirstRetryIntervalSec - setRetryIntervalSec - setRandomRetryIntervalSec -) - And if you need register again its better to remove last account and add account again. – Hosein Kord Nov 03 '21 at 06:51