Skip to content

Commit

Permalink
WIP
Browse files Browse the repository at this point in the history
  • Loading branch information
dwilkie committed Jul 11, 2024
1 parent 8d41fb2 commit 7a544e1
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 3 deletions.
6 changes: 5 additions & 1 deletion components/gateway/public_gateway/opensips.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,11 @@ route{

# record routing
# https://opensips.org/pipermail/users/2018-January/038722.html
record_route_preset("LOCAL_IP:SIP_PORT", "SIP_ADVERTISED_IP:SIP_PORT");
if ($rp == "SIP_ALTERNATIVE_PORT") {
record_route_preset("LOCAL_IP:SIP_ALTERNATIVE_PORT", "SIP_ADVERTISED_IP:SIP_ALTERNATIVE_PORT");
} else {
record_route_preset("LOCAL_IP:SIP_PORT", "SIP_ADVERTISED_IP:SIP_PORT");
}
add_rr_param(";r2=on");

do_accounting("log");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,15 +8,25 @@ source $current_dir/../support/test_helpers.sh

scenario=$current_dir/../../scenarios/zamtel_inbound.xml

log_file="zamtel_inbound_*_messages.log"
rm -f $log_file

reset_db
create_load_balancer_entry "gwalt" "5080"
create_address_entry $(hostname -i)
reload_opensips_tables

rm -f zamtel_inbound_*_messages.log
public_gateway="$(dig +short public_gateway)"

sipp -sf $scenario public_gateway:5080 -s 7888 -m 1 -trace_msg > /dev/null
reset_db

if ! assert_in_file "zamtel_inbound_*_messages.log" "c=IN IP4 18.141.245.230"; then
# Assert correct IP in SDP
if ! assert_in_file $log_file "c=IN IP4 18.141.245.230"; then
exit 1
fi

# Assert correct Port in RR
if ! assert_in_file $log_file "Record-Route: <sip:$public_gateway:5080"; then
exit 1
fi
6 changes: 6 additions & 0 deletions components/testing/tests/public_gateway/inbound_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ log_file="smart_inbound_*_messages.log"
rm -f $log_file

media_server="$(dig +short freeswitch)"
public_gateway="$(dig +short public_gateway)"

reset_db
create_load_balancer_entry "gw" "5060"
Expand All @@ -26,3 +27,8 @@ reset_db
if ! assert_in_file $log_file "c=IN IP4 $media_server"; then
exit 1
fi

# Assert correct Port in RR
if ! assert_in_file $log_file "Record-Route: <sip:$public_gateway:5060"; then
exit 1
fi

0 comments on commit 7a544e1

Please sign in to comment.