1

Background Information:

I'm trying to follow the tutorial found here: http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc

The basic set up is as follows:

  • Two Polycom phones (192.168.1.100 and 192.168.1.102)
  • A Kamailio server (192.168.1.101) that handles registrations and user location
  • A Freeswitch server (192.168.1.111) that takes care of vmail, conference calls etc

Problem:

The bad news is that when i try to call ext 888 from 999 or vice versa, it doesn't work. i get a busy signal, even though both phones are online. (for what it's worth conference calling works)

Code / Configuration:

Here's the section in the default container / out of the box dialplan that was added to support my configuration"

<extension name="kbridge">
  <condition field="destination_number" expression="^(.+)$">
              <action application="set" data="proxy_media=true"/>
              <action application="set" data="call_timeout=50"/>
              <action application="set" data="continue_on_fail=true"/>
              <action application="set" data="hangup_after_bridge=true"/>
              <action application="set" data="sip_invite_domain=192.168.1.111"/>
              <action application="export" data="sip_contact_user=ufs"/>
              <action application="bridge" data="sofia/$${domain}/$1@192.168.1.101"/>
              <action application="answer"/>
              <action application="voicemail" data="default ${domain_name} $1"/>
  </condition>
</extension>

This is what my acl.conf.xml looks like in part: (notice i've added my Kam server's IP address... not sure if thats what I was supposed to do, or add the address of my freeswitch server)

<list name="domains" default="deny">
  <!-- domain= is special it scans the domain from the directory to build the ACL -->
  <node type="allow" domain="$${domain}"/>
  <!-- use cidr= if you wish to allow ip ranges to this domains acl. -->
  <node type="allow" cidr="192.168.1.101"/> 
  <node type="allow" cidr="192.168.1.111"/> 
</list>

and here's the public diaplan (public.xml)

   <extension name="from_kamailio">
      <condition field="network_addr" expression="^192\.168\.1\.101$" />
        <condition field="destination_number" expression="^(.+)$">
        <action application="transfer" data="$1 XML default"/>
      </condition>
    </extension>

What I've done so far / Debug Information

Using tcpdump on my kamailio server, port 5060, i can see that the calls do make it to freeswitch. But freeswitch doesn't send the call back through to the proxy, and then to the phone. It returns the following sip message:

SIP/2.0 480 Temporarily Unavailable
   Via: SIP/2.0/UDP 192.168.1.101;branch=z9hG4bK15fa.79754276.0
   Via: SIP/2.0/UDP 192.168.1.102;branch=z9hG4bKb403de76A8D7964
   Max-Forwards: 14
   From: "999" <sip:999@192.168.1.101>;tag=C73F8AE1-87260556
   To: <sip:888@192.168.1.101;user=phone>;tag=KB5jNeBv3ZmaQ
   Call-ID: 9d6ef05d-961b3422-62f8efc3@192.168.1.102
   CSeq: 1 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.5.12b+git~20140320T233219Z~dd242f3ba6~32bit
   Accept: application/sdp
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, refer
   Reason: Q.850;cause=16;text="NORMAL_CLEARING"
   Content-Length: 0
   Remote-Party-ID: "888" <888>;party=calling;privacy=off;screen=no

when i take a look at the debug data in the freeswitch client, this is what I see re: this call: (only key items posted)

2014-03-26 17:02:31.825479 [NOTICE] switch_channel.c:1053 New Channel sofia/external/999@192.168.1.101 [f284cfd6-b529-11e3-aa7f-35418c26e85f]
2014-03-26 17:02:31.825479 [DEBUG] switch_channel.c:2177 (sofia/external/999@192.168.1.101) Callstate Change DOWN -> RINGING
2014-03-26 17:02:31.825479 [DEBUG] switch_core_state_machine.c:523 (sofia/external/999@192.168.1.101) State ROUTING
2014-03-26 17:02:31.825479 [DEBUG] mod_sofia.c:123 sofia/external/999@192.168.1.101 SOFIA ROUTING
2014-03-26 17:02:31.825479 [DEBUG] switch_core_state_machine.c:164 sofia/external/999@192.168.1.101 Standard ROUTING
2014-03-26 17:02:31.825479 [INFO] mod_dialplan_xml.c:558 Processing 999 <999>->888 in context public
Dialplan: sofia/external/999@192.168.1.101 parsing [public->unloop] continue=false
Dialplan: sofia/external/999@192.168.1.101 Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false
Dialplan: sofia/external/999@192.168.1.101 Regex (PASS) [from_kamailio] network_addr(192.168.1.101) =~ /^192\.168\.1\.101$/ break=on-false
Dialplan: sofia/external/999@192.168.1.101 Regex (PASS) [from_kamailio] destination_number(kb-888) =~ /^(.+)$/ break=on-false
Dialplan: sofia/external/999@192.168.1.101 Action transfer(888 XML default) 
2014-03-26 17:02:31.825479 [NOTICE] switch_ivr.c:1837 Transfer sofia/external/999@192.168.1.101 to XML[888@default]
2014-03-26 17:02:31.825479 [INFO] mod_dialplan_xml.c:558 Processing 999 <999>->888 in context default
2014-03-26 17:02:31.845470 [NOTICE] switch_ivr.c:1837 Transfer sofia/external/999@192.168.1.101 to enum[888@default]
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:530 (sofia/external/999@192.168.1.101) State EXECUTE going to sleep
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:467 (sofia/external/999@192.168.1.101) Running State Change CS_ROUTING
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:523 (sofia/external/999@192.168.1.101) State ROUTING
2014-03-26 17:02:31.845470 [DEBUG] mod_sofia.c:123 sofia/external/999@192.168.1.101 SOFIA ROUTING
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:164 sofia/external/999@192.168.1.101 Standard ROUTING
2014-03-26 17:02:31.845470 [DEBUG] mod_enum.c:642 ENUM Lookup on kb-888
2014-03-26 17:02:31.845470 [DEBUG] mod_enum.c:494 No Nameservers specified, using host default
2014-03-26 17:02:32.005525 [NOTICE] switch_core_state_machine.c:313 sofia/external/999@192.168.1.101 has executed the last dialplan instruction, hanging up.
2014-03-26 17:02:32.005525 [NOTICE] switch_core_state_machine.c:315 Hangup sofia/external/999@192.168.1.101 [CS_EXECUTE] [NORMAL_CLEARING]

Then it shows the SIP temporarily unavailable error message.

I've tried to follow the tutorial to the T .. But it's not working. Any suggestions would be appreciated. Thanks.

EDIT 1

I don't know why this workaround works... but I've found that changing the dialplan like so fixes the issue:

<extension name="kbridge">
  <condition field="destination_number" expression="^(.+)$">
              <action application="set" data="proxy_media=true"/>
              <action application="set" data="call_timeout=50"/>
              <action application="set" data="continue_on_fail=true"/>
              <action application="set" data="hangup_after_bridge=true"/>
              <action application="set" data="sip_invite_domain=192.168.1.111"/>
              <action application="export" data="sip_contact_user=ufs"/>
              <!--<action application="bridge" data="sofia/$${domain}/$1@192.168.1.101"/>-->
              <action application="bridge" data="sofia/external/$1@192.168.1.101"/>
              <action application="answer"/>
              <action application="voicemail" data="default ${domain_name} $1"/>
  </condition>
</extension>

Notice that I've removed the variable $${domain} and have hardcoded it to "external". Now my calls between extensions works. I don't know why this is the case but I'm currently looking to find out where the domain variable is defined.

dot
  • 187
  • 1
  • 3
  • 11

0 Answers0