@@ -345,7 +345,7 @@ JsSIP.IncomingRequest.prototype = new JsSIP.IncomingMessage();
345345JsSIP . IncomingRequest . prototype . reply = function ( code , reason , extraHeaders , body , onSuccess , onFailure ) {
346346 var rr , vias , header , length , idx ,
347347 response = 'SIP/2.0 ' + code + ' ' + reason + '\r\n' ,
348- to = this . to ,
348+ to = this . getHeader ( 'To' ) ,
349349 r = 0 ,
350350 v = 0 ;
351351
@@ -374,7 +374,7 @@ JsSIP.IncomingRequest.prototype.reply = function(code, reason, extraHeaders, bod
374374 }
375375
376376 response += 'To: ' + to + '\r\n' ;
377- response += 'From: ' + this . from + '\r\n' ;
377+ response += 'From: ' + this . getHeader ( 'From' ) + '\r\n' ;
378378 response += 'Call-ID: ' + this . call_id + '\r\n' ;
379379 response += 'CSeq: ' + this . cseq + ' ' + this . method + '\r\n' ;
380380
@@ -409,14 +409,14 @@ JsSIP.IncomingRequest.prototype.reply_sl = function(code, reason) {
409409 response += 'Via: ' + this . getHeader ( 'via' , v ) + '\r\n' ;
410410 }
411411
412- to = this . to ;
412+ to = this . getHeader ( 'To' ) ;
413413
414414 if ( ! this . to_tag ) {
415415 to += ';tag=' + JsSIP . utils . newTag ( ) ;
416416 }
417417
418418 response += 'To: ' + to + '\r\n' ;
419- response += 'From: ' + this . from + '\r\n' ;
419+ response += 'From: ' + this . getHeader ( 'From' ) + '\r\n' ;
420420 response += 'Call-ID: ' + this . call_id + '\r\n' ;
421421 response += 'CSeq: ' + this . cseq + ' ' + this . method + '\r\n\r\n' ;
422422
0 commit comments