[Freeswitch-users] Enable sip communication between two Freeswitch servers

Gregory Charles gregory.charles at sogeti.com
Thu Jul 30 00:51:34 PDT 2009



   Hello world,

   I have two freeswitch servers that I want to interconnect. Each one  
of them has their own sip domain and we want to enable sip  
communications between them. All the PC can ping together.

   Client #1 ------- Freeswitch #1 --(gateway)--- Freeswitch #2 ------  
Client# 2.

   We have configured a sip gateway on Freeswitch #1 server with the  
configuration below:

   C:\Program Files\FreeSWITCH\conf\sip_profiles\external\gw.xml

   <include>
  <gateway name="gw">                                              
  <param name="username" value="3000"/>
  <param name="realm" value="192.168.2.10"/>
  <param name="from-domain" value="192.168.2.10"/>
  <param name="password" value="2009"/>
  <param name="expire-seconds" value="3600"/>
  <param name="register-transport" value="udp"/>
  <param name="retry-seconds" value="30"/>
  <param name="ping" value="25"/>
  </gateway>
</include>

   C:\Program Files\FreeSWITCH\conf\dialplan\default\01_example.com.xml

   <include>

   <extension name="gw">
  <!--<condition field="${toll_allow}" expression="gw"/>  -->
  <condition field="destination_number" expression="^(30[0-2][0-9])$">
    <action application="bridge" data="sofia/gateway/gw/$1 at 192.168.2.10"/[1]>
  </condition>
</extension>

   </include>

   In the Freeswitch #2 server, we have configured the 3000 extension:

   C:\Program Files\FreeSWITCH\conf\directory\default\3000.xml

   <include>
  <user id="3000" mailbox="3000">
    <params>
      <param name="password" value="1234"/>
      <param name="vm-password" value="1000"/>
    </params>
    <variables>
      <variable name="toll_allow" value="domestic,international,local"/>
      <variable name="accountcode" value="3000"/>
      <variable name="user_context" value="default"/>
      <variable name="effective_caller_id_name" value="Extension 3000"/>
      <variable name="effective_caller_id_number" value="3000"/>
      <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>

   We have our gateway working.

   >>sofia status gateway gw

   But we can't do a call between client#1 and client#2.

    
=================================================================================================
Name            gw
Scheme          Digest
Realm           10.0.2.10
Username        3000
Password        yes
From            <sip:3000 at 192.168.2.10;transport=udp>
Contact         <sip:gw+gw at 192.168.1.10:5080;transport=udp>
Exten           3000
To              sip:3000 at 192.168.2.10
Proxy           sip:192.168.2.10
Context         public
Expires         3600
Freq            3600
Ping            1248881849
PingFreq        25
State           REGED
Status          UP
CallsIN         0
CallsOUT        19
=================================================================================================

   We have the following debug when we make a call.

   2009-07-29 17:19:52 [DEBUG] sofia_glue.c:2566  
sofia_glue_negotiate_sdp() Set 2833 dtmf payload to 101

   2009-07-29 17:19:52 [DEBUG] sofia.c:2962 sofia_handle_sip_i_state()  
(sofia/internal/1311 at 192.168.1.10) State Change CS_NEW -> CS_INIT

   2009-07-29 17:19:52 [DEBUG] switch_core_session.c:868  
switch_core_session_signal_state_change() Send signal  
sofia/internal/1311 at 192.168.1.10 [BREAK]

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:390  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) Running  
State Change CS_INIT

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:469  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) State INIT

   2009-07-29 17:19:52 [DEBUG] mod_sofia.c:83 sofia_on_init()  
sofia/internal/1311 at 192.168.1.10 SOFIA INIT

   2009-07-29 17:19:52 [DEBUG] mod_sofia.c:111 sofia_on_init()  
(sofia/internal/1311 at 192.168.1.10) State Change CS_INIT -> CS_ROUTING

   2009-07-29 17:19:52 [DEBUG] switch_core_session.c:868  
switch_core_session_signal_state_change() Send signal  
sofia/internal/1311 at 192.168.1.10 [BREAK]

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:469  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) State  
INIT going to sleep

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:390  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) Running  
State Change CS_ROUTING

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:472  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) State  
ROUTING

   2009-07-29 17:19:52 [DEBUG] mod_sofia.c:130 sofia_on_routing()  
sofia/internal/1311 at 192.168.1.10 SOFIA ROUTING

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:71  
switch_core_standard_on_routing() sofia/internal/1311 at 192.168.1.10  
Standard ROUTING

   2009-07-29 17:19:52 [INFO] mod_dialplan_xml.c:252 dialplan_hunt()  
Processing Chewaka (test)->3021 in context default

   Dialplan: sofia/internal/1311 at 192.168.1.10 parsing  
[default->unloop] continue=false

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (PASS) [unloop]  
${unroll_loops}(true) =~ /^true$/ break=on-false

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (FAIL) [unloop]  
${sip_looped_call}() =~ /^true$/ break=on-false

   Dialplan: sofia/internal/1311 at 192.168.1.10 parsing  
[default->global] continue=true

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (FAIL) [global]  
${network_addr}(10.3.1.12) =~ /^$/ break=never

   Dialplan: sofia/internal/1311 at 192.168.1.10 ANTI-Action  
set(use_profile=${cond(${acl(${network_addr} rfc1918)} == true ? nat :  
default)})

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (PASS) [global]  
${numbering_plan}() =~ /^$/ break=never

   Dialplan: sofia/internal/1311 at 192.168.1.10 Action  
set_user(default@${domain_name})

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (FAIL) [global]  
${call_debug}(false) =~ /^true$/ break=never

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (FAIL) [global]  
${sip_has_crypto}() =~  
/^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$/ break=never

   Dialplan: sofia/internal/1311 at 192.168.1.10 Absolute Condition [global]

   Dialplan: sofia/internal/1311 at 192.168.1.10 Action  
db(insert/${domain_name}-spymap/${caller_id_number}/${uuid})

   Dialplan: sofia/internal/1311 at 192.168.1.10 Action  
db(insert/${domain_name}-last_dial/${caller_id_number}/${destination_number})

   Dialplan: sofia/internal/1311 at 192.168.1.10 Action  
db(insert/${domain_name}-last_dial/global/${uuid})

   Dialplan: sofia/internal/1311 at 192.168.1.10 parsing  
[default->Local_Extension] continue=false

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (FAIL)  
[Local_Extension] destination_number(3021) =~ /^(130[0-8] &&  
131[0-9])$/ break=on-false

   Dialplan: sofia/internal/1311 at 192.168.1.10 parsing  
[default->IFAU_global_demonstrator_Conference_Room] continue=false

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (FAIL)  
[IFAU_global_demonstrator_Conference_Room] destination_number(3021) =~  
/^1309$/ break=on-false

   Dialplan: sofia/internal/1311 at 192.168.1.10 parsing [default->gw]  
continue=false

   Dialplan: sofia/internal/1311 at 192.168.1.10 Regex (PASS) [gw]  
destination_number(3021) =~ /^(30[0-2][0-9])$/ break=on-false

   Dialplan: sofia/internal/1311 at 192.168.1.10 Action  
bridge(sofia/gateway/gw/3021 at 192.168.2.10)

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:107  
switch_core_standard_on_routing() (sofia/internal/1311 at 192.168.1.10)  
State Change CS_ROUTING -> CS_EXEC

   UTE

   2009-07-29 17:19:52 [DEBUG] switch_core_session.c:868  
switch_core_session_signal_state_change() Send signal  
sofia/internal/1311 at 192.168.1.10 [BREAK]

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:472  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) State  
ROUTING going to sleep

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:390  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) Running  
State Change CS_EXECUTE

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:479  
switch_core_session_run() (sofia/internal/1311 at 192.168.1.10) State  
EXECUTE

   2009-07-29 17:19:52 [DEBUG] mod_sofia.c:173 sofia_on_execute()  
sofia/internal/1311 at 192.168.1.10 SOFIA EXECUTE

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:144  
switch_core_standard_on_execute() sofia/internal/1311 at 192.168.1.10  
Standard EXECUTE

   EXECUTE sofia/internal/1311 at 192.168.1.10 set(use_profile=default)

   2009-07-29 17:19:52 [DEBUG] mod_dptools.c:747 set_function()  
sofia/internal/1311 at 192.168.1.10 SET [use_profile]=[default]

   EXECUTE sofia/internal/1311 at 192.168.1.10 set_user(default at 192.168.1.10)

   2009-07-29 17:19:52 [WARNING] switch_ivr.c:2042  
switch_ivr_set_user() can't find user [default at 192.168.1.10]

   EXECUTE sofia/internal/1311 at 192.168.1.10  
db(insert/192.168.1.10-spymap/1311/d851bbd1-c09c-474b-b1df-d433420b132b)

   EXECUTE sofia/internal/1311 at 192.168.1.10  
db(insert/192.168.1.10-last_dial/1311/3021)

   EXECUTE sofia/internal/1311 at 192.168.1.10  
db(insert/192.168.1.10-last_dial/global/d851bbd1-c09c-474b-b1df-d433420b132b)

   EXECUTE sofia/internal/1311 at 192.168.1.10  
bridge(sofia/gateway/gw/3021 at 192.168.2.10)

   2009-07-29 17:19:52 [NOTICE] switch_channel.c:592  
switch_channel_set_name() New Channel sofia/external/3021 at 192.168.2.10  
[35a85e69-d109-134f-81d3-1d21016f43e5]

   2009-07-29 17:19:52 [DEBUG] mod_sofia.c:2567  
sofia_outgoing_channel() (sofia/external/3021 at 192.168.2.10) State  
Change CS_NEW -> CS_INIT

   2009-07-29 17:19:52 [DEBUG] switch_core_session.c:868  
switch_core_session_signal_state_change() Send signal  
sofia/external/3021 at 192.168.2.10 [BREAK]

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:390  
switch_core_session_run() (sofia/external/3021 at 192.168.2.10) Running  
State Change CS_INIT

   2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:469  
switch_core_session_run() (sofia/external/3021 at 192.168.2.10) State INIT

   2009-07-29 17:19:52 [DEBUG] mod_sofia.c:83 sofia_on_init()  
sofia/external/3021 at 192.168.2.10 SOFIA INIT

   2009-07-29 17:20:18 [ERR] sofia_glue.c:568  
sofia_glue_ext_address_lookup() STUN Failed! stun.freeswitch.org:3478  
[Timeout]

   2009-07-29 17:20:18 [NOTICE] mod_sofia.c:103 sofia_on_init() Hangup  
sofia/external/3021 at 192.168.2.10 [CS_INIT] [DESTINATION_OUT_OF_ORDER]

   2009-07-29 17:20:18 [DEBUG] switch_channel.c:1612  
switch_channel_perform_hangup() Send signal  
sofia/external/3021 at 192.168.2.10 [KILL]

   2009-07-29 17:20:18 [DEBUG] switch_core_session.c:868  
switch_core_session_signal_state_change() Send signal  
sofia/external/3021 at 192.168.2.10 [BREAK]

   With Wireshark, we have seen two sip error frame : "407 Proxy  
authentication required" and "502 bad gateway".

   What I must do to make calls between the two sip domains ?

   Best regards.

   G.C.

Liens:
------
[1] mailto:sofia/gateway/gw/$1 at 192.168.2.10

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20090730/c0cf4efd/attachment-0002.html 


More information about the FreeSWITCH-users mailing list