File tree Expand file tree Collapse file tree 2 files changed +6
-1
lines changed
Expand file tree Collapse file tree 2 files changed +6
-1
lines changed Original file line number Diff line number Diff line change @@ -11,6 +11,8 @@ test('JsSIP.URI', function() {
1111 deepEqual ( uri . headers , { } ) ;
1212 strictEqual ( uri . toString ( ) , 'sip:alice@jssip.net:6060' ) ;
1313 strictEqual ( uri . toAor ( ) , 'sip:alice@jssip.net' ) ;
14+ strictEqual ( uri . toAor ( false ) , 'sip:alice@jssip.net' ) ;
15+ strictEqual ( uri . toAor ( true ) , 'sip:alice@jssip.net:6060' ) ;
1416
1517 uri . scheme = 'SIPS' ;
1618 strictEqual ( uri . scheme , 'sips' ) ;
Original file line number Diff line number Diff line change @@ -163,14 +163,17 @@ JsSIP.URI.prototype = {
163163
164164 return uri ;
165165 } ,
166- toAor : function ( ) {
166+ toAor : function ( show_port ) {
167167 var aor ;
168168
169169 aor = this . scheme + ':' ;
170170 if ( this . user ) {
171171 aor += JsSIP . Utils . escapeUser ( this . user ) + '@' ;
172172 }
173173 aor += this . host ;
174+ if ( show_port && ( this . port || this . port === 0 ) ) {
175+ aor += ':' + this . port ;
176+ }
174177
175178 return aor ;
176179 }
You can’t perform that action at this time.
0 commit comments