[Freeswitch-users] Different SIP profiles for different codecs?

Ken Fulmer kenfulmer at icstechnologysolutions.com
Thu Apr 22 11:08:17 PDT 2010


Thanks, I just noticed that in the dial plan config. It works great!

 

Ken

 

From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of DJB
INTERNATIONAL
Sent: Thursday, April 22, 2010 10:32 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Different SIP profiles for different codecs?

 

 

<action application="bridge"
data="{absolute_codec_string=G729}sofia/external//$0@
<mailto:0 at 172.16.15.11> xxx.xxx.xxx.xxx"/>

 

-djbinter

On Thu, Apr 22, 2010 at 8:14 AM, Ken Fulmer
<kenfulmer at icstechnologysolutions.com> wrote:

I need the internal codec to be hardcoded to PCMU. I need the PSTN codec to
be 729, and I need to transcode between the two.

So, we have PBX (711) ---> FS (729)---> PSTN and vice versa.

If I only set the following parameters in one profile, I won't get the
necessary result:


<param name="inbound-codec-prefs" value="PCMU"/>
<param name="outbound-codec-prefs" value="G729"/>

We are routing calls through the system like a softswitch / B2BUA / SBC. We
don't have phones registering to the FS box like a PBX. We are using sipX
for that.

So, we should be able to use two profiles and set the codecs differently in
each. This is show in the following example on the dial plan page:

Example 5

In this example we will demonstrate the use of profiles when using a
FreeSWITCH endpoint that supports profiles, like mod_sofia. Assuming that we
want to use different call settings (codecs, DTMF modes, etc) for sending
the calls to different IP addresses, we can create different profiles. For
example, in the configuration of sofia.conf, we see an example profile named
"test", which we rename to profile1 for this example, and add a profile2 for
comparison:

<profile name="profile1">
 <param name="debug" value="1"/>

 <param name="rfc2833-pt" value="101"/>

 <param name="sip-port" value="5060"/>

 <param name="dialplan" value="XML"/>

 <param name="dtmf-duration" value="100"/>
 <param name="codec-prefs" value="PCMU at 20i"/>
 <param name="codec-ms" value="20"/>
 <param name="use-rtp-timer" value="true"/>
</profile>
<profile name="profile2">
 <param name="debug" value="1"/>

 <param name="rfc2833-pt" value="101"/>

 <param name="sip-port" value="5070"/>

 <param name="dialplan" value="XML"/>

 <param name="dtmf-duration" value="100"/>
 <param name="codec-prefs" value="PCMA at 20i"/>
 <param name="codec-ms" value="20"/>
 <param name="use-rtp-timer" value="true"/>
</profile>

The difference between the two profiles are in the codecs. The first uses
G.711 uLaw and the second G711 ALaw.

Continuing the examples above, we have:

<extension name="Test5ulaw">
 <condition field="network_addr" expression="^192\.168\.1\.1$"/>
 <condition field="destination_number" expression="^1(\d+)$">
   <action application="bridge" data="sofia/profile1/$0 at 192.168.2.2"/>
 </condition>
</extension>

to send the call in G.711 uLaw and

<extension name="Test5alaw">
 <condition field="network_addr" expression="^192\.168\.1\.1$"/>
 <condition field="destination_number" expression="^1(\d+)$">
   <action application="bridge" data="sofia/profile2/$0 at 192.168.2.2"/>
 </condition>
</extension>

But when we try to setup two profiles, we always get an error on one of
them.

Ken



-----Original Message-----
From: freeswitch-users-bounces at lists.freeswitch.org
[mailto:freeswitch-users-bounces at lists.freeswitch.org] On Behalf Of Steven
Ayre
Sent: Thursday, April 22, 2010 9:56 AM
To: freeswitch-users at lists.freeswitch.org
Subject: Re: [Freeswitch-users] Different SIP profiles for different codecs?

No need to have separate profiles for it, these are the two parameters
you'd want to change:
<param name="inbound-codec-prefs" value="PCMU"/>
<param name="outbound-codec-prefs" value="G729"/>

If you want to have calls coming in one one profile (e.g. internal)
and going out on another (e.g. external) you can do so. Create both
profiles (if you haven't already) and set inbound-codec-prefs on
internal and outbound-codec-prefs on external. Have the internal
profile hit the dialplan context where you have the extensions
configured and have the dialplan bridge to sofia/external/... to send
the outgoing legs through that context.

-Steve


On 22 April 2010 15:30, Ken Fulmer <kenfulmer at icstechnologysolutions.com>
wrote:
> We are using the following external sip profile:
>
>
>
> <profile name="external">
>
>   <settings>
>
>     <param name="accept-blind-auth" value="true"/>
>
>     <param name="apply-inbound-acl" value="domains"/>
>
>     <param name="debug" value="0"/>
>
>     <param name="sip-trace" value="no"/>
>
>     <param name="rfc2833-pt" value="101"/>
>
>     <param name="sip-port" value="5080"/>
>
>     <param name="dialplan" value="XML"/>
>
>     <param name="context" value="public"/>
>
>     <param name="dtmf-duration" value="2000"/>
>
>     <param name="inbound-codec-prefs" value="G729,PCMU"/>
>
>     <param name="outbound-codec-prefs" value="G729,PCMU"/>
>
>     <param name="hold-music" value="$${hold_music}"/>
>
>     <param name="rtp-timer-name" value="soft"/>
>
>     <param name="manage-presence" value="false"/>
>
>     <param name="inbound-codec-negotiation" value="generous"/>
>
>     <param name="nonce-ttl" value="60"/>
>
>     <param name="auth-calls" value="false"/>
>
>     <param name="rtp-ip" value="10.10.3.12"/>
>
>     <param name="sip-ip" value="10.10.3.12"/>
>
>     <param name="rtp-timeout-sec" value="300"/>
>
>     <param name="rtp-hold-timeout-sec" value="1800"/>
>
>     <param name="user-agent-string" value="INTEGRAL PARTNERS"/>
>
>   </settings>
>
> </profile>
>
>
>
> The dial plan "public" context has two entries, one for PSTN access and
one
> for call routing to an internal PBX.
>
>
>
> This is the dial plan for PSTN call routing:
>
>
>
> <extension name="LCL">
>
>    <condition field="destination_number" expression="^(\d{10})$">
>
>        <action application="set" data="hangup_after_bridge=true"/>
>
>        <action application="bridge"
data="sofia/external/$1 at 172.16.15.11"/>
>
>        <action application="set" data="ringback=${us-ring}"/>
>
>        <action application="set" data="ignore_early_media=true" />
>
>    </condition>
>
> </extension>
>
> <extension name="LD">
>
>    <condition field="destination_number" expression="^1(\d{10})$">
>
>        <action application="set" data="hangup_after_bridge=true"/>
>
>        <action application="bridge"
data="sofia/external/$0 at 172.16.15.11"/>
>
>        <action application="set" data="ringback=${us-ring}"/>
>
>        <action application="set" data="ignore_early_media=true" />
>
>    </condition>
>
> </extension>
>
> <extension name="911">
>
>    <condition field="destination_number" expression="^(911)$">
>
>        <action application="set" data="hangup_after_bridge=true"/>
>
>        <action application="bridge"
data="sofia/external/$1 at 172.16.15.11"/>
>
>        <action application="set" data="ringback=${us-ring}"/>
>
>        <action application="set" data="ignore_early_media=true" />
>
>    </condition>
>
> </extension>
>
> <extension name="INTL">
>
>    <condition field="destination_number" expression="^011(\d+)$">
>
>        <action application="set" data="hangup_after_bridge=true"/>
>
>        <action application="bridge"
data="sofia/external/$0 at 172.16.15.11"/>
>
>        <action application="set" data="ringback=${us-ring}"/>
>
>        <action application="set" data="ignore_early_media=true" />
>
>    </condition>
>
> </extension>
>
>
>
> And this is the entry for internal call routing to a PBX:
>
>
>
> <extension name="PBX">
>
>    <condition field="destination_number" expression="^(205314849[0-9])$">
>
>        <action application="set" data="hangup_after_bridge=true"/>
>
>        <action application="bridge"
> data="sofia/external/$1 at 10.10.3.10"|data="sofia/external/$1 at 10.10.3.11"/>
>
>        <action application="set" data="ringback=${us-ring}"/>
>
>        <action application="set" data="ignore_early_media=true"/>
>
>    </condition>
>
> </extension>
>
>
>
> So, here's my question:
>
>
>
> We'd like to be able to lock down the codec as 711 for the internal leg
> going to the PBX and 729 for the external leg to the PSTN. We have
> transcoding setup and it's working fine. How can we use two SIP profiles 
to
> hard code the codec in each direction? I've seen an example in the dial
plan
> section, but didn't understand how to implement it.
>
>
>
> Thanks,
>
>
>
> Ken Fulmer
>
>
>
> _______________________________________________
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
>

_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org


_______________________________________________
FreeSWITCH-users mailing list
FreeSWITCH-users at lists.freeswitch.org
http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
http://www.freeswitch.org

 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20100422/8cceb7b2/attachment-0001.html 


More information about the FreeSWITCH-users mailing list