如何将FreeSwitch连接到FreeSwitch?

时间:2014-10-06 08:55:09

标签: voip freeswitch

我遇到了FreeSwitch的问题。我试了几个小时,将我系统上的FreeSwitch服务器与另一个系统上的FreeSwitch服务器连接起来。但是,我想要的是用户“abc @ myip”用户“123 @ buddysIp”。我尝试的是将新的“列表”项添加到acl.conf.xml

<list name="buddy" default="deny">
      <node type="allow" cidr="hisip/32"/>
  </list>

我还尝试在conf / dialplan / default目录中添加扩展名

<include>
<extension name="outbound_calls">
    <condition field="destination_number" expression="^(.*)$">
        <action application="bridge" data="sofia/gateway/buddy/$1"/>
    </condition>
</extension>

和他的网关存储在conf / sip_profiles / buddy.xml中,看起来像这样

<include>
<gateway name="buddy">
    <param name="realm" value="hisip"/>
    <param name="username" value="myuser"/>
    <param name="password" value="mypw"/>
</gateway>

我希望有人可以帮助我。也许我忘记了什么。 我们在同一个网络中。如果您需要更多信息,请告诉我,谢谢。

这是我的通话记录:

 INVITE sip:666@myip SIP/2.0
   Via: SIP/2.0/UDP myip:51155;rport;branch=z9hG4bKPjyv0EW.k04poUhm7kdxHae5kheAypVEBc
   Max-Forwards: 70
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>
   Contact: "me" <sip:1001@myip:51155;ob>
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24074 INVITE
   Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
   Supported: replaces, 100rel, timer, norefersub
   Session-Expires: 1800
   Min-SE: 90
   User-Agent: Telephone 1.1.4
   Content-Type: application/sdp
   Content-Length:   479

   v=0
   o=- 3621578544 3621578544 IN IP4 myip
   s=pjmedia
   b=AS:84
   t=0 0
   a=X-nat:0
   m=audio 4032 RTP/AVP 103 102 104 109 3 0 8 9 101
   c=IN IP4 myip
   b=TIAS:64000
   a=rtcp:4033 IN IP4 myip
   a=sendrecv
   a=rtpmap:103 speex/16000
   a=rtpmap:102 speex/8000
   a=rtpmap:104 speex/32000
   a=rtpmap:109 iLBC/8000
   a=fmtp:109 mode=30
   a=rtpmap:3 GSM/8000
   a=rtpmap:0 PCMU/8000
   a=rtpmap:8 PCMA/8000
   a=rtpmap:9 G722/8000
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15
   ------------------------------------------------------------------------
send 382 bytes to udp/[myip]:51155 at 12:02:24.444389:
   ------------------------------------------------------------------------
   SIP/2.0 100 Trying
   Via: SIP/2.0/UDP myip:51155;rport=51155;branch=z9hG4bKPjyv0EW.k04poUhm7kdxHae5kheAypVEBc
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24074 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.4.9+git~20140929T194948Z~ae069dcca7~64bit
   Content-Length: 0

   ------------------------------------------------------------------------
2014-10-06 12:02:24.435021 [NOTICE] switch_channel.c:1055 New Channel sofia/internal/1001@myip [2b0eddac-0ad5-41b3-a9f4-eebf1a81565e]
send 884 bytes to udp/[myip]:51155 at 12:02:24.450259:
   ------------------------------------------------------------------------
   SIP/2.0 407 Proxy Authentication Required
   Via: SIP/2.0/UDP myip:51155;rport=51155;branch=z9hG4bKPjyv0EW.k04poUhm7kdxHae5kheAypVEBc
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>;tag=9Q0rj5B37FS7H
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24074 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.4.9+git~20140929T194948Z~ae069dcca7~64bit
   Accept: application/sdp
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
   Proxy-Authenticate: Digest realm="myip", nonce="72eb4930-85ce-4590-b2a2-b3420109fb4e", algorithm=MD5, qop="auth"
   Content-Length: 0

   ------------------------------------------------------------------------
recv 345 bytes from udp/[myip]:51155 at 12:02:24.450538:
   ------------------------------------------------------------------------
   ACK sip:666@myip SIP/2.0
   Via: SIP/2.0/UDP myip:51155;rport;branch=z9hG4bKPjyv0EW.k04poUhm7kdxHae5kheAypVEBc
   Max-Forwards: 70
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>;tag=9Q0rj5B37FS7H
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24074 ACK
   Content-Length:  0

   ------------------------------------------------------------------------
recv 1372 bytes from udp/[myip]:51155 at 12:02:24.450608:
   ------------------------------------------------------------------------
   INVITE sip:666@myip SIP/2.0
   Via: SIP/2.0/UDP myip:51155;rport;branch=z9hG4bKPjdQcDT3A-9MHF6CkHL-i9ocmvZjxVxGnD
   Max-Forwards: 70
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>
   Contact: "me" <sip:1001@myip:51155;ob>
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24075 INVITE
   Allow: PRACK, INVITE, ACK, BYE, CANCEL, UPDATE, INFO, SUBSCRIBE, NOTIFY, REFER, MESSAGE, OPTIONS
   Supported: replaces, 100rel, timer, norefersub
   Session-Expires: 1800
   Min-SE: 90
   User-Agent: Telephone 1.1.4
   Proxy-Authorization: Digest username="1001", realm="myip", nonce="72eb4930-85ce-4590-b2a2-b3420109fb4e", uri="sip:666@myip", response="1220921ada500668b903722228634e1a", algorithm=MD5, cnonce="P1gGhwXHyrEHo1zMDrBEk3ryp1uKHbaK", qop=auth, nc=00000001
   Content-Type: application/sdp
   Content-Length:   479

   v=0
   o=- 3621578544 3621578544 IN IP4 myip
   s=pjmedia
   b=AS:84
   t=0 0
   a=X-nat:0
   m=audio 4032 RTP/AVP 103 102 104 109 3 0 8 9 101
   c=IN IP4 myip
   b=TIAS:64000
   a=rtcp:4033 IN IP4 myip
   a=sendrecv
   a=rtpmap:103 speex/16000
   a=rtpmap:102 speex/8000
   a=rtpmap:104 speex/32000
   a=rtpmap:109 iLBC/8000
   a=fmtp:109 mode=30
   a=rtpmap:3 GSM/8000
   a=rtpmap:0 PCMU/8000
   a=rtpmap:8 PCMA/8000
   a=rtpmap:9 G722/8000
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-15
   ------------------------------------------------------------------------
send 382 bytes to udp/[myip]:51155 at 12:02:24.450830:
   ------------------------------------------------------------------------
   SIP/2.0 100 Trying
   Via: SIP/2.0/UDP myip:51155;rport=51155;branch=z9hG4bKPjdQcDT3A-9MHF6CkHL-i9ocmvZjxVxGnD
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24075 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.4.9+git~20140929T194948Z~ae069dcca7~64bit
   Content-Length: 0

   ------------------------------------------------------------------------
2014-10-06 12:02:24.484827 [INFO] mod_dialplan_xml.c:558 Processing me <1001>->666 in context default
2014-10-06 12:02:24.484827 [CRIT] mod_dptools.c:1628 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2014-10-06 12:02:24.484827 [CRIT] mod_dptools.c:1628 Open /usr/local/freeswitch/conf/vars.xml and change the default_password.
2014-10-06 12:02:24.484827 [CRIT] mod_dptools.c:1628 Once changed type 'reloadxml' at the console.
2014-10-06 12:02:24.495177 [CRIT] mod_dptools.c:1628 WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING WARNING
2014-10-06 12:02:34.854471 [NOTICE] switch_channel.c:1055 New Channel sofia/external/666 [3bc1a418-d55d-4dab-863b-9742ec0ae187]
send 1113 bytes to udp/[buddyip]:5060 at 12:02:34.865554:
   ------------------------------------------------------------------------
   INVITE sip:666@buddyip SIP/2.0
   Via: SIP/2.0/UDP myip:5080;rport;branch=z9hG4bK94rXNDv8U6KDg
   Max-Forwards: 69
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958813 INVITE
   Contact: <sip:gw+amr@myip:5080;transport=udp;gw=amr>
   User-Agent: FreeSWITCH-mod_sofia/1.4.9+git~20140929T194948Z~ae069dcca7~64bit
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, refer
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 292
   X-FS-Support: update_display,send_info
   Remote-Party-ID: "Extension 1001" <sip:2706446@buddyip>;party=calling;screen=yes;privacy=off

   v=0
   o=FreeSWITCH 1412565842 1412565843 IN IP4 myip
   s=FreeSWITCH
   c=IN IP4 myip
   t=0 0
   m=audio 23912 RTP/AVP 3 0 8 9 101 13
   a=rtpmap:3 GSM/8000
   a=rtpmap:0 PCMU/8000
   a=rtpmap:8 PCMA/8000
   a=rtpmap:9 G722/8000
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-16
   a=ptime:20
   ------------------------------------------------------------------------
recv 363 bytes from udp/[buddyip]:5060 at 12:02:34.867644:
   ------------------------------------------------------------------------
   SIP/2.0 100 Trying
   Via: SIP/2.0/UDP myip:5080;rport=5080;branch=z9hG4bK94rXNDv8U6KDg
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958813 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.5.14b+git~20141001T023048Z~a39db86863~64bit
   Content-Length: 0

   ------------------------------------------------------------------------
recv 865 bytes from udp/[buddyip]:5060 at 12:02:34.869949:
   ------------------------------------------------------------------------
   SIP/2.0 407 Proxy Authentication Required
   Via: SIP/2.0/UDP myip:5080;rport=5080;branch=z9hG4bK94rXNDv8U6KDg
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>;tag=ytX68BX46p4Kp
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958813 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.5.14b+git~20141001T023048Z~a39db86863~64bit
   Accept: application/sdp
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
   Proxy-Authenticate: Digest realm="buddyip", nonce="56db4231-66c0-4603-bec6-7d6fb163a011", algorithm=MD5, qop="auth"
   Content-Length: 0

   ------------------------------------------------------------------------
send 324 bytes to udp/[buddyip]:5060 at 12:02:34.870119:
   ------------------------------------------------------------------------
   ACK sip:666@buddyip SIP/2.0
   Via: SIP/2.0/UDP myip:5080;rport;branch=z9hG4bK94rXNDv8U6KDg
   Max-Forwards: 69
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>;tag=ytX68BX46p4Kp
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958813 ACK
   Content-Length: 0

   ------------------------------------------------------------------------
send 1389 bytes to udp/[buddyip]:5060 at 12:02:34.882192:
   ------------------------------------------------------------------------
   INVITE sip:666@buddyip SIP/2.0
   Via: SIP/2.0/UDP myip:5080;rport;branch=z9hG4bKaejpQ8ccSFa0B
   Max-Forwards: 69
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958814 INVITE
   Contact: <sip:gw+amr@myip:5080;transport=udp;gw=amr>
   Expires: 3600
   User-Agent: FreeSWITCH-mod_sofia/1.4.9+git~20140929T194948Z~ae069dcca7~64bit
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, refer
   Proxy-Authorization: Digest username="FreeSWITCH", realm="buddyip", nonce="56db4231-66c0-4603-bec6-7d6fb163a011", cnonce="vGWirMfiEjKJDk184GBbsg", algorithm=MD5, uri="sip:666@buddyip", response="9455fd51fcf3ce264eb85a35fd311f23", qop=auth, nc=00000001
   Content-Type: application/sdp
   Content-Disposition: session
   Content-Length: 292
   X-FS-Support: update_display,send_info
   Remote-Party-ID: "Extension 1001" <sip:2706446@buddyip>;party=calling;screen=yes;privacy=off

   v=0
   o=FreeSWITCH 1412565842 1412565843 IN IP4 myip
   s=FreeSWITCH
   c=IN IP4 myip
   t=0 0
   m=audio 23912 RTP/AVP 3 0 8 9 101 13
   a=rtpmap:3 GSM/8000
   a=rtpmap:0 PCMU/8000
   a=rtpmap:8 PCMA/8000
   a=rtpmap:9 G722/8000
   a=rtpmap:101 telephone-event/8000
   a=fmtp:101 0-16
   a=ptime:20
   ------------------------------------------------------------------------
recv 363 bytes from udp/[buddyip]:5060 at 12:02:34.883681:
   ------------------------------------------------------------------------
   SIP/2.0 100 Trying
   Via: SIP/2.0/UDP myip:5080;rport=5080;branch=z9hG4bKaejpQ8ccSFa0B
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958814 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.5.14b+git~20141001T023048Z~a39db86863~64bit
   Content-Length: 0

   ------------------------------------------------------------------------
recv 724 bytes from udp/[buddyip]:5060 at 12:02:34.891400:
   ------------------------------------------------------------------------
   SIP/2.0 403 Forbidden
   Via: SIP/2.0/UDP myip:5080;rport=5080;branch=z9hG4bKaejpQ8ccSFa0B
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>;tag=Z3pZa7D83Zt6H
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958814 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.5.14b+git~20141001T023048Z~a39db86863~64bit
   Accept: application/sdp
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
   Content-Length: 0

   ------------------------------------------------------------------------
send 324 bytes to udp/[buddyip]:5060 at 12:02:34.891596:
   ------------------------------------------------------------------------
   ACK sip:666@buddyip SIP/2.0
   Via: SIP/2.0/UDP myip:5080;rport;branch=z9hG4bKaejpQ8ccSFa0B
   Max-Forwards: 69
   From: "Extension 1001" <sip:FreeSWITCH@buddyip>;tag=2N77KS1Ke6gpN
   To: <sip:666@buddyip>;tag=Z3pZa7D83Zt6H
   Call-ID: bc64e628-c7e2-1232-0e89-4d7ce0605bb2
   CSeq: 65958814 ACK
   Content-Length: 0

   ------------------------------------------------------------------------
2014-10-06 12:02:34.884694 [NOTICE] sofia.c:7306 Hangup sofia/external/666 [CS_CONSUME_MEDIA] [CALL_REJECTED]
2014-10-06 12:02:34.899162 [INFO] mod_dptools.c:3234 Originate Failed.  Cause: CALL_REJECTED
2014-10-06 12:02:34.899162 [NOTICE] switch_channel.c:4685 Hangup sofia/internal/1001@myip [CS_EXECUTE] [CALL_REJECTED]
send 888 bytes to udp/[myip]:51155 at 12:02:34.910248:
   ------------------------------------------------------------------------
   SIP/2.0 403 Forbidden
   Via: SIP/2.0/UDP myip:51155;rport=51155;branch=z9hG4bKPjdQcDT3A-9MHF6CkHL-i9ocmvZjxVxGnD
   Max-Forwards: 70
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>;tag=a1SHm0v64rFtD
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24075 INVITE
   User-Agent: FreeSWITCH-mod_sofia/1.4.9+git~20140929T194948Z~ae069dcca7~64bit
   Accept: application/sdp
   Allow: INVITE, ACK, BYE, CANCEL, OPTIONS, MESSAGE, INFO, UPDATE, REGISTER, REFER, NOTIFY, PUBLISH, SUBSCRIBE
   Supported: timer, path, replaces
   Allow-Events: talk, hold, conference, presence, as-feature-event, dialog, line-seize, call-info, sla, include-session-description, presence.winfo, message-summary, refer
   Reason: Q.850;cause=21;text="CALL_REJECTED"
   Content-Length: 0
   Remote-Party-ID: "666" <sip:666@myip>;party=calling;privacy=off;screen=no

   ------------------------------------------------------------------------
recv 345 bytes from udp/[myip]:51155 at 12:02:34.910602:
   ------------------------------------------------------------------------
   ACK sip:666@myip SIP/2.0
   Via: SIP/2.0/UDP myip:51155;rport;branch=z9hG4bKPjdQcDT3A-9MHF6CkHL-i9ocmvZjxVxGnD
   Max-Forwards: 70
   From: "me" <sip:1001@myip>;tag=Hd47q6ldQvMGLJO5RcMsO4AJQwWmRU28
   To: <sip:666@myip>;tag=a1SHm0v64rFtD
   Call-ID: WW8ZDSQvHKuKTSjTJTX.hiefO6liAh7W
   CSeq: 24075 ACK
   Content-Length:  0

   ------------------------------------------------------------------------
2014-10-06 12:02:34.914727 [NOTICE] switch_core_session.c:1633 Session 28 (sofia/external/666) Ended
2014-10-06 12:02:34.914727 [NOTICE] switch_core_session.c:1637 Close Channel sofia/external/666 [CS_DESTROY]
2014-10-06 12:02:34.945164 [NOTICE] switch_core_session.c:1633 Session 27 (sofia/internal/1001@myip) Ended
2014-10-06 12:02:34.945164 [NOTICE] switch_core_session.c:1637 Close Channel sofia/internal/1001@myip [CS_DESTROY]

2 个答案:

答案 0 :(得分:4)

知道了。我在sip_profiles / external / mygateway.xml中创建了一个看起来像

的网关
<include>
    <gateway name="buddygateway">
        <param name="proxy" value="buddyip"/>
        <param name="register" value="false"/>
        <param name="caller-id-in-from" value="true"/> <!--Most gateways seem to want this-->
    </gateway>
</include>

并在dialplan / default / outbound_calls.xml中创建了一个出站扩展,如下所示:

<include>
    <extension name="outbound_calls">
        <condition field="destination_number" expression="^BUDDYPREFIX(\d*)$">
            <action application="bridge" data="sofia/gateway/buddygateway/$1"/>
        </condition>
    </extension>
</include>

所以我现在调用的每个号码都以BUDDYPREFIX调用远程服务器上的号码开始。

感谢您的回答:)希望这会对某人有所帮助。

答案 1 :(得分:0)

您可以将呼叫发送到“外部”SIP配置文件(端口5080),然后它将不会被验证。然后,您需要在公共上下文中使用dialplan规则来处理此类调用。或者,您可以通过显式指定绑定IP地址来创建新的配置文件并将其附加到不同的UDP端口,甚至连接到特定的以太网端口。

在您提供的日志中,看起来呼叫已落在端口51155上。是否有特殊的SIP配置文件连接到该端口?如果是这样,可能需要在该配置文件上禁​​用身份验证。

但总的来说,您需要订购几个小时的咨询服务,以便专家解释您的工作方式。如果需要,我也可以这样做。