Anshul Tyagi
Anshul Tyagi

Reputation: 446

Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY)

I'm implementing one calling service which is called TWILIO. By using TWILIO we can make calls, get incoming calls, SMS etc. It has its own SDK which is available on Twilio.com. In SDK, they have their own code for making outgoing calls or incoming calls. This service is available for each platform. Here, we're using PHP web services to get a token by it and use that token to make call and get call. This token is only valid for a limited time like 1 or 2 hours.

Here, in android applications I'm using Twilio service using PHP webservices. Everything is fine if I implement code for outgoing calls and incoming calls. And I can get incoming calls within an activity. Now, I want to get incoming calls when my app is connected with internet but it is not opened or I'm running any activity after getting login inside app. So, I've started a Broadcast receiver in one class and by that BroadcastReceiver, I start a background SERVICE which send a value using intent to the SERVICE. After that, I initialize TWILIO in the SERVICE class and get login with TWILIO(in background). Now when I get Incoming call, SERVICE calls a non-activity class where all methods of TWILIO are defined, it checks the token what we got from PHP webservice. And after that, it goes to an activity which has a UI by which we open a ALertDialog. this activity comes in the background of that AlertDialog at the time of incoming call. The method which shows incoming call's AlertDialog is defined in the activity. And operations on negative or positive buttons are defined in the non-activity class of Twilio. The operation of negative works very well to ignore the call but when we click on the positive button to accept the call, the current activity which is getting incoming call gets finished itself and comes to the previous activity with the error

08-05 11:41:42.292: E/PJSIP(1960): 11:41:42.292    pjsua_acc.c  ....SIP registration failed, status=302 (Moved Temporarily)
08-05 11:41:42.310: A/PJSIP(1960): 11:41:42.310    pjsua_acc.c  .....Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY) [status=171001]
08-05 11:41:42.356: E/NativeCrypto(1960): ssl=0x60440940 cert_verify_callback x509_store_ctx=0x60263aa0 arg=0x0
08-05 11:41:42.356: E/NativeCrypto(1960): ssl=0x60440940 cert_verify_callback calling verifyCertificateChain authMethod=RSA
08-05 11:41:44.247: E/dalvikvm(1960): JNI ERROR (app bug): attempt to use stale local reference 0x1db00001
08-05 11:41:44.247: E/dalvikvm(1960): VM aborting
08-05 11:41:44.248: A/libc(1960): Fatal signal 11 (SIGSEGV) at 0xdeadd00d (code=1), thread 1982 (m.example.basic)
08-05 11:41:45.821: E/NativeCrypto(2034): ssl=0x5f2ae258 cert_verify_callback x509_store_ctx=0x5e2deab0 arg=0x0
08-05 11:41:45.822: E/NativeCrypto(2034): ssl=0x5f2ae258 cert_verify_callback calling verifyCertificateChain authMethod=RSA
08-05 11:41:45.937: E/PJSIP(2034): 11:41:45.937    pjsua_acc.c  ....SIP registration failed, status=302 (Moved Temporarily)
08-05 11:41:45.940: A/PJSIP(2034): 11:41:45.940    pjsua_acc.c  .....Unable to create/send REGISTER: Object is busy (PJSIP_EBUSY) [status=171001].

I have tried to solve this problem many times in last 15-20 days but not getting success. I hope you got what problem I'm facing.

Upvotes: 4

Views: 2881

Answers (1)

user2616346
user2616346

Reputation: 473

It happens when you trying add account with pjsua_acc_add repeatedly, before first one is received in callback on_reg_started2 or something. Also it might happened if you call pjsua_acc_del before on_reg_started2 called.

Upvotes: 1

Related Questions