Enswitch installation on AWS: Difference between revisions

From Integrics Wiki
Jump to navigation Jump to search
Content deleted Content added
Vlasis (talk | contribs)
No edit summary
Vlasis (talk | contribs)
No edit summary
 
Line 14: Line 14:
#!define AWS_INTERNAL_IP <internal IP>
#!define AWS_INTERNAL_IP <internal IP>
#!define AWS_EXTERNAL_IP "<external IP>"
#!define AWS_EXTERNAL_IP "<external IP>"
</pre>

* Edit /opt/enswitch/current/etc/kamailio/kamailio_58.cfg as below:
<pre>
Index: etc/kamailio/kamailio_58.cfg
===================================================================
--- etc/kamailio/kamailio_58.cfg (revision 21240)
+++ etc/kamailio/kamailio_58.cfg (working copy)
@@ -334,6 +334,11 @@
}
}
if ( is_method( "INVITE" ) ) {
+ #!ifdef AWS_EXTERNAL_IP
+ if ( src_ip == AWS_INTERNAL_IP ) {
+ fix_nated_sdp("3",AWS_EXTERNAL_IP);
+ }
+ #!endif
$var(pai_count) = 0;
while( defined $(hdr(P-Asserted-Identity)[$var(pai_count)]) ) {
$var(pai_count) = $var(pai_count) + 1;
@@ -359,6 +364,11 @@
if ( is_method( "BYE" ) ) {
t_on_branch( "BRANCH" );
}
+ #!ifdef AWS_EXTERNAL_IP
+ if ( is_method( "SUBSCRIBE" ) ) {
+ set_advertised_address( AWS_INTERNAL_IP );
+ }
+ #!endif
if ( ! t_relay() ) {
sl_reply_error();
}
@@ -368,6 +378,11 @@
onreply_route[ REPLY ] {
if ( sdp_content() ) {
$avp(ENSWITCH-CIPHERS-SAFE) = $rb;
+ #!ifdef AWS_EXTERNAL_IP
+ if ( src_ip == AWS_INTERNAL_IP ) {
+ fix_nated_sdp("3",AWS_EXTERNAL_IP);
+ }
+ #!endif
}
force_rport();
@@ -494,6 +509,9 @@
# enforce routing to sipd
rewritehostporttrans("127.0.0.1:5080;transport=udp");
remove_hf( "Route" );
+ #!ifdef AWS_EXTERNAL_IP
+ set_advertised_address( AWS_INTERNAL_IP );
+ #!endif
route( FORWARD );
exit;
}
</pre>
</pre>



Latest revision as of 16:14, 4 July 2025

How to set up Enswitch on a single machine cluster on AWS

This set up has been tested successfully on an Enswitch 4.0 single machine cluster with Kamailio 5.8.2 and Asterisk 13.38.3:

  • Under the global configuration, create two machines, one for the internal IP address and FQDN and the other for the external IP and FQDN. Set only the internal address machine to accept calls as an Asterisk server.
  • Under the global configuration, create domains for the internal IP address, the internal FQDN, the external IP and the external FQDN.
  • Under the global configuration, set the "Message daemon IP address" to be the internal IP address.
  • Edit /etc/kamailio/kamailio.cfg as below:
listen = udp:<internal IP>:5060 advertise <external IP>:5060
listen = tcp:<internal IP>:5060 advertise <external IP>:5060

# AWS
#!define AWS_INTERNAL_IP <internal IP>
#!define AWS_EXTERNAL_IP "<external IP>"
  • - In /etc/asterisk/sip.conf add a local-public, a local-private, a public IP and a private IP stanza, eg:
[enswitch-local-public]
host = <external IP>
fromdomain = <external IP>
type = friend
insecure = port,invite
context = from-internal
canreinvite = no
nat = yes
t38pt_udptl = yes

[enswitch-local-private]
host = <internal IP>
fromdomain = <internal IP>
type = friend
insecure = port,invite
context = from-internal
canreinvite = no
nat = yes
t38pt_udptl = yes

[<external IP>]
host = <external IP>
fromdomain = <external IP>
type = friend
insecure = port,invite
context = from-internal
canreinvite = no
nat = yes
t38pt_udptl = yes

[<internal IP>]
host = <internal IP>
fromdomain = <internal IP>
type = friend
insecure = port,invite
context = from-internal
canreinvite = no
nat = yes
t38pt_udptl = yes