0
votes

I am running some tests on the freeswitch PBX on Ubuntu Precise Pangoline server. The version of the Freeswitch I am using is the one from the git repo. I added a SIP user and from a SIP phone to access the Freeswitch I keep on getting the following error message:

2013-04-22 08:34:20.146022 [CONSOLE] switch_core.c:2096
FreeSWITCH Version 1.5.1b+git~20130417T225111Z~54d47599e9 (git 54d4759 2013-04-17 22:51:11Z)

FreeSWITCH Started
Max Sessions [1000]
Session Rate [30]
SQL [Enabled]

freeswitch@moses> 2013-04-22 08:35:20.688573 [WARNING] sofia_reg.c:2621 Can't find user [[email protected]] from 192.168.125.1
You must define a domain called '192.168.125.128' in your directory and add a user with the id="1100" attribute
and you must configure your device to use the proper domain in it's authentication credentials.

These are the steps I took to create the SIP user. As stated in the freeswitch.xml in the conf directory all the config settings are supposed to be done in the vanilla folder. I went there and in the directory folder I created the user xml file by copying one of the default and changed the settings:

root@moses:/usr/local/src/freeswitch/conf/vanilla/directory/default# vim 1100.xml
<include>
  <user id="1100">
    <params>
      <param name="password" value="$${default_password}"/>
      <param name="vm-password" value="1100"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="1100"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Gwen"/>
      <variable name="effective_caller_id_number" value="1100"/>
      <variable name="outbound_caller_id_name" value="$${outbound_caller_name}"/>
      <variable name="outbound_caller_id_number" value="$${outbound_caller_id}"/>
      <variable name="callgroup" value="techsupport"/>
    </variables>
  </user>
</include>

Later on I edited the default.xml file of the dialplan folder and under Local_Extension I added the 1100 to the regular expression as follow:

root@moses:/usr/local/src/freeswitch/conf/vanilla/dialplan# vim default.xml
<?xml version="1.0" encoding="utf-8"?>
<!--
    NOTICE:

    This context is usually accessed via authenticated callers on the sip profile on port 5060
    or transfered callers from the public context which arrived via the sip profile on port 5080.

    Authenticated users will use the user_context variable on the user to determine what context
    they can access.  You can also add a user in the directory with the cidr= attribute acl.conf.xml
    will build the domains ACL using this value.
-->
<!-- http://wiki.freeswitch.org/wiki/Dialplan_XML -->
<include>
   ...................
    <extension name="Local_Extension">
      <!--<condition field="destination_number" expression="^(10[01][0-9]|1100)$"> -->
      <condition field="destination_number" expression="^1100$">
        <action application="export" data="dialed_extension=$1"/>
        <!-- bind_meta_app can have these args <key> [a|b|ab] [a|b|o|s] <app> -->
        <action application="bind_meta_app" data="1 b s execute_extension::dx XML features"/>
        <action application="bind_meta_app" data="2 b s record_session::$${recordings_dir}/${caller_id_number}.${strftime(%Y-%m-%d-%H-%M-%S)}.wav"/>
        <action application="bind_meta_app" data="3 b s execute_extension::cf XML features"/>
        <action application="bind_meta_app" data="4 b s execute_extension::att_xfer XML features"/>
        <action application="set" data="ringback=${us-ring}"/>
        <action application="set" data="transfer_ringback=$${hold_music}"/>
        <action application="set" data="call_timeout=30"/>
        <!-- <action application="set" data="sip_exclude_contact=${network_addr}"/> -->
        <action application="set" data="hangup_after_bridge=true"/>
        <!--<action application="set" data="continue_on_fail=NORMAL_TEMPORARY_FAILURE,USER_BUSY,NO_ANSWER,TIMEOUT,NO_ROUTE_DESTINATION"/> -->
        <action application="set" data="continue_on_fail=true"/>
        <action application="hash" data="insert/${domain_name}-call_return/${dialed_extension}/${caller_id_number}"/>
        <action application="hash" data="insert/${domain_name}-last_dial_ext/${dialed_extension}/${uuid}"/>
        <action application="set" data="called_party_callgroup=${user_data(${dialed_extension}@${domain_name} var callgroup)}"/>
        <action application="hash" data="insert/${domain_name}-last_dial_ext/${called_party_callgroup}/${uuid}"/>
        <action application="hash" data="insert/${domain_name}-last_dial_ext/global/${uuid}"/>
        <!--<action application="export" data="nolocal:rtp_secure_media=${user_data(${dialed_extension}@${domain_name} var rtp_secure_media)}"/>-->
        <action application="hash" data="insert/${domain_name}-last_dial/${called_party_callgroup}/${uuid}"/>
        <action application="bridge" data="user/${dialed_extension}@${domain_name}"/>
        <action application="answer"/>
        <action application="sleep" data="1000"/>
        <action application="bridge" data="loopback/app=voicemail:default ${domain_name} ${dialed_extension}"/>
      </condition>
    </extension>

    ............
</include>

I have tried all the solutions I have found by setting my local_ip_v4 in the vars.xml so far on the net but they did not work. Can someone help me?

1

1 Answers

3
votes

Your problem is that your modified regular expression no longer does a capture. Note that there are no parentheses around the 1100 to put it in the variable $1.

<condition field="destination_number" expression="^1100$">

Inside the condition XML block, the very first entry you see is this:

<action application="export" data="dialed_extension=$1"/>

The dialed_extension variable is supposed to be assigned the captured value from the expression, but since there's no capture anymore, this fails.

Instead, you can just modify the original condition block, the one you commented out, so that it also includes the 1100 series users:

<!--<condition field="destination_number" expression="^(1[01][01][0-9])$"> -->

Keep in mind you may need to disable any extension blocks that use the 1100 series to avoid conflicts.

Aside from this, if you can't make calls with the default users and default configuration, you shouldn't attempt to create users as you most likely have something else wrong.