<p>Hello world,</p><p>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.</p><p>Client #1
------- Freeswitch #1 --(gateway)--- Freeswitch #2 ------ Client# 2.</p><p>We
have configured a sip gateway on Freeswitch #1 server with the configuration
below:</p><p>C:\Program
Files\FreeSWITCH\conf\sip_profiles\external\gw.xml</p><p><include> <br
/> <gateway
name="gw"> <br />
<param name="username" value="3000"/> <br />
<param name="realm" value="192.168.2.10"/> <br />
<param name="from-domain" value="192.168.2.10"/> <br
/> <param name="password" value="2009"/> <br />
<param name="expire-seconds" value="3600"/> <br />
<param name="register-transport" value="udp"/> <br
/> <param name="retry-seconds" value="30"/> <br />
<param name="ping" value="25"/> <br />
</gateway> <br /></include></p><p>C:\Program
Files\FreeSWITCH\conf\dialplan\default\01_example.com.xml</p><p><include></p><p><extension
name="gw"> <br /> <!--<condition
field="${toll_allow}" expression="gw"/> --><br />
<condition field="destination_number"
expression="^(30[0-2][0-9])$"> <br /> <action
application="bridge" data="<a
href="mailto:sofia/gateway/gw/$1@192.168.2.10"/">sofia/gateway/gw/$1@192.168.2.10"/</a>>
<br /> </condition> <br
/></extension></p><p></include></p><p>In the Freeswitch #2 server,
we have configured the 3000 extension:</p><p>C:\Program
Files\FreeSWITCH\conf\directory\default\3000.xml</p><p><include><br />
<user id="3000" mailbox="3000"><br />
<params><br /> <param name="password"
value="1234"/><br /> <param name="vm-password"
value="1000"/><br /> </params><br />
<variables><br /> <variable name="toll_allow"
value="domestic,international,local"/><br /> <variable
name="accountcode" value="3000"/><br />
<variable name="user_context" value="default"/><br
/> <variable name="effective_caller_id_name"
value="Extension 3000"/><br /> <variable
name="effective_caller_id_number" value="3000"/><br
/> <variable name="outbound_caller_id_name"
value="$${outbound_caller_name}"/><br /> <variable
name="outbound_caller_id_number"
value="$${outbound_caller_id}"/><br /> <variable
name="callgroup" value="techsupport"/><br />
</variables><br /> </user><br /></include></p><p>We have our
gateway working.</p><p>>>sofia status gateway gw</p><p>But we can't do a
call between client#1 and
client#2.</p><p>=================================================================================================<br
/>Name gw<br />Scheme Digest<br />Realm
10.0.2.10<br />Username 3000<br />Password yes<br
/>From <sip:3000@192.168.2.10;transport=udp><br
/>Contact <sip:gw+gw@192.168.1.10:5080;transport=udp><br
/>Exten 3000<br />To sip:3000@192.168.2.10<br
/>Proxy sip:192.168.2.10<br />Context public<br
/>Expires 3600<br />Freq 3600<br />Ping
1248881849<br />PingFreq 25<br />State REGED<br
/>Status UP<br />CallsIN 0<br />CallsOUT 19<br
/>=================================================================================================</p><p>We
have the following debug when we make a call.</p><font size="2"><p>2009-07-29
17:19:52 [DEBUG] sofia_glue.c:2566 sofia_glue_negotiate_sdp() Set 2833 dtmf
payload to 101</p><p>2009-07-29 17:19:52 [DEBUG] sofia.c:2962
sofia_handle_sip_i_state() (sofia/internal/1311@192.168.1.10) State Change
CS_NEW -> CS_INIT</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_session.c:868 switch_core_session_signal_state_change() Send signal
sofia/internal/1311@192.168.1.10 [BREAK]</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_state_machine.c:390 switch_core_session_run()
(sofia/internal/1311@192.168.1.10) Running State Change
CS_INIT</p><p>2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:469
switch_core_session_run() (sofia/internal/1311@192.168.1.10) State
INIT</p><p>2009-07-29 17:19:52 [DEBUG] mod_sofia.c:83 sofia_on_init()
sofia/internal/1311@192.168.1.10 SOFIA INIT</p><p>2009-07-29 17:19:52 [DEBUG]
mod_sofia.c:111 sofia_on_init() (sofia/internal/1311@192.168.1.10) State Change
CS_INIT -> CS_ROUTING</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_session.c:868 switch_core_session_signal_state_change() Send signal
sofia/internal/1311@192.168.1.10 [BREAK]</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_state_machine.c:469 switch_core_session_run()
(sofia/internal/1311@192.168.1.10) State INIT going to sleep</p><p>2009-07-29
17:19:52 [DEBUG] switch_core_state_machine.c:390 switch_core_session_run()
(sofia/internal/1311@192.168.1.10) Running State Change
CS_ROUTING</p><p>2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:472
switch_core_session_run() (sofia/internal/1311@192.168.1.10) State
ROUTING</p><p>2009-07-29 17:19:52 [DEBUG] mod_sofia.c:130 sofia_on_routing()
sofia/internal/1311@192.168.1.10 SOFIA ROUTING</p><p>2009-07-29 17:19:52
[DEBUG] switch_core_state_machine.c:71 switch_core_standard_on_routing()
sofia/internal/1311@192.168.1.10 Standard ROUTING</p><p>2009-07-29 17:19:52
[INFO] mod_dialplan_xml.c:252 dialplan_hunt() Processing Chewaka
(test)->3021 in context default</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 parsing [default->unloop]
continue=false</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Regex (PASS)
[unloop] ${unroll_loops}(true) =~ /^true$/ break=on-false</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Regex (FAIL) [unloop] ${sip_looped_call}() =~
/^true$/ break=on-false</p><p>Dialplan: sofia/internal/1311@192.168.1.10
parsing [default->global] continue=true</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Regex (FAIL) [global]
${network_addr}(10.3.1.12) =~ /^$/ break=never</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 ANTI-Action
set(use_profile=${cond(${acl(${network_addr} rfc1918)} == true ? nat :
default)})</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Regex (PASS)
[global] ${numbering_plan}() =~ /^$/ break=never</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Action
set_user(default@${domain_name})</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Regex (FAIL) [global] ${call_debug}(false) =~
/^true$/ break=never</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Regex
(FAIL) [global] ${sip_has_crypto}() =~
/^(AES_CM_128_HMAC_SHA1_32|AES_CM_128_HMAC_SHA1_80)$/
break=never</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Absolute Condition
[global]</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Action
db(insert/${domain_name}-spymap/${caller_id_number}/${uuid})</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Action
db(insert/${domain_name}-last_dial/${caller_id_number}/${destination_number})</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Action
db(insert/${domain_name}-last_dial/global/${uuid})</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 parsing [default->Local_Extension]
continue=false</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Regex (FAIL)
[Local_Extension] destination_number(3021) =~ /^(130[0-8] &&
131[0-9])$/ break=on-false</p><p>Dialplan: sofia/internal/1311@192.168.1.10
parsing [default->IFAU_global_demonstrator_Conference_Room]
continue=false</p><p>Dialplan: sofia/internal/1311@192.168.1.10 Regex (FAIL)
[IFAU_global_demonstrator_Conference_Room] destination_number(3021) =~ /^1309$/
break=on-false</p><p>Dialplan: sofia/internal/1311@192.168.1.10 parsing
[default->gw] continue=false</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Regex (PASS) [gw] destination_number(3021) =~
/^(30[0-2][0-9])$/ break=on-false</p><p>Dialplan:
sofia/internal/1311@192.168.1.10 Action
bridge(sofia/gateway/gw/3021@192.168.2.10)</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_state_machine.c:107 switch_core_standard_on_routing()
(sofia/internal/1311@192.168.1.10) State Change CS_ROUTING ->
CS_EXEC</p><p>UTE</p><p>2009-07-29 17:19:52 [DEBUG] switch_core_session.c:868
switch_core_session_signal_state_change() Send signal
sofia/internal/1311@192.168.1.10 [BREAK]</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_state_machine.c:472 switch_core_session_run()
(sofia/internal/1311@192.168.1.10) State ROUTING going to
sleep</p><p>2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:390
switch_core_session_run() (sofia/internal/1311@192.168.1.10) Running State
Change CS_EXECUTE</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_state_machine.c:479 switch_core_session_run()
(sofia/internal/1311@192.168.1.10) State EXECUTE</p><p>2009-07-29 17:19:52
[DEBUG] mod_sofia.c:173 sofia_on_execute() sofia/internal/1311@192.168.1.10
SOFIA EXECUTE</p><p>2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:144
switch_core_standard_on_execute() sofia/internal/1311@192.168.1.10 Standard
EXECUTE</p><p>EXECUTE sofia/internal/1311@192.168.1.10
set(use_profile=default)</p><p>2009-07-29 17:19:52 [DEBUG] mod_dptools.c:747
set_function() sofia/internal/1311@192.168.1.10 SET
[use_profile]=[default]</p><p>EXECUTE sofia/internal/1311@192.168.1.10
set_user(default@192.168.1.10)</p><p>2009-07-29 17:19:52 [WARNING]
switch_ivr.c:2042 switch_ivr_set_user() can't find user
[default@192.168.1.10]</p><p>EXECUTE sofia/internal/1311@192.168.1.10
db(insert/192.168.1.10-spymap/1311/d851bbd1-c09c-474b-b1df-d433420b132b)</p><p>EXECUTE
sofia/internal/1311@192.168.1.10
db(insert/192.168.1.10-last_dial/1311/3021)</p><p>EXECUTE
sofia/internal/1311@192.168.1.10
db(insert/192.168.1.10-last_dial/global/d851bbd1-c09c-474b-b1df-d433420b132b)</p><p>EXECUTE
sofia/internal/1311@192.168.1.10
bridge(sofia/gateway/gw/3021@192.168.2.10)</p><p>2009-07-29 17:19:52 [NOTICE]
switch_channel.c:592 switch_channel_set_name() New Channel
sofia/external/3021@192.168.2.10
[35a85e69-d109-134f-81d3-1d21016f43e5]</p><p>2009-07-29 17:19:52 [DEBUG]
mod_sofia.c:2567 sofia_outgoing_channel() (sofia/external/3021@192.168.2.10)
State Change CS_NEW -> CS_INIT</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_session.c:868 switch_core_session_signal_state_change() Send signal
sofia/external/3021@192.168.2.10 [BREAK]</p><p>2009-07-29 17:19:52 [DEBUG]
switch_core_state_machine.c:390 switch_core_session_run()
(sofia/external/3021@192.168.2.10) Running State Change
CS_INIT</p><p>2009-07-29 17:19:52 [DEBUG] switch_core_state_machine.c:469
switch_core_session_run() (sofia/external/3021@192.168.2.10) State
INIT</p><p>2009-07-29 17:19:52 [DEBUG] mod_sofia.c:83 sofia_on_init()
sofia/external/3021@192.168.2.10 SOFIA INIT</p><p>2009-07-29 17:20:18 [ERR]
sofia_glue.c:568 sofia_glue_ext_address_lookup() STUN Failed!
stun.freeswitch.org:3478 [Timeout]</p><p>2009-07-29 17:20:18 [NOTICE]
mod_sofia.c:103 sofia_on_init() Hangup sofia/external/3021@192.168.2.10
[CS_INIT] [DESTINATION_OUT_OF_ORDER]</p><p>2009-07-29 17:20:18 [DEBUG]
switch_channel.c:1612 switch_channel_perform_hangup() Send signal
sofia/external/3021@192.168.2.10 [KILL]</p><p>2009-07-29 17:20:18 [DEBUG]
switch_core_session.c:868 switch_core_session_signal_state_change() Send signal
sofia/external/3021@192.168.2.10 [BREAK]</p><p>With Wireshark, we have seen two
sip error frame : "407 Proxy authentication required" and "502
bad gateway".</p><p>What I must do to make calls between the two sip
domains ?</p><p>Best regards.</p><p>G.C.</p></font>