File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed
Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 66 REGISTER_RESPONSE_REMOVE ,
77 JAMBONES_REGBOT_USER_AGENT
88} = require ( './config' ) ;
9- const { isValidDomainOrIP} = require ( './utils' ) ;
9+ const { isValidDomainOrIP, isValidIPv4 } = require ( './utils' ) ;
1010const DEFAULT_EXPIRES = ( parseInt ( JAMBONES_REGBOT_DEFAULT_EXPIRES_INTERVAL ) || 3600 ) ;
1111const MIN_EXPIRES = ( parseInt ( JAMBONES_REGBOT_MIN_EXPIRES_INTERVAL ) || 30 ) ;
1212const assert = require ( 'assert' ) ;
@@ -119,7 +119,8 @@ class Regbot {
119119 proxy = `sip:${ this . outbound_sip_proxy } ;transport=${ transport } ` ;
120120 this . logger . debug ( `sending via proxy ${ proxy } ` ) ;
121121 } else {
122- proxy = `sip:${ this . ipv4 } :${ this . port } ;transport=${ transport } ` ;
122+ const isIPv4 = isValidIPv4 ( this . ipv4 ) ;
123+ proxy = `sip:${ this . ipv4 } ${ isIPv4 ? `:${ this . port } ` : '' } ;transport=${ transport } ` ;
123124 this . logger . debug ( `sending to registrar ${ proxy } ` ) ;
124125 }
125126 const req = await srf . request ( `${ scheme } :${ this . sip_realm } ` , {
You can’t perform that action at this time.
0 commit comments