无法让 freeswitch 将呼叫重定向回 kamailio

无法让 freeswitch 将呼叫重定向回 kamailio

背景信息:

我正在尝试按照此处的教程进行操作: http://kb.asipto.com/freeswitch:kamailio-3.3.x-freeswitch-1.2.x-sbc

基本设置如下:

  • 两部 Polycom 电话(192.168.1.100 和 192.168.1.102)
  • 处理注册和用户位置的 Kamailio 服务器 (192.168.1.101)
  • 负责视频邮件、电话会议等的 Freeswitch 服务器 (192.168.1.111)

问题:

坏消息是,当我尝试从 999 拨打分机 888 或反之时,它不起作用。我听到忙音,尽管两部电话都在线。(值得一提的是,电话会议有效)

代码/配置:

这是默认容器/开箱即用的拨号计划中的部分,已添加以支持我的配置”

<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}/[email protected]"/>
              <action application="answer"/>
              <action application="voicemail" data="default ${domain_name} $1"/>
  </condition>
</extension>

这是我的 acl.conf.xml 的部分内容:(请注意,我添加了我的 Kam 服务器的 IP 地址……不确定这是否是我应该做的,或者添加我的 freeswitch 服务器的地址)

<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>

这是公共图表(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>

我目前所做的/调试信息

在我的 kamailio 服务器(端口 5060)上使用 tcpdump,我可以看到呼叫确实到达了 freeswitch。但 freeswitch 不会将呼叫发送回代理,然后再发送回电话。它返回以下 sip 消息:

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:[email protected]>;tag=C73F8AE1-87260556
   To: <sip:[email protected];user=phone>;tag=KB5jNeBv3ZmaQ
   Call-ID: [email protected]
   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

当我查看 freeswitch 客户端中的调试数据时,我看到了以下内容:此呼叫:(仅发布了关键项目)

2014-03-26 17:02:31.825479 [NOTICE] switch_channel.c:1053 New Channel sofia/external/[email protected] [f284cfd6-b529-11e3-aa7f-35418c26e85f]
2014-03-26 17:02:31.825479 [DEBUG] switch_channel.c:2177 (sofia/external/[email protected]) Callstate Change DOWN -> RINGING
2014-03-26 17:02:31.825479 [DEBUG] switch_core_state_machine.c:523 (sofia/external/[email protected]) State ROUTING
2014-03-26 17:02:31.825479 [DEBUG] mod_sofia.c:123 sofia/external/[email protected] SOFIA ROUTING
2014-03-26 17:02:31.825479 [DEBUG] switch_core_state_machine.c:164 sofia/external/[email protected] 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/[email protected] parsing [public->unloop] continue=false
Dialplan: sofia/external/[email protected] Regex (PASS) [unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false
Dialplan: sofia/external/[email protected] Regex (PASS) [from_kamailio] network_addr(192.168.1.101) =~ /^192\.168\.1\.101$/ break=on-false
Dialplan: sofia/external/[email protected] Regex (PASS) [from_kamailio] destination_number(kb-888) =~ /^(.+)$/ break=on-false
Dialplan: sofia/external/[email protected] Action transfer(888 XML default) 
2014-03-26 17:02:31.825479 [NOTICE] switch_ivr.c:1837 Transfer sofia/external/[email protected] 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/[email protected] to enum[888@default]
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:530 (sofia/external/[email protected]) State EXECUTE going to sleep
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:467 (sofia/external/[email protected]) Running State Change CS_ROUTING
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:523 (sofia/external/[email protected]) State ROUTING
2014-03-26 17:02:31.845470 [DEBUG] mod_sofia.c:123 sofia/external/[email protected] SOFIA ROUTING
2014-03-26 17:02:31.845470 [DEBUG] switch_core_state_machine.c:164 sofia/external/[email protected] 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/[email protected] 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/[email protected] [CS_EXECUTE] [NORMAL_CLEARING]

然后它显示 SIP 暂时不可用错误消息。

我尝试按照教程操作,但不起作用。如有任何建议,我将不胜感激。谢谢。

编辑1

我不知道为什么这种解决方法有效......但我发现像这样改变拨号计划可以解决问题:

<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}/[email protected]"/>-->
              <action application="bridge" data="sofia/external/[email protected]"/>
              <action application="answer"/>
              <action application="voicemail" data="default ${domain_name} $1"/>
  </condition>
</extension>

请注意,我已删除变量 $${domain} 并将其硬编码为“external”。现在我的扩展之间的调用可以正常工作。我不知道为什么会这样,但我目前正在寻找域变量的定义位置。

相关内容