How to block codecs in dial plans? *SOLVED*
Moderator: Brekeke Support Team
How to block codecs in dial plans? *SOLVED*
1. Brekeke Product Name and version:
Sip Server 2.x|3.x
2. Java version:
Any
3. OS type and the version:
Any
4. UA (phone), gateway or other hardware/software involved:
N/A
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :
Any
6. Your problem:
In the dial-plan, how do you block codecs that are unsupported like GSM so they are not passed through the proxy?
Thank you!
Kent C.
Sip Server 2.x|3.x
2. Java version:
Any
3. OS type and the version:
Any
4. UA (phone), gateway or other hardware/software involved:
N/A
5. Select your network pattern from http://www.brekeke-sip.com/bbs/network/ ... terns.html :
Any
6. Your problem:
In the dial-plan, how do you block codecs that are unsupported like GSM so they are not passed through the proxy?
Thank you!
Kent C.
Last edited by KentC on Tue Sep 18, 2012 3:38 pm, edited 3 times in total.
Use $body in the Matching Pattern.
If a SDP indicates GSM (3 is GMS's payloadtype), the above $body matches.
Code: Select all
$body( "(m=audio .+ RTP/AVP.* 3 )" ) = .+
Refer to the following page. Is is the list of codec payload types.
http://www.iana.org/assignments/rtp-par ... rameters-1
http://www.iana.org/assignments/rtp-par ... rameters-1
Matching Patterns:
$addr=*\.*\.*\.*
$request=INVITE
$body=( "(m=audio .+ RTP/AVP.* 3 )" ) = .+
From=sip:(.+)@
Deploy Patterns:
From=sip:(.+)@ To=sip:210xxxxxxx@IP
$rtp=true
When i add the $body, the call fails pretty fast.
I did run a trace and that blocked the call all together. I will test to a different term and see if that works. Does the plan above look ok?
When I remove that $body, call completes.
This is traveling like this:
Orig Carrier > Carrier Proxy > Our Proxy > Term Carrier
I have it configured to go through both proxies. Any additional help is appreciated.
$addr=*\.*\.*\.*
$request=INVITE
$body=( "(m=audio .+ RTP/AVP.* 3 )" ) = .+
From=sip:(.+)@
Deploy Patterns:
From=sip:(.+)@ To=sip:210xxxxxxx@IP
$rtp=true
When i add the $body, the call fails pretty fast.
I did run a trace and that blocked the call all together. I will test to a different term and see if that works. Does the plan above look ok?
When I remove that $body, call completes.
This is traveling like this:
Orig Carrier > Carrier Proxy > Our Proxy > Term Carrier
I have it configured to go through both proxies. Any additional help is appreciated.
Hey, I retested and found it was taking another rule that was working. I disabled the rule and now those that I thought with that codec that would work aren't.
Can you please advise what else could be the issue.
I tried with a second DID i have configured that works no problem with that code added and it also fails. Any helps is greatly debted. Thank you.
EDIT - When I did a pcap, it's showing '404' not found with that $body string text placed.
Kent C.
Can you please advise what else could be the issue.
I tried with a second DID i have configured that works no problem with that code added and it also fails. Any helps is greatly debted. Thank you.
EDIT - When I did a pcap, it's showing '404' not found with that $body string text placed.
Kent C.
Code: Select all
Matching Pattern:
$addr=*\.*\.*\.*
$request=INVITE
$body( "(m=audio .+ RTP/AVP.* 3 )" )=.+
From=sip:(.+)@
Deploy Pattern:
To=sip:2102023212@*.*.*.*
$rtp=true
Code: Select all
Here is the filter I ran in wireshark:
sdp.media == "audio 17882 RTP/AVP 18 0 8 101"
Media Description, name and address (m): audio 17882 RTP/AVP 18 0 8 101
Media Type: audio
Media Port: 17882
Media Protocol: RTP/AVP
Media Format: ITU-T G.729
Media Format: ITU-T G.711 PCMU
Media Format: ITU-T G.711 PCMA
Last edited by KentC on Tue Sep 18, 2012 11:01 am, edited 1 time in total.
Tested with your advice and now the call completes. Does that look right to block G.729? Where can i see if its blocked? Would it show that it's actually blocked on Brekeke or just the INVITE SDP of the trace pcap? I didn't see where to find that.
Code: Select all
$addr=*
$request=INVITE
From=sip:(.+)@
$body( "(m=audio .+ RTP/AVP.* 18 )" )=.+
Yes. the payload type 18 means G729.
(See http://www.iana.org/assignments/rtp-par ... rameters-1)
> Where can i see if its blocked?
If the above rule matches, its Deploy Patterns will be executed.
If you want to debug DialPlan rules, I recommend that you use brekeke v3 because it has DialPlan History feature.
(See http://www.iana.org/assignments/rtp-par ... rameters-1)
> Where can i see if its blocked?
If the above rule matches, its Deploy Patterns will be executed.
If you want to debug DialPlan rules, I recommend that you use brekeke v3 because it has DialPlan History feature.