Cheeto_Burrito
03/01/2025, 6:58 AMShubham Bajaj
03/03/2025, 9:31 AMts
export class SipTrunkGateway {
/**
* This is the address of the gateway. It can be an IPv4 address like 1.1.1.1 or a fully qualified domain name like my-sip-trunk.pstn.twilio.com.
*/
@IsFQDNOrIP({ ipVersion: '4' })
ip: string;
/**
* This is the port number of the gateway. Default is 5060.
*
* @default 5060
*/
@IsOptional()
@IsNumberWithHelpfulError()
@Min(1)
@Max(65535)
port?: number;
/**
* This is the netmask of the gateway. Defaults to 32.
*
* @default 32
*/
@IsOptional()
@IsInt()
@Min(24)
@Max(32)
netmask?: number;
/**
* This is whether inbound calls are allowed from this gateway. Default is true.
*
* @default true
*/
@IsOptional()
@IsBoolean()
inboundEnabled?: boolean;
/**
* This is whether outbound calls should be sent to this gateway. Default is true.
*
* Note, if netmask is less than 32, it doesn't affect the outbound IPs that are tried. 1 attempt is made to `ip:port`.
*
* @default true
*/
@IsOptional()
@IsBoolean()
outboundEnabled?: boolean;
/**
* This is the protocol to use for SIP signaling outbound calls. Default is udp.
*
* @default udp
*/
@IsOptional()
@IsString()
@IsIn(['tls/srtp', 'tcp', 'tls', 'udp'])
outboundProtocol?: string;
/**
* This is whether to send options ping to the gateway. This can be used to check if the gateway is reachable. Default is false.
*
* This is useful for high availability setups where you want to check if the gateway is reachable before routing calls to it. Note, if no gateway for a trunk is reachable, outbound calls will be rejected.
*
* @default false
*/
@IsOptional()
@IsBoolean()
optionsPingEnabled?: boolean;
}
2. **Supported Codecs**:
- G.711U
- G.711A
- G.729
- OPUS
3. **Media IP Ranges & Ports**:
For SIP signaling:
- Protocol: UDP/TCP
- Default Port
- Dynamic IP allocation from our SBC cluster
For RTP Media:
- Port Range: Default
- Dynamic IP allocation from our SBC cluster
4. **TLS/SRTP Support**:
Yes, we support TLS/SRTP for secure communications. You can configure this in the gateway settings:
ts
@IsOptional()
@IsString()
@IsIn(['tls/srtp', 'tcp', 'tls', 'udp'])
outboundProtocol?: string;
Shubham Bajaj
03/03/2025, 9:32 AMShubham Bajaj
03/03/2025, 9:32 AM