Make FreeSWITCH alphanumeric Users not case sensitive

If you come from kamailio and transfer your setup to FreeSWITCH as SBC you can run into trouble cos kamailio is not case sensitive but FS is.

So sip:user1@FS-Box is not the same as sip:UsEr1@FS-Box.
Here is a solution to fix that and make FreeSWITCH not case sensitive.

First your directory/default/user1.xml needs to force the sipusername to lowercase. sip-force-user did the trick for us. Here an Example:

<include>
  <user id="user1">
    <params>
      <param name="password" value="secretpass"/>
    </params>
    <variables>
      <variable name="sip-force-user" value=user1"/>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="user1"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="user1/>
      <variable name="effective_caller_id_number" value="user1"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
    </variables>
  </user>
</include>

Then your dialplan extension should match User1 or user1 or UsEr1 – (?i) mades the condition match incasesensitve for you. For example dialplan/default/user1.xml. Hardwired is the lowercase dialed_extension – so it matches with the lowercase registration.

<extension name="user1">
    <condition field="destination_number" expression="^(?i)(user1)$">
        <action application="export" data="dialed_extension=user1"/>
        <action application="set" data="ringback=${de-ring}"/>
        <action application="set" data="transfer_ringback=$${de-ring}"/>
        <action application="set" data="hangup_after_bridge=true"/>
        <action application="set" data="continue_on_fail=false"/>
        <action application="bridge" data="sofia/external/${dialed_extension}%${domain_name}"/> 
      </condition>
</extension>

Thats all. Alternativ you can use in the sip_profile the option
<param name=“inbound-reg-force-matching-username“ value=“true“/>
That force Contact must match Username on register. Tested with FS 1.2.1

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.