-
Notifications
You must be signed in to change notification settings - Fork 18
Expand file tree
/
Copy pathdocs.html
More file actions
4942 lines (4355 loc) · 210 KB
/
docs.html
File metadata and controls
4942 lines (4355 loc) · 210 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE html>
<html lang='en'>
<head>
<meta class="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
<title>Somleng | Documentation</title>
<link rel='stylesheet' href='css/style.min.css' />
<link rel='stylesheet' href='css/custom.css' />
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/font-awesome/6.1.1/css/all.min.css">
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/themes/prism-dark.min.css">
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/line-numbers/prism-line-numbers.min.css" />
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/toolbar/prism-toolbar.min.css" />
<link rel="stylesheet"
href="https://cdnjs.cloudflare.com/ajax/libs/prism/1.29.0/plugins/command-line/prism-command-line.min.css" />
<!-- favicon -->
<link rel="apple-touch-icon" sizes="180x180" href="apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="favicon-16x16.png">
<link rel="manifest" href="site.webmanifest">
<link rel="mask-icon" href="safari-pinned-tab.svg" color="#06d19c">
<meta name="msapplication-TileColor" content="#6c63ff">
<meta name="theme-color" content="#6C63FF">
</head>
<body>
<!-- navbar -->
<div class="navbar navbar--extended">
<nav class="nav__mobile"></nav>
<div class="container">
<div class="navbar__inner">
<a href="index.html" class="navbar__logo"><img src="./images/somleng_logo.png" class="step__image"
height="75px"></a>
<nav class="navbar__menu">
<li><a href="docs.html">Documentation</a></li>
<li><a href="open_source.html">Open Source</a></li>
<li><a href="case_studies.html">Case Studies</a></li>
<li><a href="blog.html">Blog</a></li>
</nav>
<div class="navbar__menu-mob"><a href="" id='toggle'>
<svg role="img" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512">
<path fill="currentColor"
d="M16 132h416c8.837 0 16-7.163 16-16V76c0-8.837-7.163-16-16-16H16C7.163 60 0 67.163 0 76v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16zm0 160h416c8.837 0 16-7.163 16-16v-40c0-8.837-7.163-16-16-16H16c-8.837 0-16 7.163-16 16v40c0 8.837 7.163 16 16 16z"
class=""></path>
</svg>
</a></div>
</div>
</div>
</div>
<!-- Hero unit -->
<div class="page__header">
<div class="hero__overlay hero__overlay--gradient"></div>
<div class="hero__mask"></div>
<div class="page__header__inner">
<div class="container">
<div class="page__header__content">
<div class="page__header__content__inner" id='navConverter'>
<h1 class="page__header__title">Documentation</h1>
</div>
</div>
</div>
</div>
</div>
<!-- Page content -->
<div class="page">
<div class="container">
<div class="page__inner">
<div class="page__menu">
<ul class="vMenu">
<li><a href="#open-source-documentation">Open Source Documentation</a></li>
<li><a href="#terminology">Terminology</a></li>
<li><a href="#audience">Audience</a></li>
<li><a href="#introduction">Introduction</a></li>
<li><a href="#getting-started">Getting Started</a></li>
<li>
<a href="#tutorials">Tutorials</a>
<ul>
<li>
<a href="#verify-tutorial">Build your own Phone Verification Service</a>
</li>
<li>
<a href="#chime-tutorial">Connect Somleng to Amazon Chime</a>
</li>
<li>
<a href="#invite-customers-tutorial">Invite customers to use your CPaaS</a>
</li>
<li>
<a href="#retell-ai-tutorial">Connect Somleng with Retell AI</a>
</li>
</ul>
</li>
<li>
<a href="#using_the_dashboard">Using the Dashboard</a>
<ul>
<li>
<a href="#authentication">Authentication</a>
</li>
<li>
<a href="#carrier_settings">Carrier Settings</a>
</li>
<li>
<a href="#dashboard-accounts">Accounts</a>
</li>
<li>
<a href="#phone_numbers">Phone Numbers</a>
</li>
<li>
<a href="#voice">Voice</a>
</li>
<li>
<a href="#messaging">Messaging</a>
</li>
<li>
<a href="#team">Team</a>
</li>
</ul>
</li>
<li><a href="#custom_domains_configuration_guide">Custom Domain Configuration Guide</a></li>
<li><a href="#client_gateway_configuration_guide">Client Gateway Configuration Guide</a></li>
<li><a href="#sms_gateway_configuration_guide">SMS Gateway Configuration Guide</a></li>
<li><a href="#installation-guide">Installation Guide</a></li>
<li><a href="#rtp_symmetric_latching">RTP and Symmetric Latching</a></li>
<li><a href="docs/carrier_api" target="_blank">API Reference</a> <i class="fa fa-external-link"></i></li>
<li><a href="docs/twilio_api" target="_blank">Account API Reference</a> <i class="fa fa-external-link"></i>
</li>
<li><a href="https://github.com/somleng/somleng-project" target="_blank">Github <i
class="fa fa-external-link"></i></a></li>
</ul>
</div>
<div class="page__main">
<div class="text-container">
<img src="./images/undraw_Add_files_re_v09g.png" class="expanded__image">
<div id="open-source-documentation">
<h3 class="page__main__title">
Open Source Documentation
</h3>
<p>
This documentation is
<a href="https://github.com/somleng/somleng-project/blob/main/public/website/docs.html" class="link"
target="_blank">Open Source <i class="fa fa-external-link"></i></a> and written in plain HTML. If you
see an error or want to
contribute to improving the
docs, please consider submitting a
<a href="https://github.com/somleng/somleng-project/fork" class="link" target="_blank">pull request <i
class="fa fa-external-link"></i></a>.
</p>
</div>
<hr />
<div id="terminology">
<h3 class="page__main__title">
Terminology
</h3>
<p>
Before we begin, here is some general terminology that is important for understanding this article.
</p>
<p>
<table>
<thead>
<tr>
<th>Term</th>
<th>Meaning</th>
</tr>
</thead>
<tbody>
<tr id="carrier">
<td>Carrier</td>
<td>A carrier (telecom company, mobile network operator (MNO), aggregator etc) who offers routes
to/from the Public Switched Telephone Network (PSTN). E.g. AT&T, Verizon</td>
</tr>
<tr id="byoc_user">
<td>BYOC Entity</td>
<td>
An individual or organization who has a business relationship with a carrier. E.g. a carrier's
customer.
BYOC stands for Bring Your Own Carrier.
</td>
</tr>
<tr id="network_provider">
<td>Independent Entity</td>
<td>An individual or organization with their own VoIP/SMS gateway.</td>
</tr>
</tbody>
</table>
</p>
</div>
<hr />
<div id="audience">
<h3 class="page__main__title">
Audience
</h3>
<p>
This documentation is intended for Carriers, and BYOC entities, and Independent entities as defined
above.
</p>
</div>
<hr />
<div id="introduction">
<h3 class="page__main__title">
Introduction
</h3>
<p>
Somleng is an Open Source, white-labeled, Cloud Communications Platform as a Service (CPaaS), and
Telco-as-a-Service (TaaS) featuring programmable voice and SMS.
</p>
<p>
There are a number of different use-cases depending on your role as a Carrier, BYOC entity or
Independent entity as defined above.
</p>
<p>
Here are some common use-cases:
</p>
<ul>
<li>
Carriers use Somleng to offer their own branded CPaaS services to their customers. Some examples of
carriers who use Somleng are
<a href="https://www.c3ntro.com/global" class="link">C3ntro Telecom <i
class="fa fa-external-link"></i></a> and
<a href="https://www.fibernetics.ca/" class="link">Fibernetics <i
class="fa fa-external-link"></i></a>.
</li>
<li>
BYOC entities use Somleng directly by connecting to their carrier that they have a business
relationship with. Some examples of BYOC entities who use Somleng are
<a href="case_studies.html#cash-assistance-programme-somalia" class="link">UNICEF <i
class="fa fa-external-link"></i></a> and
<a href="case_studies.html#early-warning-system-cambodia" class="link">People In Need <i
class="fa fa-external-link"></i></a>.
</li>
<li>
Independent entities use Somleng directly by connecting through a VoIP/SMS Gateway that they own or
manage. An example of an Independent entity who uses Somleng is
<a href="case_studies.html#blockchain-based-cash-distribution-pilot-nepal" class="link">Rumsan <i
class="fa fa-external-link"></i></a>.
</li>
</ul>
<p>
It's also possible for both BYOC and Independent entities to create their own branded CPaaS with Somleng
by leveraging their existing connection to a carrier or VoIP/SMS Gateway.
</p>
</div>
<hr />
<div id="getting-started">
<h3 class="page__main__title">
Getting Started
</h3>
<p>
We highly recommend trying out Somleng by signing up for a <a
href="https://app.somleng.org/users/sign_up" class="link" target="_blank">free carrier account <i
class="fa fa-external-link"></i></a>, then working through the <a href="#tutorials"
class="link">tutorials</a>. This will
allow you
explore and understand Somleng's features without having
to worry about installing the full-stack on your local machine.
</p>
<p>
If you are looking to install Somleng on your local machine, please
read the <a href="#installation-guide" class="link">Installation Guide</a>.
</p>
<p>
All users are required to setup two factor authentication (2FA) the first time they sign in to the
Dashboard.
We recommend <a href="https://authy.com/" class="link" target="_blank">Authy <i
class="fa fa-external-link"></i></a>,
<a href="https://en.wikipedia.org/wiki/Google_Authenticator" class="link" target="_blank">Google
Authenticator <i class="fa fa-external-link"></i></a> or your password manager to setup 2FA.
</p>
</div>
<hr />
<div id="tutorials">
<h3 class="page__main__title">
Tutorials
</h3>
<p>
This section contains various tutorials which will help you learn more about Somleng's features.
We recommend that you complete the tutorials using a <a href="https://app.somleng.org/users/sign_up"
class="link" target="_blank">free carrier account <i class="fa fa-external-link"></i></a> rather than
a local installation.
</p>
<div id="verify-tutorial">
<h3>
Build your own Phone Verification Service
</h3>
<p>
In this tutorial you will build your own Phone Verification Service which can then be used by your own
applications.
</p>
<h4>
Prerequisites
</h4>
<ol>
<li>
Sign up for a <a href="https://app.somleng.org/users/sign_up" class="link" target="_blank">free
carrier account <i class="fa fa-external-link"></i></a>.
</li>
<li>
Verify your email address.
</li>
<li>
Login and setup two factor authentication (2FA).
</li>
<li>
<a href="https://docs.docker.com/engine/install/" class="link" target="_blank">Install Docker <i
class="fa fa-external-link"></i></a> on your local machine.
</li>
</ol>
<h4>
Overview
</h4>
<p>
Below is an overview of the steps required to complete this tutorial:
</p>
<ol>
<li>
<a href="#verify-tutorial-step-1" class="link">
Create a Customer Account.
</a>
</li>
<li>
<a href="#verify-tutorial-step-2" class="link">
Create a Verification Service.
</a>
</li>
<li>
<a href="#verify-tutorial-step-3" class="link">
Create a SMS Gateway.
</a>
</li>
<li>
<a href="#verify-tutorial-step-4" class="link">
Create a SIP Trunk.
</a>
</li>
<li>
<a href="#verify-tutorial-step-5" class="link">
Run the Somleng SMS Gateway Application.
</a>
</li>
<li>
<a href="#verify-tutorial-step-6" class="link">
Register your softphone with the SIP Trunk.
</a>
</li>
<li>
<a href="#verify-tutorial-step-7" class="link">
Start a new Verification Flow.
</a>
</li>
<li>
<a href="#verify-tutorial-step-8" class="link">
Receive the verification code via the SMS Gateway Application.
</a>
</li>
<li>
<a href="#verify-tutorial-step-9" class="link">
Resend the verification code via a call.
</a>
</li>
<li>
<a href="#verify-tutorial-step-10" class="link">
Receive the verification via a call.
</a>
</li>
<li>
<a href="#verify-tutorial-step-11" class="link">
Complete the Verification Flow.
</a>
</li>
</ol>
<div id="verify-tutorial-step-1">
<h4>
1. Create a Customer Account.
</h4>
<p>
In this step you create a new
<a href="#dashboard-accounts" class="link">customer account</a> (not to be confused with your
carrier account) which will generate a set of
credentials used to authenticate to the Verify API.
</p>
<p>
Perform the following steps:
</p>
<ol type="a">
<li>
Under the <strong>Accounts</strong> menu, click the <strong><i class="fas fa-plus"></i></strong>
icon to create a new account.
</li>
<li>
Give the account a <strong>name</strong>.
</li>
<li>
Choose a premium TTS voice (such as <strong>Polly.Joanna</strong>) from the default TTS Voice
dropdown.
This will be used by your verification service to determine the TTS provider (Basic or Polly) when
sending verification codes via phone call.
</li>
<li>
Press <strong>Create Account</strong>.
</li>
</ol>
<img src="./images/dashboard-new-account.png">
</div>
<div id="verify-tutorial-step-2">
<h4>
2. Create a Verification Service.
</h4>
<p>
In this step you create a new Verification Service and assign it to the account created in
<a href="#verify-tutorial-step-1" class="link">Step 1</a>.
A Verification Service is the set of common configurations used to create and check verifications.
</p>
<p>
Perform the following steps:
</p>
<ol type="a">
<li>
Under the <strong>Verify</strong> menu, select <strong>Services</strong>.
</li>
<li>
Click the <strong><i class="fas fa-plus"></i></strong> icon to create a new verification service.
</li>
<li>
Give your verification service a <strong>friendly name</strong>. This is the brand name that
appears in the body of your verification messages.
</li>
<li>
Assign your verification service to the <strong>account</strong> you created in <a
href="#verify-tutorial-step-1" class="link">Step 1</a>.
</li>
<li>
Press <strong>Create Verification service</strong>.
</li>
</ol>
<img src="./images/dashboard-new-verification-service.png">
</div>
<div id="verify-tutorial-step-3">
<h4>
3. Create a SMS Gateway.
</h4>
<p>
In this step you create a new SMS Gateway which will handle the delivery of verification codes via
SMS.
</p>
<p>
<em>
Note: In this step there is no need to connect the SMS gateway to your customer account. The SMS
Gateway will handle the delivery of SMS messages across all of your customer accounts.
</em>
</p>
<p>
Perform the following steps:
</p>
<ol type="a">
<li>
Under the <strong>Messaging</strong> menu, select <strong>SMS Gateways</strong>.
</li>
<li>
Click the <strong><i class="fas fa-plus"></i></strong> icon to create a new SMS gateway.
</li>
<li>
Give your SMS Gateway a <strong>name</strong>.
</li>
<li>
Enter a <strong>Default sender</strong>. This will be used as the sender id when sending
verification codes. A default sender can an E.164 number or short code.
</li>
<li>
Press <strong>Create SMS gateway</strong>.
</li>
</ol>
<img src="./images/dashboard-new-sms-gateway.png">
</div>
<div id="verify-tutorial-step-4">
<h4>
4. Create a SIP Trunk.
</h4>
<p>
In this step you create a new SIP Trunk which will handle the delivery of verification codes via
phone call.
</p>
<p>
<em>
Note: Similar to the SMS Gateway, there is no need to connect the SIP Trunk to your customer
account. The SIP Trunk
will handle the delivery
of voice calls across all of your customer accounts.
</em>
</p>
<p>
Perform the following steps:
</p>
<ol type="a">
<li>
Under the <strong>Voice</strong> menu, select <strong>SIP Trunks</strong>.
</li>
<li>
Click the <strong><i class="fas fa-plus"></i></strong> icon to create a new SIP trunk.
</li>
<li>
Under Authentication mode, choose <strong>Client credentials</strong>.
</li>
<li>
Give your SIP Trunk a <strong>name</strong>.
</li>
<li>
Enter a <strong>Default sender</strong>. This will be used as the sender id when sending
verification codes via phone call. A default sender can an E.164 number or short code.
</li>
<li>
Press <strong>Create SIP trunk</strong>.
</li>
</ol>
<img src="./images/dashboard-new-sip-trunk-client-credentials.png">
</div>
<div id="verify-tutorial-step-5">
<h4>
5. Run Your SMS Gateway (Node Application or Android App)
</h4>
<p>
In this step, you'll run the SMS Gateway you created in
<a href="#verify-tutorial-step-3" class="link">Step 3</a>. Somleng provides two options for running
your gateway:
</p>
<ul>
<li>
<strong>Option A: Somleng SMS Gateway (Node.js Application)</strong> –
<a href="https://github.com/somleng/sms-gateway" class="link" target="_blank">
Github Repository <i class="fa fa-external-link"></i></a>.
<br>
This application runs on your local machine or server and allows you to:
<ul>
<li>Run in <strong>dummy mode</strong> for testing</li>
<li>Connect to an external <strong>SMPP server</strong></li>
<li>Use <strong>GoIP</strong> or other local SMS infrastructure</li>
</ul>
</li>
<li style="margin-top:1em;">
<strong>Option B: Somleng SMS Gateway Android App</strong> –
<a href="https://github.com/somleng/sms-gateway-app" class="link" target="_blank">
Github Repository <i class="fa fa-external-link"></i></a>.
<br>
Install this app on any Android phone to send <strong>real SMS messages</strong> directly from the
device,
without needing a server or Docker.
</li>
</ul>
<p>
Both options require the <em>Device Token</em> you created in
<a href="#verify-tutorial-step-3" class="link">Step 3</a>.
Enter this token during configuration to connect your device to Somleng.
</p>
<h5>Running the Node.js SMS Gateway (Option A)</h5>
<p>
For this tutorial, we will demonstrate using the Node.js SMS Gateway in <strong>dummy mode</strong>.
Use the following command to run the gateway locally. Replace
<em><replace-me-with-your-device-token></em> with the device token from Step 3.
</p>
<pre><code class="language-bash">docker run -p 3210:3210 somleng/sms-gateway \
somleng-sms-gateway -k <replace-me-with-your-device-token> dummy
</code></pre>
<p>
<em>Note: This option requires Docker to be installed.</em>
See the
<a href="https://github.com/somleng/sms-gateway" target="_blank" class="link">
somleng/sms-gateway repository <i class="fa fa-external-link"></i></a>
for more information.
</p>
<p>
Once your SMS Gateway (Node app or Android app) is connected, the Dashboard will show the status as
<strong>Connected</strong>.
</p>
<p>
If you are using the Node.js Application, you can also check the local status page at:
<a href="http://localhost:3210" class="link" target="_blank">
http://localhost:3210 <i class="fa fa-external-link"></i></a>.
</p>
<img src="./images/dashboard-show-sms-gateway.png">
</div>
<div id="verify-tutorial-step-6">
<h4>
6. Register your softphone with the SIP Trunk.
</h4>
<p>
In this step you'll register your softphone with the SIP trunk we created in <a
href="#verify-tutorial-step-4" class="link">Step 4</a>. This will allow you to receive
verification calls on your local machine. In this tutorial we're using the <a
href="https://apps.apple.com/us/app/telephone/id406825478?mt=12" class="link"
target="_blank">Telephone Softphone Application <i class="fa fa-external-link"></i></a> for
Mac, but you can use
whichever softphone you prefer.
</p>
<p>
<em>Note: Instead of registering your softphone, you could register a VoIP gateway that you own
or manage with the SIP trunk. This would allow you to send real voice calls.
</em>
</p>
<p>
To configure your softphone perform the following steps:
</p>
<ol type="a">
<li>
Copy the <strong>Username</strong>, <strong>Password</strong> and <strong>Domain</strong> fields
from the SIP trunk
you created in <a href="#verify-tutorial-step-4" class="link">Step 4</a>.
</li>
<li>
Paste them into the corresponding fields in the account configuration of your softphone.
</li>
<li>
Set the Reregister (or equivalent keep-alive setting) in your softphone to a value of less than 30
seconds.
This will cause your softphone to re-register with Somleng at a regular interval to ensure the
connection stays alive. <em>Note: In order to enable this setting in the Telephone App you need to
disable the account first.</em>
</li>
</ol>
<p>
After you have registered your softphone with the SIP trunk you should see the SIP registration
status update to <strong>Available</strong> on your softphone.
</p>
<p>
The screenshots below show the SIP registration details from the SIP trunk you created in <a
href="#verify-tutorial-step-4" class="link">Step 4</a> and the
corresponding fields in account configuration of the SIP phone.
</p>
<img src="./images/dashboard-show-sip-trunk-client-credentials.png">
<img src="./images/telephone-app-sip-registration.png">
<img src="./images/telephone-app-advanced-reregister.png">
</div>
<div id="verify-tutorial-step-7">
<h4>
7. Start a new Verification Flow
</h4>
<p>
In this step you start a new Verification Flow using the <a
href="https://github.com/somleng/somleng-node" class="link" target="_blank">somleng-node <i
class="fa fa-external-link"></i></a> helper library. In reality this code would be part of you
or your
customer's application which using your Phone Verification Service.
</p>
<p>
<em>
Note: The <a href="https://github.com/somleng/somleng-node" class="link"
target="_blank">somleng-node <i class="fa fa-external-link"></i></a> helper library is just a
light-weight wrapper around the <a href="https://github.com/twilio/twilio-node" class="link"
target="_blank">twilio-node <i class="fa fa-external-link"></i></a> helper library which enables
it to be used with Somleng. This is possible because
Somleng's API is compatible with Twilio's API.
If we don't yet have an official helper library for your programming language, you should be be
able to use the corresponding Twilio helper
library with some minimal configuration changes to make it work with Somleng. Alternatively you
can connect to Somleng's API directly by following the
<a href="docs/twilio_api" class="link" target="_blank">API docs <i
class="fa fa-external-link"></i></a>.
</em>
</p>
<p>
Run the code below substituting the following:
</p>
<ul>
<li>
Set <strong><code>accountSid</code></strong> and <strong><code>authToken</code></strong> from the
account you created in <a href="#verify-tutorial-step-1" class="link">Step 1</a>.
</li>
<li>
Set <strong><code>verificationServiceSid</code></strong> from the verification service you created
in <a href="#verify-tutorial-step-2" class="link">Step 2</a>.
</li>
</ul>
<pre><code class="line-numbers language-javascript">// To run this code, download the Somleng.js helper library from:
// https://www.somleng.org/docs/twilio_api#helper-libraries
// Then, find your Account SID and Auth Token from the Somleng console
// and set the following environment variables.
// const accountSid = process.env.SOMLENG_ACCOUNT_SID;
// const authToken = process.env.SOMLENG_AUTH_TOKEN;
const accountSid = "change-me";
const authToken = "change-me";
const verificationServiceSid = "change-me";
const to = "+15017122661";
const channel = "sms";
const client = require('somleng')(accountSid, authToken);
client.verify.v2.services(verificationServiceSid)
.verifications
.create({to: to, channel: channel})
.then(verification => console.log(verification.sid));</code>
</pre>
</div>
<div id="verify-tutorial-step-8">
<h4>
8. Receive the verification code via the SMS Gateway Application.
</h4>
<p>
In this step you will receive the verification code via the SMS Gateway Application running on your
local machine.
</p>
<p>
After running the code in the previous step, check your terminal window which is running the SMS
Gateway
Application.
You should see the verification message appear in the logs.
</p>
<p>
<em>
Note: If you're running the SMS Gateway Application in dummy mode, a real SMS will not be sent
to the recipients phone.
</em>
</p>
<img src="./images/terminal-sms-gateway-dummy-message-received.png">
</div>
<div id="verify-tutorial-step-9">
<h4>
9. Resend the verification code via a call.
</h4>
<p>
In this step you resend the verification code via a call.
</p>
<p>
Re-run the code in <a href="#verify-tutorial-step-8" class="link">Step 8</a>, but this time
update the
channel to <strong><code>call</code></strong> as shown below. Remember to also set the
<strong><code>accountSid</code></strong>, <strong><code>authToken</code></strong> and
<strong><code>verificationServiceSid</code></strong> like you did in <a
href="#verify-tutorial-step-8" class="link">Step 8</a>.
</p>
<pre><code class="line-numbers language-javascript">// To run this code, download the Somleng.js helper library from:
// https://www.somleng.org/docs/twilio_api#helper-libraries
// Then, find your Account SID and Auth Token from the Somleng console
// and set the following environment variables.
// const accountSid = process.env.SOMLENG_ACCOUNT_SID;
// const authToken = process.env.SOMLENG_AUTH_TOKEN;
const accountSid = "change-me";
const authToken = "change-me";
const verificationServiceSid = "change-me";
const to = "+15017122661";
const channel = "call";
const client = require('somleng')(accountSid, authToken);
client.verify.v2.services(verificationServiceSid)
.verifications
.create({to: to, channel: channel})
.then(verification => console.log(verification.sid));</code></pre>
</div>
<div id="verify-tutorial-step-10">
<h4>
10. Receive the verification via a call.
</h4>
<p>
In this step you will receive the verification code via a call.
</p>
<p>
After running the code in the previous step, you should receive a call to the softphone you
configured in <a href="#verify-tutorial-step-6" class="link">Step 6</a>.
Answer the call to hear the verification code.
</p>
<p>
<em>
Note: If you don't receive a phone call, check the verification logs in the Dashboard.
If you see the call failed, try restarting your softphone and try again.
The logs can be found under by clicking on <strong>Verifications</strong> under the
<strong>Verify</strong> menu.
</em>
</p>
<img src="./images/telephone-in-call.png">
</div>
<div id="verify-tutorial-step-11">
<h4>
11. Complete the flow by confirming the verification code.
</h4>
<p>
In this step you complete the flow by confirming the verification code.
</p>
<p>
Run the code below, substituting the following:
</p>
<ol type="a">
<li>
Set <strong><code>accountSid</code></strong> and <strong><code>authToken</code></strong> from the
account you created in <a href="#verify-tutorial-step-1" class="link">Step 1</a>.
</li>
<li>
Set <strong><code>verificationServiceSid</code></strong> from the verification service you created
in <a href="#verify-tutorial-step-2" class="link">Step 2</a>.
</li>
<li>
Set <strong><code>verificationCode</code></strong> from the verification code received via SMS or
call in <a href="#verify-tutorial-step-8" class="link">Step 8</a> or <a
href="#verify-tutorial-step-9" class="link">Step 9</a>.
</li>
</ol>
<pre><code class="line-numbers language-javascript">// To run this code, download the Somleng.js helper library from:
// https://www.somleng.org/docs/twilio_api#helper-libraries
// Then, find your Account SID and Auth Token from the Somleng console
// and set the following environment variables.
// const accountSid = process.env.SOMLENG_ACCOUNT_SID;
// const authToken = process.env.SOMLENG_AUTH_TOKEN;
const accountSid = "change-me";
const authToken = "change-me";
const verificationServiceSid = "change-me";
const to = "+15017122661";
const verificationCode = "change-me"
const client = require('somleng')(accountSid, authToken);
client.verify.v2.services(verificationServiceSid)
.verificationChecks
.create({to: to, code: verificationCode})
.then(verification_check => console.log(verification_check.status));</code></pre>
<p>
After you complete the flow you can view the Verification and the associated logs from the
Dashboard.
</p>
<ol type="a">
<li>
Under the <strong>Verify</strong> menu, select <strong>Verifications</strong>.
</li>
<li>
Click on the verification you just created in the list.
</li>
</ol>
<img src="./images/dashboard-show-verification.png">
</div>
<div>
<h4>🎉 Congratulations!</h4>
<p>
Congratulations! You have successfully completed the tutorial and built your own phone verification
service!
</p>
<p>
What we learned:
</p>
<ol>
<li>
Customer accounts (not to be confused with your carrier account) are used
to manage access to the API. You can create as many customer accounts as you need.
</li>
<li>
A Verification Service is a set of common configurations used to create and check verifications. A
verification service includes a <strong>Friendly name</strong> and a <strong>Code length</strong>.
</li>
<li>
An SMS Gateway is used to deliver SMS messages including verification codes.
</li>
<li>
A SIP Trunk is used to send voice calls including verification codes.
</li>
<li>
The Somleng SMS Gateway Application is a stand-alone application which runs on your local machine
and communicates with the SMS Gateway. It allows you to take full
control of the SMS delivery process.
</li>
<li>
The <a href="https://github.com/somleng/somleng-node" class="link" target="_blank">somleng-node <i
class="fa fa-external-link"></i></a> helper library can be used to start and check
verification flows from your application.
</li>
</ol>
</div>
</div>
<div id="chime-tutorial">
<h3>
Connect Somleng to Amazon Chime
</h3>
<p>
In this tutorial you will learn how to connect Somleng to your Amazon Chime account.
This tutorial will build on the previous tutorial, allowing you to send verification codes (and other
automated voice calls) to real phone numbers.
</p>
<p>
It's recommended that you complete the <a href="#verify-tutorial" class="link">previous tutorial</a>
before attempting this one. Some of the steps required to complete this tutorial are the same as the
previous tutorial and are not