Now Reading
Somleng | Weblog

Somleng | Weblog

2023-12-19 01:02:54

Infrastructure @ Somleng

December 15, 2023

It is a technical publish about how we dynamically scale our infrastructure at Somleng.

Background

Somleng is an Open Supply Communications-Platform-as-a-Service (CPaaS) and
Telco-as-a-Service (TaaS). On the CPaaS aspect, Somleng consists of an Open Supply implementation of Twilio’s
APIs for Programmable Voice and Messaging in addition to a Dashboard for patrons to configure their
account, handle their credentials, configure telephone numbers, handle Textual content-to-Speech (TTS) and so forth. Somleng
helps TwiML for programming voice and messaging flows.

On the TaaS aspect, Somleng features a Dashboard and API for firms (aka Carriers) who wish to present
their very own branded Twilio-like service to their prospects. Firms can create and handle accounts, SIP
trunks, SMS gateways, handle buyer billing and so forth.

Somleng is being utilized in a wide range of totally different use-cases all over the world. For instance it powers
telehealth providers in
Zambia and Guatemala
and the Nationwide Early Warning Methods of
Cambodia
and
Laos.

When contemplating the use-case for powering Early Warning Methods, an attention-grabbing downside arises. Most of
the time the system is comparatively idle, supporting only some registration calls per minute. Nevertheless in
the case of an emergency, the system wants to have the ability to deal with 1000’s of calls per minute.

We do not wish to run over-provisioned servers the entire time as a result of this may make the price
prohibitively costly, however we’d like to have the ability to dynamically deal with excessive hundreds.

Parts

Dashboard and API

The Somleng Dashboard and API is powered by a Ruby on Rails utility related to a managed
PostgreSQL database which manages the entire enterprise logic. This a part of the appliance is comparatively
straightforward to auto-scale by inserting the appliance behind a layer 7 managed load balancer akin to
AWS’ Application Load Balancer.

The load balancer routes requests to
ECS
tasks

that are working an Nginx
reverse proxy and a duplicate of the Rails utility. Cloudwatch alarms are configured to auto-scale the
variety of duties based mostly on CPU utilization. When a brand new job is in service, ECS will register the brand new job with
the load balancer and begin routing requests to it. Conversely when the CPU utilization drops beneath a
sure threshold a job is deregistered from the load balancer and terminated thereby saving value. This
is a comparatively normal setup widespread for many internet functions.


Determine 1: Somleng Dashboard and API

Somleng Change Layer

As a way to energy programmable voice functions, we have to go away the appliance layer (layer 7)
behind and drop all the way down to the transport layer (stage 4). There are a few Open Supply
communication expertise platforms within the VoIP area akin to Asterisk and FreeSWITCH. At Somleng we use
FreeSWITCH
which acts as both a SIP consumer agent shopper (UAC) and SIP consumer agent server (UAS) relying
on whether or not it’s initiating a voice name or receiving a voice name.

When performing as a UAC, FreeSWITCH can be positioned behind an Software Load Balancer and positioned in a
non-public subnet behind a
NAT
Gateway

as proven beneath:


Determine 2: Somleng UAC Infrastructure

Inner API requests are acquired from Somleng through an Software Load Balancer to Nginx Reverse
Proxies working alongside FreeSWITCH situations. This structure permits FreeSWITCH to be auto-scaled up
and down based mostly on CPU utilization and/or
session
rely with out having to introduce any SIP conscious load balancers.

There may be one downside about this strategy
although which has to do with SIP and NAT. To grasp this downside we have to perceive a
little bit extra in regards to the

Session Initiation Protocol (SIP)

and the

Session Description Protocol (SDP)
.

The SIP By way of Header

In a SIP invite request, the UAC will insert a SIP By way of header indicating the trail taken by the request
up to now which helps in routing the responses again alongside the identical path. This is an instance of a SIP By way of
Header:

By way of: SIP/2.0/UDP 10.10.1.21;department=z9hG4bKv5jFZ8am7aZQc

Within the instance above, the responses shall be despatched again to 10.10.1.21 on the default port for
UDP 5060.

Right here you may see an issue instantly with our infrastructure above. 10.10.1.21 is the IP handle of
the FreeSWITCH ECS job and isn’t publicly routable from the Web. Subsequently any responses from the
UAS
is not going to be acquired by the UAC. It is because FreeSWITCH (performing because the UAC) constructs the SIP
header and is just conscious of its personal IP handle and port. When the request passes by way of the managed NAT
Gateway, it should do
Port
Address Translation (PAT)

and alter the precise IP and port of the request as
proven beneath:


Determine 3: UAC Behind NAT Gateway

To deal with this example
Section 18.2.1 of RFC 3261
describes how a server should add a “acquired”
parameter to the topmost By way of header when it receives a request:

This parameter MUST comprise the supply handle from which the packet was acquired.

This parameter was designed to help routing of responses
not solely the place NAT is concerned but additionally the place the upstream machine has used a hostname fairly than an IP
handle within the By way of it inserted. The default conduct for routing of SIP responses over UDP, as described
in RFC 3261, is to make use of handle and port info embedded within the related By way of header – the handle is
taken from the “acquired” parameter worth and the port is taken from the “sent-by” part. If there
is not any port, it defaults to port 5060 for UDP and TCP, or port 5061 for TLS.

This is how the By way of Header appears when the “acquired” parameter is added by the UAS:

By way of: SIP/2.0/UDP 10.10.1.21;acquired=13.250.230.15;department=z9hG4bKv5jFZ8am7aZQc

The UAS has added the “acquired” parameter which appropriately corresponds to the general public IP of the NAT
gateway. Nevertheless this alone will not be sufficient. Responses from the UAS will nonetheless be despatched to the port 5060
(default for UDP). Since this port will not be mapped by the NAT gateway, responses can’t be acquired by the
UAS.


Determine 4: UAC Behind NAT Gateway with “acquired” parameter

This downside was addressed in
RFC 3581
It describes the “rport” parameter as follows:

When a server compliant to this specification (which is usually a proxy or UAS) receives a
request, it examines the topmost By way of header area worth. If this By way of header area worth
incorporates an “rport” parameter with no worth, it MUST set the worth of the parameter to
the supply port of the request. That is analogous to the way in which wherein a server will insert
the “acquired” parameter into the topmost By way of header area worth. In actual fact, the server
MUST insert a “acquired” parameter containing the supply IP handle that the request
got here from, even whether it is equivalent to the worth of the “sent-by” part.

Luckily FreeSWITCH robotically provides this empty “rport” parameter to the through parameter when it
detects it is behind a NAT. This is how the By way of header appears with the empty “rport” parameter when despatched
through the UAC (FreeSWITCH):

By way of: SIP/2.0/UDP 10.10.1.21;rport;department=z9hG4bKv5jFZ8am7aZQc

And here is how the By way of header takes care of it has been acquired by the UAS:

By way of: SIP/2.0/UDP 10.10.1.21;acquired=13.250.230.15;rport=37058;department=z9hG4bKv5jFZ8am7aZQc

The addition of an “rport” parameter alongside the “acquired” parameter signifies that SIP responses could be
handed again to the supply utilizing symmetric routing. Responses will now be despatched from the UAS to
13.250.230.15 on port 37058 which correspond to the IP handle and port handle mapping of the managed
NAT Gateway. The NAT gateway will then map this port again to the FreeSWITCH job which is working on
10.10.1.21.


Determine 5: UAC Behind NAT Gateway with “acquired” and “rport” parameters

SDP and RTP

Sadly this isn’t the top of the story.
Inside a SIP Invite request physique there is a SDP packet
which describes multimedia communication info. This is an truncated instance from Somleng:

                
                  Session Description Protocol Model (v): 0
                  Connection Data (c): IN IP4 13.250.230.15
                  Media Description, identify and handle (m): audio 25984 RTP/AVP 0 8 101 13
                
              

The next line reveals the media connection info:

Connection Data (c): IN IP4 13.250.230.15

The connection info half appropriately makes use of the IP handle of the NAT Gateway. It is because in
our FreeSWITCH configuration
we set the
ext-rtp-ip
parameter to the IP handle of the NAT Gateway which causes
FreeSWITCH to insert the proper worth. With out this configuration FreeSWITCH would insert the non-public
IP handle of the ECS job’s community interface into the SDP. Nevertheless there’s additionally a problem with the
following line:


Media Description, identify and handle (m): audio 25984 RTP/AVP 0 8 101 13

This line specifies the port wherein the media needs to be despatched and acquired from. FreeSWITCH opens this
port (25984) for sending media and inserts it into the SDP. By default FreeSWITCH will choose a random
port in
the vary 16384-32768.

Nevertheless when RTP media is distributed out by way of the NAT gateway to the UAS, the port shall be translated and
will not match the worth within the SDP. This usually ends in one-way audio points as a result of the
media server on the UAS aspect will attempt to ship audio again to the port specified within the SDP which can not
be reached as illustrated beneath:


Determine 6: UAC Behind NAT Gateway SDP and RTP

As a way to work round this situation, we usually require UAS/Media Servers connecting to Somleng to
allow Symmetric RTP. Symmetric RTP signifies that the IP handle and port pair utilized by an
outbound RTP movement is reused for the inbound movement. The IP handle and port are realized when the preliminary
RTP movement is acquired on the UAS. The movement’s supply handle and port are latched onto and used because the
vacation spot for the RTP sourced by the UAC. The IP handle and port within the c line and m line
respectively within the SDP message are ignored. That is illustrated beneath:


Determine 7: UAC Behind NAT Gateway Symmetric RTP

In some circumstances, our buyer’s units don’t assist symmetric RTP, or they can not allow it. In these
circumstances, we work across the situation by bypassing the Managed NAT Gateway and routing RTP by way of a 1-1 NAT
occasion.

The 1-1 NAT occasion doesn’t robotically apply PAT to outgoing packets. As an alternative, it should attempt to preserve
the outbound port of the shopper and solely apply PAT if there’s a conflicting port. On condition that FreeSWITCH
generates a random port for RTP for every session within the vary 16384-32768 it needs to be comparatively uncommon
to see conflicts and PAT.

Routing RTP by way of the 1-1 NAT occasion signifies that the UAS will obtain RTP packets from the port which
corresponds to the worth within the (m) line of the SDP. The UAS media server can due to this fact ship RTP again to
this port
which shall be routed again to the FreeSWITCH media server as illustrated beneath:


Determine 8: UAC Behind 1-1 NAT Occasion

SIP Load Balancing

To date now we have managed to get away with utilizing off-the-shelf managed providers akin to an AWS Software
Load Balancer and an AWS NAT Gateway to horizontally scale FreeSWITCH when used as a Consumer Agent Consumer
(UAC). However we additionally wish to use FreeSWITCH as a Consumer Agent Server (UAS) to deal with inbound calls. This
poses a brand new set of challenges described within the following part.

Incoming SIP and RTP are despatched over UDP. We wish these requests to be load balanced to our FreeSWITCH
duties, however we can not use the present Software Load Balancer which operates on layer 7 (or the
utility layer of the OSI Mannequin). AWS additionally has a managed layer 4

Network Load Balancer
which may
be used to load steadiness UDP, nonetheless the sort of load balancer will not be SIP conscious. This is what occurs
after we attempt to load steadiness SIP on to the FreeSWITCH duties utilizing a managed Community Load Balancer.


Determine 9: UAS Behind Community Load Balancer

The non-SIP-aware Community Load Balancer, simply distributes requests between the ECS duties working
FreeSWITCH. Within the instance above the SIP Invite is distributed to at least one ECS job, however the SIP BYE is distributed to
one other.

As a way to deal with this we’d like a SIP-aware proxy that sits between the managed Community Load Balancer
and the FreeSWITCH UAS duties. The proxy will be capable to deal with incoming requests and route them to the
right FreeSWITCH job. For this we use
OpenSIPS.
OpenSIPS comes with a load balancer module which
helps FreeSWITCH out of the field.


Determine 10: UAS Behind OpenSIPS Proxy

With an OpenSIPS proxy in place, new requests (SIP Invitations) shall be load balanced throughout the obtainable
FreeSWITCH duties. As a way to illustrate this higher let’s take a look at an entire instance.


Determine 11: SIP Invite

  1. UAC (10.65.104.1) sends SIP Invite to the UAC’s SIP Proxy (175.100.32.29)
  2. UAC’s SIP Proxy forwards the request to the Community Load Balancer (52.74.4.205)
  3. Community Load Balancer forwards the request to the OpenSIPS proxy ECS job (10.10.1.162)
  4. OpenSIPS proxy forwards the request to the FreeSWITCH job (10.10.1.21)

When the SIP invite arrives on the OpenSIPS proxy it should add a brand new Report-Route header containing its
personal handle above any present Report-Route headers. In our setup, OpenSIPS is configured so as to add two
Report-Route headers. This is named double Report-Route headers and handles the particular state of affairs
the place the proxy receives a request on one community interface and sends it onwards utilizing a unique
interface. In our case the request is acquired on by Community Load Balancer however despatched out through the non-public
IP handle of the OpenSIPS ECS Job.

The set of Report-Route headers describes the trail by way of all proxy nodes. Mixed with the Contact
header, this offers an entire description of the upstream path that leads again to the UAC.

This is an
instance of a request containing the Report-Route headers and speak to headers for a SIP Invite
proxied to the UAS (FreeSWITCH ECS Job):

                
                  Request-Line: INVITE sip:1294@52.74.4.205:5060;consumer=telephone SIP/2.0

                  Message Header:
                  Report-Route: <sip:10.10.1.162:5060;lr;did=05d.f7db99b7;r2=on>
                  Report-Route: <sip:52.74.4.205:5060;lr;did=05d.f7db99b7;r2=on>
                  Report-Route: <sip:175.100.32.29:5060;lr;transport=udp>
                  Contact: <sip:0715100860@10.65.104.1:5060;consumer=telephone>
                
              

Be aware the next:

  • The Request-Line incorporates the marketed IP handle of the Community Load Balancer, which the UAC is aware of
    earlier than it sends the request.
  • 10.10.1.162 is the interior IP handle of the OpenSIPS ECS job. This Report-Route header
    is added by
    the OpenSIPS proxy earlier than it sends the request to the UAS.
  • 52.74.4.205 is the general public IP handle of the Community Load Balancer. This Report-Route
    header is added by the OpenSIPS proxy earlier than it sends the request to the UAS.
  • The attribute r2=on within the Report-Route headers signifies double Report-Route headers.
  • 175.100.32.29 is the general public IP handle of the SIP proxy related to the UAC and is
    added by the UAC’s proxy.
  • 10.65.104.1 (within the contact header) is the interior IP handle of the UAC.

Now the UAS (FreeSWITCH ECS job) has an entire description of the trail again to the UAC, however at this
level the UAC does not have any data of the trail, the proxy nodes and even the handle of the
UAS. It must know the trail too, for instance when it needs to ship extra requests to the UAS inside
the present dialogue. This info is exchanged by the UAS within the response, which features a
full copy of all of the Report-Route headers. It additionally consists of its personal Contact header within the response.
The trail that the response follows is outlined by the By way of headers – the Report-Route headers are current
within the response however don’t affect its transmission path.


Determine 12: SIP Response

  1. The UAS FreeSWITCH ECS Job (10.10.1.21) sends the response to the OpenSIPS proxy’s
    inner IP handle (10.10.1.162) obtained from the By way of Header.
  2. The OpenSIPS proxy ECS job forwards the response to the UAC’s proxy through the NAT Gateway.
  3. The NAT Gateway forwards the response to the UAC’s SIP Proxy (175.100.32.29) obtained
    from the By way of Header.
  4. The UAC’s SIP proxy forwards the response to the UAC (10.65.104.1) obtained from the By way of
    Header.

This is the SIP response from the UAS:

                
                  Standing-Line: SIP/2.0 183 Session Progress

                  Message Header:
                  By way of: SIP/2.0/UDP 52.74.4.205:5060;department=z9hG4bK918f.3a1eef55.0;acquired=10.10.1.162
                  By way of: SIP/2.0/UDP 175.100.32.29:5060;department=z9hG4bK08B4d2dd80314813a74
                  By way of: SIP/2.0/UDP 10.65.104.1:5065;department=z9hG4bKqgyjqqdfz0g5zqhhysze7m0de;X-DptMsg=139
                  Report-Route: <sip:10.10.1.162:5060;lr;did=05d.f7db99b7;r2=on>
                  Report-Route: <sip:52.74.4.205:5060;lr;did=05d.f7db99b7;r2=on>
                  Report-Route: <sip:175.100.32.29:5060;lr;transport=udp>
                  Contact: <sip:1294@10.10.1.21:5060;transport=udp>
                
              

Be aware the next:

  • The By way of Headers are used to route the response again to the UAC, the Report-Route headers are current
    however don’t affect the transmission path.
  • 10.10.1.162 is the interior IP handle of the OpenSIPS ECS job seen within the “acquired”
    parameter of the primary
    By way of Header. This “acquired” parameter is used to find out the primary hop again to the the OpenSIPS
    Proxy within the
    response, not the Report-Route header.
  • 10.10.1.21 (within the contact header) is the interior IP handle of the UAS (FreeSWITCH ECS
    Job). That is set by the UAS within the response.

So now, each the UAC and the UAS have a duplicate of the total set of Report-Route headers and is remembered
by each endpoints. As soon as the dialogue is established, the proxies mustn’t insert any extra Report-Route
headers after that preliminary transaction. As an alternative, all of the sequential SIP requests ought to comprise Route
headers.

The Route Set is used to create a set of Route headers. The sequence of those headers is vital – the
upstream server will invert the order, however a downstream server doesn’t.


Determine 13: Downstream SIP Bye

  1. The UAC sends an in-dialog BYE on to the UAS through the obtained through the UAS’s Contact header. The
    first hop
    is set by the Route first Route header, which factors to the UAC’s Proxy
    (175.100.32.29).
  2. The UAC’s Proxy
    removes the route header and forwards the request to the following Route header which factors to the Community
    Load Balancer (52.74.4.205).
  3. The Community Load Balancer forwards the request to the OpenSIPS proxy ECS Job
    (10.10.1.162).
  4. The OpenSIPS proxy removes the the double Route Headers that it owns (52.74.4.205 and
    10.10.1.162) and forwards the request
    to UAS obtained from the worth within the Request-Line (10.10.1.21).

This is the downstream BYE request from the UAC.

                
                  Request-Line: BYE sip:1294@10.10.1.21:5060;transport=udp SIP/2.0

                  Message Header:
                  Route: <sip:175.100.32.29:5060;lr;did=7c1.f350d215;>
                  Route: <sip:52.74.4.205:5060;lr;did=7c1.f350d215;r2=on>
                  Route: <sip:10.10.1.162:5060;lr;did=7c1.f350d215;r2=on>
                
              

Be aware the next:

  • The Request Line incorporates the non-public IP handle of the FreeSWITCH ECS job (10.10.1.21)
    which it received from the Contact Header of the Response (see above).
  • When the request reaches OpenSIPS, it should strip each of the Route Headers and ahead the request to
    the non-public IP handle of the FreeSWITCH ECS job which it will get from the Request-Line.

Auto-scaling FreeSWITCH Duties

To date now we have mentioned how we deploy FreeSWITCH behind each an Software Load Balancer (when performing
as a UAC) and a SIP proxy (when performing as a UAS). This part discusses how we robotically scale
FreeSWITCH duties based mostly on CPU and Session rely.

We use two separate
Target Tracking scaling policies
which monitor each the CPU utilization and session rely of the FreeSWITCH duties.


Determine 14: ECS Autoscaling

When a scaling coverage provides a brand new job, a Lambda perform is triggered which provides a load balancer goal
to the OpenSIPS load balancer desk. OpenSIPS will then begin load balancing SIP requests to the brand new
job. When FreeSWITCH is performing as a UAC, this occurs robotically when ECS registers the duty with
the Software Load Balancer.

Equally, when a job scales-in the Lambda perform is triggered which removes the load balancer goal
from the OpenSIPS load balancer desk. OpenSIPS then stops sending new requests to this endpoint. When
FreeSWITCH is performing as a UAC, this occurs robotically when ECS de-registers the duty from the
Software Load Balancer. After a specified timeout interval, the duty is terminated.

Open Supply Infrastructure

The entire Infrastructure described on this publish is on the market as Terraform configuration
recordsdata as a part of our dedication to
being 100% Open Supply and a Digital Public Good. The configuration recordsdata could be discovered underneath the
infrastructure listing within the following repositories:

  1. Somleng Dashboard and
    API
  2. Somleng Switch

From Cambodia to Laos by Bike to setup an Early Warning System

September 2, 2023


In August 2023 my spouse Mara and I traveled to
Pakse
in Southern Laos to assist setup an Early Warning System pilot for
one our prospects
People In Need.
The Early Warning System is concentrating on three provinces of Southern Laos:
Salavan,
Champasak
and
Attapeu.

This weblog publish covers the journey to Laos and the setup of the Early Warning System by way of Somleng.
In case your solely within the tech half, be happy to skip to
Day 4.

Attending to Pakse

My spouse and I reside on a small farm simply south of
Phnom Penh in
Cambodia.
There are flights from Phnom Penh to
Vientiane (Capital of
Laos), however Pakse remains to be round 670 km from Vientiane and the one approach to get there’s by bus.
Then again Pakse is just round 600 km from Phnom Penh. There is a bus from Phnom Penh to Pakse
however it takes between 13 and 15 hours which did not sound enjoyable.
So we determined to place our stuff in a giant black plastic bag, tie it to the again of my
1993 Honda Degree
and hit the highway.

Day 1 – Phnom Penh to Stung Treng, Cambodia

We left residence round 7:00am and headed north, crossing Kandal, Prey Veng, Kampong Cham and Kratie
provinces and eventually reaching
Stung
Treng
round 3:00pm.


Day 2 – Stung Treng, Cambodia to Don Det, Laos (Border Crossing)

The Cambodian-Laos border is round 70 km from Stung Treng metropolis however the highway is unpaved from the
Sekong bridge
simply outdoors of Stung Treng metropolis all the way in which to the border.
On the border on the Cambodian aspect there’s nothing a lot aside from a couple of outlets the place you may change
Cambodian Riel
(or presumably US {Dollars}) into
Lao Kip. We truly
did this at a cash changer in Stung Treng earlier than we left.
Be aware that you will want some Lao Kip earlier than getting into Laos. There are not any ATMs or cash changers on the
Laos aspect of the border, and no one in Laos will settle for Cambodian Riel or some other foreign money for that
matter.

Crossing the Border at Trapaingkriel Border Checkpoint

In case your crossing with a bike you will need to go although each immigration and customs on the
Cambodian aspect.
The immigration official requested us for 10,000 Riel ($2.50) per passport after stamping us out. I am certain
it is a non-official cost
since I’ve by no means been requested to pay when leaving Cambodia prior to now. Nevertheless I’ve lived in South East
Asia for 15 years, (Cambodia for 11 of these)
and I perceive that immigration officers do not receives a commission sufficient to boost their households on the
official wage, so I do not actually have an issue serving to them out.

After you stamp out of Cambodia, you will need to go to the customs workplace, the place the official will verify
the paperwork on your bike.
The vital doc that you just want is the possession paper for the Bike. In Cambodia that is recognized
because the automobile identification card or (កាតគ្រី).
Be aware that it does not matter if this doc has the earlier proprietor’s identify, however you will need to posses the
precise card.


If you do not have the paperwork for the bike, the customs official should still be capable to course of
the export paperwork, however you’ll have to pay between $10 and $20.
Once more, I believe that is affordable, particularly if you do not have the required paperwork. Should you stand
there and argue, they’re inside their rights to not allow you to cross with the bike.

Luckily for us, after we entered customs workplace, the customs official immediately acknowledged my spouse
and I.
He went to highschool with my spouse and her brother and I had met him as soon as earlier than in Phnom Penh.
For sure, he helped fill out the export paperwork for us,
and we had been quickly on our approach to the Laos aspect.

Coming into Laos

There is a tiny workplace on the Laos aspect of the border earlier than you get to the primary immigration part.
Apparently that is so referred to as automobile immigration the place the Laos official
will stamp your export paper from the Cambodian aspect. We needed to pay 10,000 Riel (or $2.50) for this
stamp. Nevertheless this isn’t the doc which might be required to enter Laos along with your bike.
That is mainly only a stamp for the customs official in Laos to see that the export paper from
Cambodia has been stamped on the Laos aspect.

As soon as we received to immigration on the Laos aspect, the immigration official, advised us that we couldn’t enter
Laos with our bike and if we nonetheless wished to buy a Laos visa.
At this level we had been confused as a result of we assumed that the stamp from the so referred to as “automobile
immigration” was sufficient. At this level the immigration officer requested us to go to talk to customs for
additional
clarification.

The Lao customs official couldn’t (or refused) to talk English with us.
Nevertheless, a neighborhood Lao information who was on the border with one other tour group, helped translate for us.
In response to the Lao customs official there is a new rule that solely organized bike excursions are allowed
to enter Laos with a bike.
The excursions should have a neighborhood Lao information and official paperwork. The Lao customs official did not even attempt
to ask us for cash to get round the issue, he simply
flat out refused to allow us to enter with the bike.

We determined to contact Mara’s highschool buddy (the customs official on the Cambodian aspect) to see if
he might assist us on the Laos aspect.
He came to visit to the Laos aspect and was additionally shocked about this new rule. He had been issuing paperwork
on the Cambodian aspect however by no means had
this downside earlier than. He spoke with the Lao customs official, however he nonetheless did not enable us to enter. So
we ready to take our bike again
to the Cambodian aspect, go away it on the border and take a bus to Pakse.

Within the meantime, our Cambodian customs official buddy was talking with boss of the Lao customs
official, and eventually he got here to us and stated
they might make an exception this time. If it wasn’t for our buddy on the Cambodian aspect there was no
likelihood of us getting the bike into Laos, even with the
right paperwork.

The Lao customs official charged us 50,000 Riel ($12.50) for the bike papers to enter Laos (I am
fairly certain that is greater than the official quantity) however we had been
blissful to pay anyway. A Laos Vacationer Visa additionally prices $40.


There may be actually nothing on the Laos aspect of the border. No outlets. No ATMs. No cash changers. Only a
highway (with not a lot site visitors). That is why in case you are touring by bike
you will need to have some Lao Kip earlier than you cross in case you’ll want to cease to purchase water or petrol or
one thing.

Street to Don Det

After getting into Laos, we put requested Google maps to present us instructions to
Don Det
(a part of the 4,000
islands
) the place we deliberate on staying the evening.
I do not actually belief Google Maps in Cambodia and have been burnt a couple of occasions, so I double checked to see
if the route appeared affordable.
I might see a bridge over the Mekong to
Don Khong, a ferry
to
Don Som, and eventually
one other ferry to
Don Det.
This sounded affordable (and enjoyable!) so we headed for our first cease Don Khong.

River crossing from Don Khong to Don Som

After crossing the bridge onto Don Khong, there is a brief highway to the ferry crossing. It prices 20,000
Lao Kip (approx $1) to cross over to Don Som.

The Don Som Street

The Don Som Street is tough however stunning. Principally it is only a slender path by way of the rice fields.
Alongside the way in which I
had some points with my chain coming off, however we ultimately discovered a small store promoting drinks and
doubling as a mechanic who helped repair it.

Don Det and Don Khon

Don Det and Don Khon are related by a bridge. Each islands are far more touristy than Don Som and all
the roads are paved. We visited the
Liphi Somphamit Waterfalls and the Previous French Port and loved a couple of beers earlier than discovering a spot to
keep on Don Khon.




Day 3 – Don Det to Pakse


We left Don Det on the ferry to Nakasong which takes round 20 minutes. That is after we realized that
truly Google Maps advised us to go unsuitable manner on the day before today.
From Nakasong you simply take the primary freeway 13 all the way in which to Pakse. Nakasong is mainly the gateway
to
Don Det
and the
4,000 islands.

Alongside the way in which we received burnt by Google Maps once more whereas looking for a waterfall within the Bolaven Plateau.
After using on a mud monitor for a couple of kilometers
I had points with my chain once more. We discovered a rubber plantation and one of many staff helped me repair the
chain till we might discover a correct mechanic.
We determined to surrender on the waterfall and head for Pakse.

Organising the Early Warning System in Pakse

That is the technical a part of the publish so be happy to skip it in case your not !

Background

As a way to have a greater understanding about how we setup the Early Warning System in Laos, it is
helpful to grasp the way it works in Cambodia.
Somleng is already
powering the
National Early Warning System of Cambodia
in collaboration with the Folks In Want.
On this system, Somleng is related to every of the primary Cellular Community Operators as proven Determine 1
and Determine 2 beneath.

Early Warning System Registration (Cambodia)

Beneficiaries register to the Early Warning System by calling to 1294 and following the IVR prompts.

Determine 1 – Early Warning System Registration (Cambodia)
  1. Beneficiaries register for the Early Warning System by calling 1294.
  2. After receiving a name the Cellular Community Operators ship a
    SIP
    Invite
    to
    SomlengSWITCH.
  3. SomlengSWITCH sends details about the decision to
    Somleng which
    determines the
    SIP Trunk,
    Carrier and
    Phone Number.
  4. The telephone quantity 1294 is configured with a
    Voice URL
    which factors to
    Somleng SCFM.
    SomlengSWITCH can now use this Voice URL to request
    TwiML
    from Somleng SCFM which incorporates the IVR logic for registering the beneficiary. The beneficiary
    particulars are saved in SCFM for future use as seen Determine 2 beneath.
Early Warning System Broadcast (Cambodia)

In case of an emergency akin to a flood or different pure catastrophe, beneficiaries are notified through a
recorded message
delivered to their cell phone.

Determine 2 – Early Warning System Broadcast (Cambodia)
  1. A Authorities official logs into the Early Warning System Dashboard (powered by Folks In Want) and
    creates an emergency broadcast message message.
  2. The Early Warning System Dashboard makes use of the
    Somleng SCFM API to create a callout and
    populate it with beneficiaries who’ve
    registered utilizing the registration movement described above.
  3. Somleng SCFM creates telephone calls on Somleng utilizing the
    Somleng REST API
  4. Somleng queues calls to SomlengSWITCH.
  5. SomlengSWITCH sends a
    SIP
    Invite
    to the corresponding Cellular Community Operator
    of the beneficiary.
  6. The beneficiary receives the decision and listens to the recorded broadcast message.

Laos Setup

As a way to energy a pilot Early Warning System in Laos with out the executive purple tape required to
connect with the native cellular community operators,
we use
Somleng’s Client
Gateway
function to ship the service whereas bypassing the cellular community operators.
Figures 3 and 4 beneath present the way it works.

Early Warning System Registration (Laos)

Beneficiaries register to the Early Warning System by calling to marketed native numbers inserted in
the VoIP Gateway.

Determine 3 – Early Warning System Registration (Laos)
  1. Beneficiaries name to marketed native numbers which is inserted into the VoIP gateway.
  2. The VoIP gateway receives the decision and sends a
    SIP
    Invite
    to
    SomlengSWITCH.
  3. SomlengSWITCH sends details about the decision to
    Somleng which
    determines the
    SIP Trunk,
    Carrier and
    Phone Number.
  4. The referred to as quantity is configured with a
    Voice URL
    which factors to
    Somleng SCFM.
    SomlengSWITCH can now use this Voice URL to request
    TwiML
    from Somleng SCFM which incorporates the IVR logic for registering the beneficiary. The beneficiary
    particulars are saved in SCFM for future use as seen Determine 4 beneath.
Early Warning System Broadcast Move (Laos)

In case of an emergency akin to a flood or different pure catastrophe, beneficiaries are notified through a
recorded message
delivered to their cell phone.

Determine 4 – Early Warning System Broadcast Move (Laos)
  1. A Authorities official logs into the Early Warning System Dashboard (powered by Folks In Want) and
    creates an emergency broadcast message message.
  2. The Early Warning System Dashboard makes use of the
    Somleng SCFM API to create a callout and
    populate it with beneficiaries who’ve
    registered utilizing the registration movement described above.
  3. Somleng SCFM creates telephone calls on Somleng utilizing the
    Somleng REST API
  4. Somleng queues calls to SomlengSWITCH.
  5. SomlengSWITCH sends a
    SIP
    Invite
    to the VoIP Gateway.
    of the beneficiary.
  6. The beneficiary receives the decision and listens to the recorded broadcast message.

As you may see each the registration movement and broadcast movement for the Laos system is sort of equivalent
because the Cambodian system.
The primary level of distinction being that we’re changing the cellular community operators with an
off-the-shelf VoIP Gateway.

There are in fact some limitations of this setup akin to:

  1. The utmost throughput of the system is restricted to the variety of channels within the VoIP gateway.
  2. Solely full native Lao cellular numbers can be utilized versus a single brief code.
  3. An area entity wants to make sure that the SIM playing cards are lively. For instance pay as you go playing cards have sufficient
    steadiness, and postpaid playing cards have their payments paid.

Then again, the good thing about this method, is that it may be constructed completely with open supply
software program and off-the-shelf {hardware}.


The Journey Residence

The remainder of this weblog publish covers our journey again to Cambodia through the scenic route. 🤣

Day 1 – Pakse to the Laos-Cambodian Border through Wat Phou

We left Pakse with the intention of constructing it again to Stung Treng, nonetheless we noticed an indication
Wat Phou round 30
km south of Pakse, so we determined to show off and have a look.
We arrived at a small village the place the ferry terminal is, however we by accident took the unsuitable highway
all the way down to the river financial institution. There was a younger woman with a small picket boat
who gestured that she would take us throughout the Mekong river to Champasak city. Mara wasn’t certain about
the security of the boat as you will see within the movies beneath. 😂

After making it safely throughout the river we rode south alongside the western aspect of the Mekong to
Wat Phou (ວັດພູ).
Entrance is just 100,000 Lao Kip (approx $5) per particular person and it is nicely value it because the temple is
magnificent.




After leaving Wat Phou, we determined to remain on the western aspect of the Mekong and proceed heading
south.
The plan was to discover a ferry again to
Don Khong
after which cross again over the identical bridge that we took on
the road to Don Det.
The highway was fairly tough however the surroundings was stunning.

We ultimately discovered a ferry crossing earlier than we reached Don Khong and crossed again over to the japanese
aspect of the Mekong to the primary freeway and headed for the border, arriving round 5.00pm.

Shortly after crossing into Cambodia it began to piss down with rain.
Luckily we bumped into Mara’s highschool buddy (who helped us with the Bike paperwork at
the border on the way in).
He satisfied us to not attempt to experience to Stung Treng within the rain and darkish and prompt that now we have a
couple of beers with him.
So we did and ended up staying the evening at his buddy’s home simply close to the border.

Day 2 – Homeward certain through Kampong Cham

It rained just about all day, which made the journey a bit gradual. We stopped in
Kratie
for lunch, earlier than using alongside the Mekong to Kampong Cham the place we spent the evening earlier than heading residence
the following day.

Residence protected

We arrived residence protected and sound. Hopefully we get the possibility to go to Laos and it is stunning folks
once more within the close to future!

Introducing Programmable SMS

January 27, 2023

In October 2022,
we introduced DIY programmable voice,
permitting prospects to roll their very own Twilio and make actual calls
by way of their VoIP gateways.

In the present day we’re excited to announce official assist for SMS.

With this new function carriers can provide programmable SMS to their prospects by
configuring an SMS
Gateway
and connecting it to
their present SMS infrastructure.

People and organizations may also use this function by connecting their SMS gateway to a tool that
helps SMPP, akin to a
VoIP gateway or
SIM Box .

After the connection is configured, prospects can programmatically ship and obtain SMS by way of their
SMS gateway utilizing the
REST API .

Go to
our documentation
for extra info on the way to configure programmable SMS on Somleng.


Be aware: Utilizing SMS gateways is restricted in some international locations.
We advocate that you just verify your native legal guidelines and laws earlier than continuing with
this methodology.

Introducing DIY Programmable Voice

October 14, 2022

At Somleng, one in every of our largest buyer bases are NGOs. One of many causes that NGOs select us is
as a result of we work with native carriers
instantly. This permits us to offer cloud communication providers in new markets the place it is in any other case
unavailable, or with higher high quality, and
a fraction of
the cost of our competitors
.

Though working with native carriers improves high quality and reduces prices, one of many largest ache factors
for our prospects
is definitely participating with and arriving at a industrial settlement with a neighborhood service.
Typically our prospects wish to get one thing up and working rapidly to show an idea or do a pilot,
with out
participating with their native service.

Bypassing Carriers

It seems that it is truly doable to entry the native public switched phone community (PSTN)
and not using a industrial settlement with a neighborhood service.
All you want is a
VoIP gateway and a number of SIM playing cards.
A VoIP gateway has interfaces to each IP networks and the PSTN and handles the bridging between them.
One interface could be related to the Web and the opposite
to the PSTN, through SIM card(s) inserted into the VoIP gateway.
VoIP gateways vary in dimension 1 from to 128 channels or extra. The extra channels you will have the extra
concurrent calls you may assist.

In the present day we’re excited to announce official assist for VoIP gateways on Somleng.

With this new function prospects can
sign up
and join their VoIP gateway to Somleng by
configuring a client
gateway connection
.

After the connection is configured, prospects can programmatically make outbound calls by way of your VoIP
gateway utilizing the
REST API ,
and programmatically management each outbound and inbound calls through TwiML.


Be aware: Utilizing VoIP gateways is restricted in some international locations.
We advocate that you just verify your native legal guidelines and laws earlier than continuing with
this methodology.

Community Suppliers

This new function additionally opens up new enterprise alternatives for people or organizations to offer
entry to the
PSTN of their nation through a VoIP gateway that they personal or handle. We name the sort of consumer a
Network Provider ,
and like carriers, they’ll additionally create buyer accounts on Somleng.

Any account that the Community Supplier creates, is managed by them and has its personal set of
REST API
credentials and account administration interface.
A community supplier can due to this fact onboard their very own prospects,
by creating them an account and offering them with PSTN entry by way of their VoIP gateway(s).

This may be mixed with our
custom domains feature
function leading to a completely custom-branded expertise on your buyer.

We do not but have a manner for a community supplier to monetize this enterprise movement instantly on the Somleng
platform, however it’s one thing we are going to take into account
if sufficient customers request this function.

Keep Tuned

At the moment our shopper gateway function solely helps Programmable Voice, however keep tuned as a result of we’re
including SMS assist subsequent!

Be your personal Twilio

June 10, 2022

Following on from our introductory weblog publish
The Somleng Story on this publish we’ll do a deep dive into
how native carriers can provide programmable voice to their prospects through Somleng.

Why carriers ought to provide programmable voice to their prospects?

Programmable voice has a wide range of totally different use-cases akin to:

  • Alerts and Notifications – e.g. password resets, low steadiness alerts, invoice reminders, fraud warnings.
  • Interactive Voice Response (IVR)
  • Catastrophe Administration, mHealth and more .

Twilio has change into the de-facto go-to resolution for programmable voice and
profits exorbitantly
because of this. However truly native carriers can provide a lot
cheaper
pricing

and higher high quality since they’re the custodians of the community.

By providing programmable voice as an answer, native carriers can share within the earnings and procure an
benefit
over their rivals all whereas defending their very own branding.

What’s Somleng?

Somleng is an Open Supply, white-labeled, Cloud Communications as a Service (CPaaS) resolution.
In contrast to Twilio, which is a world centralized CPaaS designed for platform customers instantly,
Somleng is designed for carriers and community operators.

As an alternative of platform customers signing up instantly on Somleng, Carriers as an alternative enroll
for a Somleng service account and handle their very own buyer accounts.

With the discharge of our new
custom domains
function,
a service can now configure their very own {custom} area and branding, offering a completely branded CPaaS
resolution their platform prospects.

Carriers can then invite their prospects to their branded dashboard through their {custom} area the place the
buyer can handle their very own account and API credentials.
The client can then use Somleng’s REST API for programmable voice.

Personalized Somleng dashboard as considered by a service buyer.
Personalized Somleng API docs as considered by a service buyer.

Wrapping up

Public signal ups are at the moment obtainable for carriers solely.
Should you work for a service and are considering making an attempt issues out please learn by way of our
carrier documentation ,
the place you will discover hyperlink to join a trial account.

The Somleng Story

June 9, 2022

For some time now, Twilio has change into the king of cloud communications.
Though there was a couple of clones pop up through the years, e.g. Vonage, Message Chicken, and so forth.
the house has remained comparatively identical identical. Till now…

Somleng has the bold objective of revolutionizing the cloud communications house turning it on its head.
We purpose to take the ability of cloud communications away from Massive Tech’s monopoly and convey it to the
folks.
However to grasp the place we’re going and why, it is vital to grasp the place we have come from.

🇰🇭 Cambodian Courting

Beginning again in 2012 Somleng’s predecessor was a SMS and Voice powered courting service referred to as Chibi.
Launching in Cambodia, earlier than the Smartphones and Fb had been ever actually a factor (in Cambodia at
least)
subscribers would dial right into a short-code and be randomly related to a different subscriber.
Principally a chat roulette that labored over an peculiar voice name.

Subscribers might additionally ship textual content messages
to their new ‘buddy’ by merely texting to the brief code. Chibi would scan the messages,
and construct up a fundamental profile of the subscriber, making an attempt to find out their age, gender and placement.

The service was surprisingly well-liked, at its peak having greater than 120,000 subscribers. However by 2015,
smartphones and Fb had taken over in Cambodia and Chibi ultimately died.

🇰🇭 Nationwide Early Warning System

Round 2016, the Royal Cambodian Authorities in partnership with the NGO Folks In Want,
had been searching for an answer for the
National Early
Warning System
.

The necessities had been easy. In case of a pure catastrophe (akin to a flood),
a authorities official might report a voice message and ship it through telephone name to residents within the
affected areas.

Programmable voice is an ideal resolution to this downside. Voice messages are recorded in Khmer,
so it does not require the beneficiary be literate, have a wise telephone nor have entry to the Web.
They simply choose up the
telephone and take heed to the knowledge recorded by the federal government official.

Our expertise with constructing scalable communications platform to energy Chibi
meant that the timing was excellent for a pivot and Somleng was born.

In the present day Somleng remains to be powering Cambodia’s Early Warning System.

🇺🇳 UNICEF Innovation Fund and Digital Public Good

In 2016 Somleng was
among the first five companies to receive investment
from
the UNICEF Innovation Fund, with a view to scale Somleng to assist different use-cases.

Since then the UNICEF Innovation Fund been Somleng’s major investor which has enabled us to develop far
past
Cambodia. Somleng is now powering cloud communications options across the world
impacting over 250K beneficiaries throughout 11 totally different international locations.

Somleng was additionally not too long ago made a Digital Public Good recognition
that Somleng is a product that helps to create a extra equitable world.

Our Imaginative and prescient and Roadmap

There is a rising consensus that the Web is simply too centralized managed by too few gamers.
It is no totally different within the cloud communications house. Massive Tech controls many of the house
and there are few choices for people, small and medium sized firms, governments and NGOs.

Somleng’s imaginative and prescient is a world the place communications are accessible to everybody.
As a way to obtain this imaginative and prescient we have to suppose outdoors the field and supply an answer advantages
everybody, not simply Massive Tech.

Be your personal Twilio

Step one for Somleng, is to stage the enjoying area for native carriers (for clarification a neighborhood
service
is a neighborhood telecom firm, cellular community operator or aggregator).

Twilio’s et al. enterprise mannequin relies on a centralized Cloud Communications Platform as a Service
(CPaaS). They cost an
costly premium (particularly in rising markets), to mainly act as a middle-man between the
platform consumer and the beneficiary.

However what if a neighborhood service, who controls the community connectivity of their area or nation,
might be their very own Twilio? They might present the same service to Twilio at a
fraction of
the cost
by chopping them out of the movement.

Along with the diminished prices for the platform consumer, the native service can defend their very own branding
and generate
extra income streams.

Somleng now helps
custom domains
permitting carriers to leverage Somleng’s API and Dashboard, whereas preserving their very own branding.
Alternatively, since Somleng is 100% open supply, native carriers can at all times host Somleng
on their very own servers.

Be your personal service

Whereas supporting native carriers is an efficient first step, there’s nonetheless a stage of centralization on the
native service stage.
In different phrases, Somleng now offers an answer to dissipate the monopoly of cloud communications from
Massive Tech
to native carriers, however we are able to nonetheless go a step additional to deliver the ability to people and
organizations instantly.

One of many options we’ll be engaged on within the coming months is named “Be your personal service”.
The thought is that any particular person, enterprise or group can use Somleng to change into a Community Supplier,
and supply the connectivity layer
required for cloud communications, and in a future iteration, even be capable to earn cash from it.

The thought is kind of easy. Utilizing available, off-the-shelf {hardware} akin to a GSM Gateway or GSM
Modem,
a community supplier can present connectivity to their native cellular community and register their route with
Somleng.
Somleng will then route calls and SMS to/from the community supplier to offer programmable voice and SMS
to the platform consumer.

A easy use-case for that is dealing with telephone quantity verification through programmable voice.
So as do obtain this now, you’ll want to use a service like Twilio or Firebase.
Nevertheless with Somleng’s “Be your personal service” function the appliance proprietor can register as a Community
Supplier,
and their utility can provoke a name through Somleng’s REST API.
The decision is then routed through the community supplier’s {hardware} to the beneficiary’s telephone.

Now that any particular person or group can be their very own service by turning into a community
supplier,
the foundations are in place for a world market of community suppliers and native carriers.

A extra equitable CPaaS Financial system

The ultimate step in Somleng’s CPaaS revolution is to leverage the worldwide community of native carriers and
community suppliers
to offer a extra equitable CPaaS economic system. Native operators and community suppliers could make their routes
publicly obtainable
and set their very own costs and be compensated for each interplay that goes by way of their route. In
concept this could
create competitors for who can provide the most affordable, highest high quality routes.

Wrapping up

We’re excited in regards to the journey that we’re on and proud to be doing issues in a different way.
A particular because of the UNICEF Innovation Fund group who’ve supported us from the start.

Source Link

What's Your Reaction?
Excited
0
Happy
0
In Love
0
Not Sure
0
Silly
0
View Comments (0)

Leave a Reply

Your email address will not be published.

2022 Blinking Robots.
WordPress by Doejo

Scroll To Top