Skip to main content

Step2: Configure SBC for Teams Direct Routing

Follow Ribbon Article : 

image-1668741704257.png


image-1668741681252.png

 

Create Initial IP Interfaces, External / Internal with Zones

set addressContext default ipInterfaceGroup EXTERNAL ipInterface EXT_IPIF portName pkt0 ipVarV4 IF2.IPV4 prefixVarV4 IF2.PrefixV4 ipPublicVarV4 HFE_IF2.FIPV4 state enabled mode inService

set addressContext default ipInterfaceGroup INTERNAL ipInterface INT_IPIF portName pkt1 ipVarV4 IF3.IPV4 prefixVarV4 IF3.PrefixV4 ipPublicVarV4 HFE_IF3.FIPV4 state enabled mode inService

commit

CHECK the IP value of Interfaces for Static Route creation for each interface

image-1668742331308.png

set addressContext default staticRoute 0.0.0.0 0 <use actual IP value, stored in IF2.GWV4> EXTERNAL EXT_IPIF

set addressContext default staticRoute 0.0.0.0 0 <use actual IP value, stored in IF3.GWV4> INTERNAL INT_IPIF

commit

Start Teams and PSTN Configuration

set addressContext default ipInterfaceGroup EXTERNAL ipInterface EXT_IPIF portName pkt0 ipVarV4 IF2.IPV4 prefixVarV4 IF2.PrefixV4 ipPublicVarV4 HFE_IF2.FIPV4 state enabled mode inService
set addressContext default ipInterfaceGroup INTERNAL ipInterface INT_IPIF portName pkt1 ipVarV4 IF3.IPV4 prefixVarV4 IF3.PrefixV4 ipPublicVarV4 HFE_IF3.FIPV4 state enabled mode inService
commit

set addressContext default zone TEAMS_ZONE id 2 sipSigPort 1 ipVarV4 IF2.IPV4 ipPublicVarV4 HFE_IF2.FIPV4 ipInterfaceGroupName EXTERNAL portNumber 5067 transportProtocolsAllowed sip-udp,sip-tcp,sip-tls-tcp state enabled mode inService
set addressContext default zone PSTN_ZONE id 3 sipSigPort 2 ipVarV4 IF2.IPV4 ipPublicVarV4 HFE_IF2.FIPV4 ipInterfaceGroupName EXTERNAL portNumber 5060 transportProtocolsAllowed sip-udp,sip-tcp state enabled mode inService
set addressContext default zone INTERNAL_ZONE id 4 sipSigPort 3 ipVarV4 IF3.IPV4 ipPublicVarV4 HFE_IF3.FIPV4 ipInterfaceGroupName INTERNAL portNumber 5060 transportProtocolsAllowed sip-udp,sip-tcp state enabled mode inService
commit


set addressContext default staticRoute 0.0.0.0 0 10.30.20.1 EXTERNAL EXT_IPIF
set addressContext default staticRoute 0.0.0.0 0 10.30.30.1 INTERNAL INT_IPIF
commit
configure
# Set SIP Domains
##############################################################################
set global sipDomain sip.pstnhub.microsoft.com
set global sipDomain sip2.pstnhub.microsoft.com
set global sipDomain sip3.pstnhub.microsoft.com
set global sipDomain customers-eu.connxaisaas.com


#Ring Back Tone (without DSP) - Ring back tones can be played on certain codecs even though DSP cards/licenses are not available.
set profiles media toneCodecEntry g711u codec g711 law ULaw
commit
set profiles media toneAsAnnouncementProfile toneType defRing codecType g711u segmentId 20001
commit
# Create a Local Ringback Tone (LRBT) profile that will be attached to the TEAMS side. Enable Dynamic LRBT.
##############################################################################
set profiles media toneAndAnnouncementProfile LRBT_PROF
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone signalingTonePackageState enable
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone precedence lower
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone makeInbandToneAvailable enable
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone flags useThisLrbtForEgress enable
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone flags useThisLrbtForIngress enable
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone flags dynamicLRBT enable
commit
set profiles media toneAndAnnouncementProfile LRBT_PROF localRingBackTone flags announcementBasedTones enable
commit
##############################################################################
#Create path Check profile that will be attached to the TEAMS side.
##############################################################################
set profiles services pathCheckProfile TEAMS_OPTIONS protocol sipOptions sendInterval 20 replyTimeoutCount 1 recoveryCount 1
commit
set profiles services pathCheckProfile TEAMS_OPTIONS transportPreference preference1 tls-tcp
commit
##############################################################################
# Configure Zones
##############################################################################
set addressContext default zone TEAMS_ZONE domainName customers-eu.connxaisaas.com
commit
# Create DNS Group
##############################################################################
set addressContext default dnsGroup EXT_DNS
set addressContext default dnsGroup EXT_DNS type ip interface EXTERNAL server DNSSERVER ipAddress 8.8.8.8 state enabled
set addressContext default zone TEAMS_ZONE dnsGroup EXT_DNS
commit
# Configure IP Signaling Profile for TEAMS
##############################################################################
set profiles signaling ipSignalingProfile TEAMS_IPSP ipProtocolType sipOnly
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags includeReasonHeader enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags includeTransportTypeInContactHeader enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags routeUsingRecvdFqdn enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags sendPtimeInSdp enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags sendRtcpPortInSdp enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags storePChargingVector enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags publishIPInHoldSDP enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes relayFlags statusCode4xx6xx enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags minimizeRelayingOfMediaChangesFromOtherCallLegAll enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes flags relayDataPathModeChangeFromOtherCallLeg enable
set profiles signaling ipSignalingProfile TEAMS_IPSP commonIpAttributes optionTagInRequireHeader suppressReplaceTag enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes numberGlobalizationProfile DEFAULT_IP
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes flags disable2806Compliance enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes domainName useIpSignalingPeerDomainInRequestUri enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes domainName useSipDomainInPAIHeader enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes domainName useSipDomainNameInFromField enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes domainName useZoneLevelDomainNameInContact enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes privacy transparency disable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes privacy privacyInformation pPreferredId
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes privacy flags includePrivacy enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes privacy flags privacyRequiredByProxy disable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes privacy flags msLyncPrivacySupport enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes redirect flags forceRequeryForRedirection enable
set profiles signaling ipSignalingProfile TEAMS_IPSP egressIpAttributes transport type1 tlsOverTcp
set profiles signaling ipSignalingProfile TEAMS_IPSP ingressIpAttributes flags sendSdpIn200OkIf18xReliable enable
commit
##############################################################################
# Configure IP Signaling Profile for PSTN
##############################################################################
set profiles signaling ipSignalingProfile PSTN_IPSP ipProtocolType sipOnly
set profiles signaling ipSignalingProfile PSTN_IPSP commonIpAttributes flags includeReasonHeader enable
set profiles signaling ipSignalingProfile PSTN_IPSP commonIpAttributes flags includeTransportTypeInContactHeader enable
set profiles signaling ipSignalingProfile PSTN_IPSP commonIpAttributes flags minimizeRelayingOfMediaChangesFromOtherCallLegAll enable
set profiles signaling ipSignalingProfile PSTN_IPSP commonIpAttributes flags relayDataPathModeChangeFromOtherCallLeg enable
set profiles signaling ipSignalingProfile PSTN_IPSP egressIpAttributes numberGlobalizationProfile DEFAULT_IP
set profiles signaling ipSignalingProfile PSTN_IPSP commonIpAttributes flags sendPtimeInSdp enable
set profiles signaling ipSignalingProfile PSTN_IPSP commonIpAttributes flags lockDownPreferredCodec enable
set profiles signaling ipSignalingProfile PSTN_IPSP egressIpAttributes flags disable2806Compliance enable
commit
##############################################################################
# Configure CodecEntries for use in Packet Service Profiles (PSPs)
##############################################################################
set profiles media codecEntry G711A-DEFAULT dtmf relay rfc2833
set profiles media codecEntry G711A-DEFAULT packetSize 10
set profiles media codecEntry G711A-DEFAULT toneTreatment faxRelay
set profiles media codecEntry G711A-DEFAULT 
commit
# Set RTCP Interval
##############################################################################
set system media mediaRtcpControl senderReportInterval 5
commit
# SSL Certificate Configuration Section
##############################################################################
###section insert ificates import SBC CERT ,Root CA cert, Interim CA Cert, MSFT Cert.
#Copy all the Certificate Authority's Root Certificate (<NAME:SBC SSL Cert FileName>, <NAME:CA Root Certificate FileName>, <NAME:CA Intermediate Certificate FileName> and <NAME:MSFT Certificate FileName> into /opt/sonus/external/ folder of SBC
##############################################################################
set system security pki certificate SBC_CERT_New fileName sbc_cert_new.p12 passPhrase Console1 state enabled type local
commit
set system security pki certificate CA_GoDaddy_ROOT_CERT type remote fileName CA_GoDaddy-Root.cer state enabled
commit
set system security pki certificate CA_GoDaddy_INT_CERT type remote fileName CA_GoDaddy-Int.cer state enabled
#commit
set system security pki certificate CA_BALTIMORE_CERT type remote fileName CA_Baltimore_Root.cer state enabled
commit
# Create TLS Profile
##############################################################################
set profiles security tlsProfile TLS_PROF clientCertName SBC_CERT_New serverCertName SBC_CERT_New cipherSuite1 tls_ecdhe_rsa_with_aes_256_cbc_sha384 cipherSuite2 tls_ecdhe_rsa_with_aes_128_cbc_sha authClient true allowedRoles clientandserver acceptableCertValidationErrors invalidPurpose v1_0 disabled v1_1 enabled v1_2 enabled
commit
#Set Element Routing Priority for TrunkGroup
##############################################################################
set profiles callRouting elementRoutingPriority TEAMS_ERP entry _private 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry nationalOperator 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry localOperator 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry nationalType 1 entityType trunkGroup
set profiles callRouting elementRoutingPriority TEAMS_ERP entry nationalType 2 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry internationalType 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry internationalOperator 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry longDistanceOperator 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry ipVpnService 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry test 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry transit 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry otherCarrierChosen 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry carrierCutThrough 1 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry userName 1 entityType trunkGroup
set profiles callRouting elementRoutingPriority TEAMS_ERP entry userName 2 entityType none
set profiles callRouting elementRoutingPriority TEAMS_ERP entry mobile 1 entityType none
commit
# Configure SIP Signaling Port with TLS Profile
##############################################################################
set addressContext default zone TEAMS_ZONE sipSigPort 1 state disabled mode outOfService
commit
set addressContext default zone TEAMS_ZONE sipSigPort 1 tlsProfileName TLS_PROF
commit
set addressContext default zone TEAMS_ZONE sipSigPort 1 state enabled mode inService
commit
# Create Crypto Suite Profile
##############################################################################
set profiles security cryptoSuiteProfile TEAMS_CRYPT_PROF entry 1 cryptoSuite AES-CM-128-HMAC-SHA1-80
set profiles security cryptoSuiteProfile TEAMS_CRYPT_PROF entry 1 sessionParameterFlags unencryptedSRTCP disable
set profiles security cryptoSuiteProfile TEAMS_CRYPT_PROF entry 1 sessionParameterFlags unencryptedSRTP disable
set profiles security cryptoSuiteProfile TEAMS_CRYPT_PROF entry 1 sessionParameterFlags unauthenticatedSRTP disable
commit
# Configure TEAMS Packet Service Profile
##############################################################################
set profiles media packetServiceProfile TEAMS_PSP
set profiles media packetServiceProfile TEAMS_PSP codec codecEntry1 G711A-DEFAULT
set profiles media packetServiceProfile TEAMS_PSP rtcpOptions rtcp enable terminationForPassthrough enable
set profiles media packetServiceProfile TEAMS_PSP preferredRtpPayloadTypeForDtmfRelay 101
set profiles media packetServiceProfile TEAMS_PSP silenceInsertionDescriptor g711SidRtpPayloadType 13 heartbeat enable
set profiles media packetServiceProfile TEAMS_PSP secureRtpRtcp flags enableSrtp enable
set profiles media packetServiceProfile TEAMS_PSP secureRtpRtcp flags allowFallback enable
set profiles media packetServiceProfile TEAMS_PSP secureRtpRtcp cryptoSuiteProfile TEAMS_CRYPT_PROF
commit
# Configure PSTN Packet Service Profile
##############################################################################
set profiles media packetServiceProfile PSTN_PSP rtcpOptions rtcp disable
set profiles media packetServiceProfile PSTN_PSP peerAbsenceAction none
set profiles media packetServiceProfile PSTN_PSP silenceInsertionDescriptor g711SidRtpPayloadType 13
set profiles media packetServiceProfile PSTN_PSP silenceInsertionDescriptor heartbeat enable
set profiles media packetServiceProfile PSTN_PSP aal1PayloadSize 47
set profiles media packetServiceProfile PSTN_PSP codec codecEntry1 G711SS-DEFAULT
set profiles media packetServiceProfile PSTN_PSP packetToPacketControl transcode conditional
set profiles media packetServiceProfile PSTN_PSP packetToPacketControl codecsAllowedForTranscoding thisLeg ""
set profiles media packetServiceProfile PSTN_PSP packetToPacketControl codecsAllowedForTranscoding otherLeg ""
set profiles media packetServiceProfile PSTN_PSP flags digitDetectSendEnabled disable
set profiles media packetServiceProfile PSTN_PSP flags useDirectMedia disable
set profiles media packetServiceProfile PSTN_PSP secureRtpRtcp flags allowFallback disable
set profiles media packetServiceProfile PSTN_PSP secureRtpRtcp flags enableSrtp disable
set profiles media packetServiceProfile PSTN_PSP secureRtpRtcp flags resetROCOnKeyChange disable
set profiles media packetServiceProfile PSTN_PSP secureRtpRtcp flags resetEncDecROCOnDecKeyChange disable
set profiles media packetServiceProfile PSTN_PSP secureRtpRtcp flags updateCryptoKeysOnModify disable
set profiles media packetServiceProfile PSTN_PSP secureRtpRtcp flags allowPassthru disable
set profiles media packetServiceProfile PSTN_PSP preferredRtpPayloadTypeForDtmfRelay 101
set profiles media packetServiceProfile PSTN_PSP honorRemotePrecedence disable
set profiles media packetServiceProfile PSTN_PSP sendRoutePSPPrecedence disable
commit
# Create TEAMS SIP Trunk
##############################################################################
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG media mediaIpInterfaceGroupName EXTERNAL
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy media packetServiceProfile TEAMS_PSP
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy signaling ipSignalingProfile TEAMS_IPSP
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy media toneAndAnnouncementProfile LRBT_PROF
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy carrier 0000
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy country 1
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy localizationVariant northAmerica
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy tgIPVersionPreference both-ipv4-and-ipv6
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy preferredIdentity disable
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy digitParameterHandling numberingPlan NANP_ACCESS
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy services classOfService DEFAULT_IP
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy featureControlProfile DEFAULT_IP
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy callRouting elementRoutingPriority TEAMS_ERP
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG downstreamForkingSupport enabled
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG services dnsSupportType a-only
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG ingressIpPrefix 52.112.0.0 14
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling rel100Support enabled
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling honorMaddrParam enabled
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling relayNonInviteRequest enabled
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling methods notify allow
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling methods update reject
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG media sdpAttributesSelectiveRelay enabled
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG mode inService state enabled
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy sipDomain SIP.PSTNHUB.MICROSOFT.COM
commit

# Create PSTN SIP Trunk
##############################################################################
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG media mediaIpInterfaceGroupName EXTERNAL
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy media packetServiceProfile PSTN_PSP
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy signaling ipSignalingProfile PSTN_IPSP
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy media toneAndAnnouncementProfile LRBT_PROF
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy services classOfService DEFAULT_IP
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy featureControlProfile DEFAULT_IP
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy localizationVariant northAmerica
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy tgIPVersionPreference both-ipv4-and-ipv6
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy digitParameterHandling numberingPlan NANP_ACCESS
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy callRouting elementRoutingPriority TEAMS_ERP
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy carrier 0000
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG policy country 1
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG services dnsSupportType a-only
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG ingressIpPrefix 130.117.73.131 32
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG signaling rel100Support enabled
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG signaling honorMaddrParam enabled
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG signaling relayNonInviteRequest enabled
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG signaling methods notify allow
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG mode inService state enabled
commit
# Create IP PEER
##############################################################################
set addressContext default zone TEAMS_ZONE ipPeer TEAMS1_IP_PEER policy sip fqdn sip.pstnhub.microsoft.com fqdnPort 5060
commit
set addressContext default zone TEAMS_ZONE ipPeer TEAMS1_IP_PEER pathCheck profile TEAMS_OPTIONS hostName sip.pstnhub.microsoft.com hostPort 5060 state enabled
commit
set addressContext default zone TEAMS_ZONE ipPeer TEAMS2_IP_PEER policy sip fqdn sip2.pstnhub.microsoft.com fqdnPort 5060
commit
set addressContext default zone TEAMS_ZONE ipPeer TEAMS2_IP_PEER pathCheck profile TEAMS_OPTIONS hostName sip2.pstnhub.microsoft.com hostPort 5060 state enabled
commit
set addressContext default zone TEAMS_ZONE ipPeer TEAMS3_IP_PEER policy sip fqdn sip3.pstnhub.microsoft.com fqdnPort 5060
commit
set addressContext default zone TEAMS_ZONE ipPeer TEAMS3_IP_PEER pathCheck profile TEAMS_OPTIONS hostName sip3.pstnhub.microsoft.com hostPort 5060 state enabled
commit
set addressContext default zone PSTN_ZONE ipPeer PSTN1_IP_PEER ipAddress 130.117.73.131 ipPort 5060
commit
# Create Routing Label
##############################################################################
set global callRouting routingLabel TO_TEAMS_RL routingLabelRoute 1 trunkGroup TEAMS_IPTG ipPeer TEAMS1_IP_PEER inService inService
set global callRouting routingLabel TO_TEAMS_RL routingLabelRoute 2 trunkGroup TEAMS_IPTG ipPeer TEAMS2_IP_PEER inService inService
set global callRouting routingLabel TO_TEAMS_RL routingLabelRoute 3 trunkGroup TEAMS_IPTG ipPeer TEAMS3_IP_PEER inService inService
commit
set global callRouting routingLabel TO_PSTN1_RL routingLabelRoute 1 trunkGroup PSTN1_IPTG ipPeer PSTN1_IP_PEER inService inService
commit
# Create Route
##############################################################################
set global callRouting route trunkGroup PSTN1_IPTG VSBCSYSTEM standard Sonus_NULL Sonus_NULL all all ALL none Sonus_NULL routingLabel TO_TEAMS_RL
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM standard Sonus_NULL Sonus_NULL all all ALL none Sonus_NULL routingLabel TO_PSTN1_RL
##Below Route call needs to be defined for Call Transfer and Call Forwarding
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM standard Sonus_NULL Sonus_NULL all all ALL none sip.pstnhub.microsoft.com routingLabel TO_TEAMS_RL
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM standard Sonus_NULL Sonus_NULL all all ALL none sip2.pstnhub.microsoft.com routingLabel TO_TEAMS_RL
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM standard Sonus_NULL Sonus_NULL all all ALL none sip3.pstnhub.microsoft.com routingLabel TO_TEAMS_RL
commit
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM username Sonus_NULL Sonus_NULL all all ALL none sip.pstnhub.microsoft.com routingLabel TO_TEAMS_RL
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM username Sonus_NULL Sonus_NULL all all ALL none sip2.pstnhub.microsoft.com routingLabel TO_TEAMS_RL
set global callRouting route trunkGroup TEAMS_IPTG VSBCSYSTEM username Sonus_NULL Sonus_NULL all all ALL none sip3.pstnhub.microsoft.com routingLabel TO_TEAMS_RL
commit
#Teams outbound SMM Profile
##############################################################################
set profiles signaling sipAdaptorProfile HeaderModifications state enabled
set profiles signaling sipAdaptorProfile HeaderModifications advancedSMM disabled
set profiles signaling sipAdaptorProfile HeaderModifications profileType messageManipulation
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 applyMatchHeader one
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 1 message messageTypes requestAll
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 2 header name From
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 criterion 2 header hdrInstance all
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 operation store
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 headerInfo fieldValue
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 from type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 from value From
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 to type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 to variableValue var1
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 1 to variableScopeValue local
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 operation regpredel
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 to type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 to variableValue var1
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 regexp
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 regexp string @.*>
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 2 regexp matchInstance all
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 operation regdel
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 to type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 to variableValue var1
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 regexp
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 regexp string "(;user=phone>)|>"
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 3 regexp matchInstance all
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 operation append
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 from type value
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 from value :
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 to type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 to variableValue var1
set profiles signaling sipAdaptorProfile HeaderModifications rule 1 action 4 to variableScopeValue local
commit
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 applyMatchHeader one
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 1 message messageTypes requestAll
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 2 header name Contact
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 criterion 2 header hdrInstance all
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 operation regsub
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 headerInfo fieldValue
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 from type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 from variableValue var1
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 to type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 to value Contact
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 regexp
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 regexp string @.*:
set profiles signaling sipAdaptorProfile HeaderModifications rule 2 action 1 regexp matchInstance all
commit
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 applyMatchHeader one
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 1 message messageTypes requestAll
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 2 header name P-Preferred-Identity
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 criterion 2 header hdrInstance all
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 operation regsub
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 headerInfo fieldValue
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 from type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 from variableValue var1
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 to type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 to value P-Preferred-Identity
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 regexp
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 regexp string @.*:
set profiles signaling sipAdaptorProfile HeaderModifications rule 3 action 1 regexp matchInstance all
commit
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 1 message messageTypes request
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 1 message methodTypes invite
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 1 message condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 2 header name Request-Line
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 3 type parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 3 parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 3 parameter condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 3 parameter paramType uri
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 criterion 3 parameter name Ribbon
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 type parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 operation store
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 paramType uri
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 from type parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 from value Ribbon
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 to type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 1 to variableValue var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 type parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 operation delete
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 paramType uri
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 from type parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 from value Ribbon
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 to type parameter
set profiles signaling sipAdaptorProfile HeaderModifications rule 4 action 2 to value Ribbon
commit
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 1 message messageTypes request
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 1 message methodTypes invite
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 1 message condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 2 header name From
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 3 type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 3 variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 3 variable condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 criterion 3 variable variableID var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 type token
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 operation modify
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 from type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 from variableValue var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 to type token
set profiles signaling sipAdaptorProfile HeaderModifications rule 5 action 1 to tokenValue urihostname
commit
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 1 message messageTypes request
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 1 message methodTypes invite
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 1 message condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 2 header name Contact
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 3 type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 3 variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 3 variable condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 criterion 3 variable variableID var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 type token
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 operation modify
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 from type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 from variableValue var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 to type token
set profiles signaling sipAdaptorProfile HeaderModifications rule 6 action 1 to tokenValue urihostname
commit
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 1 type message
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 1 message
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 1 message messageTypes request
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 1 message methodTypes invite
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 1 message condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 2 type header
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 2 header
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 2 header name P-Preferred-Identity
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 3 type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 3 variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 3 variable condition exist
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 criterion 3 variable variableID var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 type token
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 operation modify
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 from
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 from type variable
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 from variableValue var2
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 to
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 to type token
set profiles signaling sipAdaptorProfile HeaderModifications rule 7 action 1 to tokenValue urihostname
commit
#Teams Inbound SMM Profile below are created to serve the following purpose:
##############################################################################
set profiles signaling sipAdaptorProfile REFER state enabled
set profiles signaling sipAdaptorProfile REFER advancedSMM disabled
set profiles signaling sipAdaptorProfile REFER profileType messageManipulation
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 1 type message
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 1 message
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 1 message messageTypes request
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 1 message methodTypes refer
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 1 message condition exist
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 2 type header
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 2 header
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 2 header name To
set profiles signaling sipAdaptorProfile REFER rule 1 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 type token
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 operation store
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 from
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 from type token
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 from tokenValue urihostname
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 to
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 to type variable
set profiles signaling sipAdaptorProfile REFER rule 1 action 1 to variableValue var1
commit
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 1 type message
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 1 message
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 1 message messageTypes request
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 1 message methodTypes refer
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 1 message condition exist
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 2 type header
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 2 header
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 2 header name Refer-To
set profiles signaling sipAdaptorProfile REFER rule 2 criterion 2 header condition exist
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 type parameter
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 operation add
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 paramType uri
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 from
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 from type variable
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 from variableValue var1
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 to
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 to type parameter
set profiles signaling sipAdaptorProfile REFER rule 2 action 1 to value Ribbon
commit
#Associate the SMM Profile to Teams TG
##############################################################################
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling messageManipulation inputAdapterProfile REFER
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling messageManipulation outputAdapterProfile HeaderModifications
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG signaling messageManipulation smmProfileExecution fixedOrder
commit
#Create Remove SDP from 183 SMM from transfer for PSTN
#############################################################################
set profiles signaling sipAdaptorProfile "SDP-REMOVE" state "enabled"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" action "1" type "messageBody" operation "regdel"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" action "1" regexp string ".*"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" action "1" to type "messageBody" messageBodyValue "all"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" criterion "1" type "message"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" criterion "1" message messageTypes "response" methodTypes "invite" statusCode "183"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" criterion "2" type "messageBody"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "1" criterion "2" messageBody condition "exist" messageBodyType "all"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" action "1" type "header" operation "regsub"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" action "1" from type "value" value "180 Ringing"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" action "1" regexp string "183 Session Progress"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" action "1" to type "header" value "SIP/2.0"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" applyMatchHeader "one"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" criterion "1" type "message"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" criterion "1" message messageTypes "response" methodTypes "invite" statusCode "183"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" criterion "2" type "header"
set profiles signaling sipAdaptorProfile "SDP-REMOVE" rule "2" criterion "2" header name "status-line" condition "exist"
commit
#Associate the SMM Profile to PSTN TG
##############################################################################
set addressContext default zone PSTN_ZONE sipTrunkGroup PSTN1_IPTG signaling messageManipulation inputAdapterProfile SDP-REMOVE
commit

#Create Tenant DM/PM Criteria
set profiles digitParameterHandling dmPmCriteria TENANT_CUSTO_0_CRITERIA digitType calledNumber parameterPresenceCheck exists digitCriteria digitMatch operation equals value startDigitPosition 0 numberOfDigits 6 matchValue 609606
commit

#Create Tenant DM/PM Rule
set profiles digitParameterHandling dmPmRule TEAMS_DMPM subRule 0 criteria TENANT_CUSTO_0_CRITERIA ruleType uri uriParameterManipulation uriType callingUri hostPortManipulation startCharacterPosition 0 numberOfCharacters 64 portNumber noChange replacement type constant value customers-eu.connxaisaas.com
commit
#Associate DM/PM Rule to Teams IPTG
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy digitParameterHandling egressDmPmRule TEAMS_DMPM


####Routing for Test From PSTN1_IPTG to ##
set profiles digitParameterHandling dmPmCriteria Remove_plus1_criteria digitType callingNumber parameterPresenceCheck exists digitCriteria digitMatch operation equals value startDigitPosition 0 numberOfDigits 2 matchValue +1

set profiles digitParameterHandling dmPmCriteria REMOVE_+1 criteriaType digit
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitType callingNumber
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 parameterPresenceCheck exists
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria egressFlag value send
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria egressFlag operation ignore
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria digitMatch value startDigitPosition 0
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria digitMatch value numberOfDigits 2
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria digitMatch value matchValue +1
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria digitMatch operation equals
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria natureOfAddress value 950
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria natureOfAddress operation ignore
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria numberingPlanIndicator value data
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria numberingPlanIndicator operation ignore
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria numberLength value 0
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria numberLength operation ignore
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria presentationMatch value none
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria presentationMatch operation ignore
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria screeningMatch value none
set profiles digitParameterHandling dmPmCriteria REMOVE_+1 digitCriteria screeningMatch operation ignore
commit
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 criteria REMOVE_+1
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 ruleType digit
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberType callingNumber
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberParameterManipulation natureOfAddress none
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberParameterManipulation numberingPlanIndicator none
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberParameterManipulation numberLength noInput
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberParameterManipulation presentation none
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberParameterManipulation screening none
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation numberParameterManipulation includeInEgress none
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation startDigitPosition 0
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation numberOfDigits 2
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation replacement type constant
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation replacement digitString callingNumber
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation replacement startDigitPosition 0
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation replacement numberOfDigits 2
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation replacement value ""
set profiles digitParameterHandling dmPmRule REMOVE_+1 subRule 0 digitManipulation digitStringManipulation action none
commit
set addressContext default zone TEAMS_ZONE sipTrunkGroup TEAMS_IPTG policy digitParameterHandling ingressDmPmRule REMOVE_+1