amitpahune / jain-sip

Automatically exported from code.google.com/p/jain-sip
0 stars 0 forks source link

Exception raised when INVITE is authenticated #94

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Authenticate INVITE method (i.e. return 407 on first INVITE)
2.Make a call

What is the expected output? What do you see instead?
SIPClientTransaction:processResponseargu3(): catched exception:TypeError: 
Cannot call method 'setRemoteTarget' of null 

What version of the product are you using? On what operating system?

Please provide any additional information below.

I beleive that this is fixed by adding this two lines below in the 
WebRTCPhoneUA.prototype.handleStateMachineInvitingResponseEvent function

    else if(this.invitingState==this.INVITING_407_STATE)
    {
        if(statusCode< 200)
        {
            console.debug("WebRTCPhoneUA:handleStateMachineInvitingResponseEvent(): 1XX response ignored");
        }
        else if(statusCode==200)
        {
        this.jainSipInvitingDialog=responseEvent.getOriginalTransaction().getDialog(); //<--- Add this line
            this.invitingState=this.INVITING_ACCEPTED_STATE; //<--- Add this line

        this.jainSipInvitingDialog.setRemoteTarget(jainSipResponse.getHeader("Contact")); //<--- Exception was raised here
            var jainSipMessageACK = responseEvent.getOriginalTransaction().createAck();
            this.jainSipInvitingDialog.sendAck(jainSipMessageACK);

Original issue reported on code.google.com by sergio.g...@gmail.com on 5 Apr 2013 at 10:01

GoogleCodeExporter commented 8 years ago
Hello Sergio.
Your issue seems already corrected; Current source code in trunk is:

 this.jainSipInvitingDialog=responseEvent.getOriginalTransaction().getDialog();    
 try
 {
// Send SIP 200 OK ACK              
this.jainSipInvitingDialog.setRemoteTarget(jainSipResponse.getHeader("Contact"))
;
var jainSipMessageACK = this.jainSipInvitingTransaction.createAck();
jainSipMessageACK.addHeader(this.clientConnector.jainSipContactHeader);
this.jainSipInvitingDialog.sendAck(jainSipMessageACK);
// Update SIP call state
this.sipCallState=this.SIP_INVITING_ACCEPTED_STATE;
 }
catch(exception)
{              
console.error("PrivateJainSipCallConnector:processInvitingSipRequestEvent(): 
catched exception, exception:"+exception);  
}

Laurent

Original comment by laurent....@gmail.com on 8 Apr 2013 at 2:21

GoogleCodeExporter commented 8 years ago

Original comment by laurent.strullu.orange@gmail.com on 6 May 2013 at 3:06