[Android] Problem incoming call

FG
Fanilo Gabaud
Mon, Aug 22, 2016 8:50 AM

Hello everyone,

I’m trying to make incoming calls working  on Android. However I’m facing some issues, when I’m receiving an incoming, the callback in my Account class is called but as soon as I’m trying to answer to the call I’m getting this issue : 

!Answering call 0: code=200

.Invalid call_id 0 in pjsua_call_answer()

pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED)

Not really what’s wrong here and why the session is already terminated when I’m answering. Thanks.

Best regards,

Fanilo Gabaud

Sent from
https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature

Hello everyone, I’m trying to make incoming calls working  on Android. However I’m facing some issues, when I’m receiving an incoming, the callback in my Account class is called but as soon as I’m trying to answer to the call I’m getting this issue :  !Answering call 0: code=200 .Invalid call_id 0 in pjsua_call_answer() pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED) Not really what’s wrong here and why the session is already terminated when I’m answering. Thanks. Best regards, Fanilo Gabaud Sent from https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature
LB
Lokesh Bhat
Fri, Sep 23, 2016 10:02 AM

we are too facing the same problem. Kindly let me know if you have got any
solution.

On Mon, Aug 22, 2016 at 2:20 PM, Fanilo Gabaud fanilo@aircall.io wrote:

Hello everyone,

I’m trying to make incoming calls working  on Android. However I’m facing
some issues, when I’m receiving an incoming, the callback in my Account
class is called but as soon as I’m trying to answer to the call I’m getting
this issue :

- !Answering call 0: code=200
- .Invalid call_id 0 in pjsua_call_answer()
- pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason,
param.p_msg_data) error: INVITE session already terminated
(PJSIP_ESESSIONTERMINATED)

Not really what’s wrong here and why the session is already terminated
when I’m answering. Thanks.

Best regards,

Fanilo Gabaud
Sent from Polymail
https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature


Visit our blog: http://blog.pjsip.org

pjsip mailing list
pjsip@lists.pjsip.org
http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--
Thanks and Regards
~ Lokesh Bhat

we are too facing the same problem. Kindly let me know if you have got any solution. On Mon, Aug 22, 2016 at 2:20 PM, Fanilo Gabaud <fanilo@aircall.io> wrote: > Hello everyone, > > I’m trying to make incoming calls working on Android. However I’m facing > some issues, when I’m receiving an incoming, the callback in my Account > class is called but as soon as I’m trying to answer to the call I’m getting > this issue : > > > - !Answering call 0: code=200 > - .Invalid call_id 0 in pjsua_call_answer() > - pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, > param.p_msg_data) error: INVITE session already terminated > (PJSIP_ESESSIONTERMINATED) > > Not really what’s wrong here and why the session is already terminated > when I’m answering. Thanks. > > Best regards, > > > Fanilo Gabaud > Sent from Polymail > <https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature> > > _______________________________________________ > Visit our blog: http://blog.pjsip.org > > pjsip mailing list > pjsip@lists.pjsip.org > http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org > > -- Thanks and Regards ~ Lokesh Bhat
FG
Fanilo Gabaud
Fri, Sep 23, 2016 10:18 AM

Hi,

Sure however I’m working with the Java code and not directly with the C code of the library. Well, it was a bit tricky but actually it’s already specified in the doc. 


For incoming calls, the call instance is created in the callback function as shown above. Application should make sure to store the call instance during the lifetime of the call (that is until the call is disconnected)```.

 I’ve created an instance of my call Object in the callback. In my code it’s an attribute 

private

MyCallObject 

incomingCall

; 

@Override

public void

onIncomingCall

(OnIncomingCallParam prm) {

Timber.

d

(

"Incoming call "

+ prm.getCallId())

;

incomingCall

=

new

MyCallObject

(

this,

prm.getCallId()

,

pjsipUtil

.getEndpoint())

;

/**

* Incoming call constructor.

*

*

@param

acc

the account which own this call

*

@param

callId

the id of this call

*/

public

AircallSipCall

(Account acc

, int

callId

,

Endpoint endPoint) {

super

(acc

,

callId)

;

this

.

endPoint

= endPoint

;

}

Just to be sure that the garbage collector doesn’t see my object as out of scope. I hoped that I was able to help you. 

Cheers,

Fanilo Gabaud

Sent from
https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature

On ven. 23 sept. 2016 at 12:02 Lokesh Bhat

<
mailto:Lokesh Bhat <lokeshbhat1991@gmail.com>

wrote:

a, pre, code, a:link, body { word-wrap: break-word !important; }

we are too facing the same problem. Kindly let me know if you have got any solution.


Visit our blog:
http://blog.pjsip.org
pjsip mailing list
mailto:pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

On Mon, Aug 22, 2016 at 2:20 PM, Fanilo Gabaud

<
mailto:fanilo@aircall.io

wrote:

Hello everyone,

I’m trying to make incoming calls working  on Android. However I’m facing some issues, when I’m receiving an incoming, the callback in my Account class is called but as soon as I’m trying to answer to the call I’m getting this issue : 

!Answering call 0: code=200

.Invalid call_id 0 in pjsua_call_answer()

pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED)

Not really what’s wrong here and why the session is already terminated when I’m answering. Thanks.

Best regards,

Fanilo Gabaud

Sent from
https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature



Visit our blog:
http://blog.pjsip.org
pjsip mailing list
mailto:pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org

--

Thanks and Regards

~ Lokesh Bhat

Hi, Sure however I’m working with the Java code and not directly with the C code of the library. Well, it was a bit tricky but actually it’s already specified in the doc.  ``` For incoming calls, the call instance is created in the callback function as shown above. Application should make sure to store the call instance during the lifetime of the call (that is until the call is disconnected)```.  I’ve created an instance of my call Object in the callback. In my code it’s an attribute  private MyCallObject  incomingCall ;  @Override public void onIncomingCall (OnIncomingCallParam prm) { Timber. d ( "Incoming call " + prm.getCallId()) ; incomingCall = new MyCallObject ( this, prm.getCallId() , pjsipUtil .getEndpoint()) ; /** * Incoming call constructor. * * @param acc the account which own this call * @param callId the id of this call */ public AircallSipCall (Account acc , int callId , Endpoint endPoint) { super (acc , callId) ; this . endPoint = endPoint ; } Just to be sure that the garbage collector doesn’t see my object as out of scope. I hoped that I was able to help you.  Cheers, Fanilo Gabaud Sent from https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature On ven. 23 sept. 2016 at 12:02 Lokesh Bhat < mailto:Lokesh Bhat <lokeshbhat1991@gmail.com> > wrote: a, pre, code, a:link, body { word-wrap: break-word !important; } we are too facing the same problem. Kindly let me know if you have got any solution. _______________________________________________ Visit our blog: http://blog.pjsip.org pjsip mailing list mailto:pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org On Mon, Aug 22, 2016 at 2:20 PM, Fanilo Gabaud < mailto:fanilo@aircall.io > wrote: Hello everyone, I’m trying to make incoming calls working  on Android. However I’m facing some issues, when I’m receiving an incoming, the callback in my Account class is called but as soon as I’m trying to answer to the call I’m getting this issue :  !Answering call 0: code=200 .Invalid call_id 0 in pjsua_call_answer() pjsua_call_answer2(id, param.p_opt, prm.statusCode, param.p_reason, param.p_msg_data) error: INVITE session already terminated (PJSIP_ESESSIONTERMINATED) Not really what’s wrong here and why the session is already terminated when I’m answering. Thanks. Best regards, Fanilo Gabaud Sent from https://polymail.io/?utm_source=polymail&utm_medium=referral&utm_campaign=signature ______________________________ _________________ Visit our blog: http://blog.pjsip.org pjsip mailing list mailto:pjsip@lists.pjsip.org http://lists.pjsip.org/mailman/listinfo/pjsip_lists.pjsip.org -- Thanks and Regards ~ Lokesh Bhat