Jadi ada kebutuhan untuk menyambungkan Microsoft Teams ke Cloud PBX kantor, tapi sekaligus masih bisa menjalankan Demo untuk IVR yang full menggunakan “PBX” Microsoft Teams.
Saat ini ada dua SBC yang sudah terdaftar di OnlinePstnGateway kantor, yang satu untuk integrasi ke Cloud PBX, dan yang satu bener-benef full MSTeams Direct Routing yaitu sbc01.ofon.co.id dan sbc02.ofon.co.id, yang bisa dilihat dengan perintah Get-CsOnlinePstnGateway. Semua panggilan ke ekstensi (format nomer ekstensi 4 digit) CloudPBX akan dilewatkan sbc02.ofon.co.id, dan panggilan ke offnet (landline dan mobile) akan dilewatkan melalui kedua sbc tersebut.
Langkah-langkahnya seperti berikut:
Buat container baru dengan nama DualSBC untuk mengelompokkan rute panggilan di atas yang nantinya dijadikan satu ke OnlineVoiceRoutingPolicy baru.
Set-CsOnlinePstnUsage -Identity Global -Usage @{Add="DualSBC"}
Lalu buat rule baru dengan nama, misal, SBC2CloudPBX panggilan ke ekstensi (4 digit) untuk diarahkan ke sbc02.ofon.co.id (perhatikan format regexnya):
Sering beberapa kali pada saat pindah laptop/PC untuk mengakses Microsoft Teams cmdlet mengalami kendala perintah tidak dikenali seperti berikut ini:
PS C:\windows\system32> Install-Module MicrosoftTEams
PS C:\windows\system32> Connect-MicrosoftTeams
Connect-MicrosoftTeams : The term 'Connect-MicrosoftTeams' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1
+ Connect-MicrosoftTeams
+ ~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : ObjectNotFound: (Connect-MicrosoftTeams:String) [], CommandNotFoundException
+ FullyQualifiedErrorId : CommandNotFoundException
Kalau dibaca-baca di beberapa mailing-list, ini karena environment PowerShell untuk keamanan terhadap script yang tidak dikenal dan berbahaya. Tapi ya belum paham-paham banget detailnya bagaimana. Cuma dapat saran untuk menjalankan perintah berikut ini:
Execution Policy Change
The execution policy helps protect you from scripts that you do not trust. Changing the execution policy might expose
you to the security risks described in the about_Execution_Policies help topic at
https:/go.microsoft.com/fwlink/?LinkID=135170. Do you want to change the execution policy?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): a
Jika menjalankan cmdlet Microsoft Teams dari powershell Ubuntu, tidak memerlukan setting policy seperti di atas. Setelah menginstall module, langsung bisa menjalankan Connect-MicrosoftTeams.
Akhirnya module MicrosoftTeams yang untuk menggantikan SkypeOnlineConnector dapat juga digunakan di Linux, terutama distro Ubuntu. Setupnya cukup mudah seperti yang ada di postingan https://www.otakudang.org/?p=1097. Berikut tangkapan layar ketika menjalankan perintah Install-Module MicrosoftTeams:
Dan untuk login ke Microsoft Teams admin console dengan perintah Connect-MicrosoftTeams (akan muncul login tab di browser yang menanyakan informasi login admin):
Muncul beberapa warning tapi bisa diabaikan. Berikutnya test perintah , misal, untuk Direct Routing:
PS C:\WINDOWS\system32> Install-module MicrosoftTeams NuGet provider is required to continue
PowerShellGet requires NuGet provider version '2.8.5.201' or newer to interact with NuGet-based repositories. The NuGet
provider must be available in 'C:\Program Files\PackageManagement\ProviderAssemblies' or
'C:\Users\tunju\AppData\Local\PackageManagement\ProviderAssemblies'. You can also install the NuGet provider by running
'Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force'. Do you want PowerShellGet to install and
import the NuGet provider now?
[Y] Yes [N] No [S] Suspend [?] Help (default is "Y"): yes
Untrusted repository
You are installing the modules from an untrusted repository. If you trust this repository, change its
InstallationPolicy value by running the Set-PSRepository cmdlet. Are you sure you want to install the modules from
'PSGallery'?
[Y] Yes [A] Yes to All [N] No [L] No to All [S] Suspend [?] Help (default is "N"): yes
Karena pada dasarnya Microsoft Teams ini semacam PBX bermerk Microsoft, salah satu fiturnya tentu ada yang namanya call transfer, walaupun istilahnya agak berbeda sedikit dengan PBX pada umumnya. Di Microsoft Teams (selanjutnya saya sebut sebagai MSTeams saja biar ndak ribet ngetiknya), menyebutnya sebagai Transfer nowuntuk blind (call) transfer, dan Consult then transferuntuk attended (call) transfer. Kurang ribet gimana coba?
Transfer now
Blind (call) transfer adalah meneruskan panggilan ke nomor telepon atau ekstensi tujuan tanpa menanyakan terlebih dahulu apakah orang yang tertuju bersedia mengangkat telepon atau tidak. Jadi jika orang tertuju tidak ada di tempat, maka panggilan akan berdering terus sampai dengan ring timeout atau penelpon memutuskan untuk menutup telepon. Blind transfer biasanya terjadi jika:
panggilan terjadi di dalam satu organisasi saja, dan biasanya dengan peer.
Untuk melakukan Tranfer now di Desktop app cukup mudah. Ketika menerima panggilan masuk dan hendak mentransfer panggilan tersebut, klik ikon elipsis (…) di kiri atas, lalu pilih Transfer.
Lalu di bagian isian Invite someone or dial a number, isikan nama kontak yang hendak dituju. Jika nama kontak berada di tenant yang sama, menuliskan beberapa huruf depan saja akan memunculkan kemungkinan nama yang hendak dituju:
Jika nama sudah muncul dari kemungkinan yang ditampilkan, klik kontak tersebut. Jika belum, teruskan mengetik nama kontak. Jika sudah klik nama tersebut.
Selain dapat melakukan transfer, panggilan masuk juga dapat ditransfer ke voicemail nomer tertuju apabila orang yang tertuju sedang tidak di tempat (sedang cuti, atau tugas ke luar kota), sehingga pemanggil dapat meninggalkan pesan penting yang dapat didengarkan kembali oleh orang yang dituju melalui MSTeams atau surel.
Jika kita mengaktifkan Ring back if there’s no answer, maka panggilan tersebut akan kembali ke kita jika transfer tidak dijawab oleh orang tertuju dengan pesan seperti berikut:
Jika mengaktifkan Ring back if there’s no answer, maka kita tidak dapat transfer panggilan ke voicemail nomer tertuju.
Selain dapat melakukan transfer panggilan ke akun MSTeams di tenant yang sama, kita juga dapat melakukan transfer panggilan ke akun MSTeams tenant yang berbeda (beda organisasi), dengan catatan, MSTeams sudah dilakukan federation, yaitu memperbolehkan satu domain tenant berbicara dengan domain tenant lain di luar organisasi tersebut. Ijin akses ini harus dua arah. Misal, jika tenant MSTeams ofon.co.id memperbolehkan semua penggunanya menghubungi langsung ke pengguna di domain tenant microsoft.com, maka sebaliknya di MSTeams tenant microsoft.com juga harus memperbolehkan komunikasi dari MSTeams ofon.co.id.
Transfer panggilan lain yang diperbolehkan adalah ke nomer PSTN eksternal atau ke nomor mobile jika trunk operator memperbolehkan.
Apa maksudnya “jika trunk operator memperbolehkan?”
Salah satu implementasi yang pernah saya lakukan adalah menghubungkan MSTeams dengan nomer PSTN onpremise yang turun ke lokasi kantor pelanggan berupa satu line analog. Satu line analog ini berarti 1 conccurent call baik masuk ataupun keluar tapi tidak dua-duanya.
Jadi jika ada panggilan masuk ke nomer tersebut, maka line analog sudah terpakai, sehingga tidak memungkinkan melakukan transfer panggilan ke nomer PSTN atau nomor mobile di luar organisasi tersebut.
Untuk melakukan transfer panggilan ke nomor telepon lain di luar organisasi, cukup masukkan nomer telepon lengkap seperti berikut:
lalu klik Transfer.
Transfer now di mobile app
Ketika panggilan masuk ke mobile app, untuk melakukan transfer panggilan, pilih menu elpisis (…) di layar bagian bawah, lalu pilih Transfer.
Di bagian “Search for people” isikan nama kontak tertuju. Jika kontak tersebut ada di dalam MSTeams tenant, maka akan muncul secara otomatis:
Ketuk di daftar nama tersebut untuk mentrasnfer panggilan.
Atau, kita bisa memasukkan nomor telepon eksternal seperti berikut:
ketuk nomor telepon eksternal untuk mentransfer panggilan ke nomor tersebut. Jika tranfer berasil akan muncul status seperti berikut:
Consult then transfer
Attended (call) transfer adalah transfer panggilan yang agak sopan karena penerima telepon akan menanyakan terlebih dahulu ke orang tujuan apakah bersedia atau available untuk menerima panggilan atau tidak. Di MSTeams, kita dapat menanyakan dengan dua cara ketika melalui desktop app, yaitu dengan melakukan panggilan terlebih dahulu, atau mengirimkan pesan chat. Sedangkan untuk mobile app per tanggal tulisan ini, hanya dapat melakukan attended transfer dengan bertanya melalui chat saja, karena tidak ada menu panggilan suara. Mungkin nanti-nanti akan ada rilis untuk kemampuan tersebut.
Consult then transfer di Desktop App
Di dalam dekstop app kita dapat menanyakan telepon tertuju untuk transfer panggilan melalui panggilan suara atau pesan chat. Di menu elipsis (…) kanan atas, pilih Consult then transfer.
ketika memilih kontak tertuju, kita akan diberikan dua pilihan untuk memberitahukan melalui panggilan telepon atau via chat seperti berikut:
Di contoh ini kita pilihh Teams audio call. Jika nomer tertuju bersedia menerima panggilan telepon, maka untuk mentransfer panggilan cukup tekan Transfer :
Jika nomer tertuju tidak bersedia menerima telepon atau sedang tidak berada di tempat, maka pilih Leave, lalu di halaman penerimaan panggilan tekan Resume untuk kembali berbicara ke nomer pemanggil yang sebelumnya masuk hold.
Sedangkan pemberitahuan melalui Chat akan mengirimkan pesan otomatis seperti berikut:
jika nomer tertuju bersedia menerima panggilan, maka cukup tekan tombol Transfer di atas. Apabila tidak, kembali ke layar utama panggilan dan tekan Resume untuk berbicara kembali ke nomor pemanggil.
Consult then transfer dengan Mobile app
Untuk mobile app, pilih elipsis lalu pilih menu Transfer -> Consult first.
Karena pilihannya hanya pemberitahuan via Chat, maka otomatis akan digenerate pesan seperti berikut:
Perhatikan dua icon di kanan atas:
Icon handle telepon di sebelah kanan untuk melakukan transfer jika tertuju bersedia menerima telepon, dan gambar icon panah untuk melakukan Resumepanggilan jika tidak tersambung dan kembali berbicara ke nomor pemanggil.
Saya tau ini ide buruk, bahkan developernya pun sudah mengingatkan bahwa A2billing ini memiliki flaw dan sudah dari 6 tahun yang lalu (saat tulisan ini dibuat) versi terakhihrnya keluar. Tapi karena suatu hal, situasi mengharuskan saya mengaktifkannya.
Karena alasan di atas, A2billing tidak akan ditemukan di laman Addons. Jadi kudu diinstall langsung dari yum:
Setelah itu buat database baru di MariaDB dengan patokan credential di /etc/a2billing.conf. Ada baiknya diubah dulu agar tidak menggunakan nama db bawaan, username dan password. Tapi agar bisa jalan saja, kira-kira default cuplikan credential dari file di atas adalah sebagai berikut:
[database]
hostname = localhost
port = 3306
user = a2billinguser
password = a2billing
dbname = mya2billing
; dbtype setting can either be mysql or postgres
dbtype = mysql
Lalu login ke MariaDB dengan akun administrator (dalam contoh di sini saya menggunakan root, untuk membuat database mya2billing dan user a2billinguser dengan password a2billing.
CREATE DATABASE mya2billing;
GRANT ALL PRIVILEGES ON mya2billing.* TO 'a2billinguser '@'localhost' IDENTIFIED BY 'a2billing';
flush privileges;
Setelah itu masuk ke direktori /usr/share/a2billing/DataBase/mysql-5.x dan jalankan script install-db.sh:
cd /usr/share/a2billing/DataBase/mysql-5.x
./install-db.sh
isikan informasi database, user dan password sesuai dengan di atas.
Terakhir, reset semua password admin Issabel dan DB dengan perintah:
/usr/bin/change-passwords
Lalu login ke portal A2billing yang berlokasi di laman https://<url_issabel>/a2billing/admin/index.php dengan username/password admin Issabel.
Sudah di pehujung tahun lagi. 2020 merupakan tahun yang benar-benar menguji. Bahkan sejak tanggal 1 Januari 2020 sebelum matahari terbit, langsung dihajar dengan banjir.
Tahun ini kami lebih siap, dan semoga tidak lengah.
Akhir-akhir ini nginstall WSL untuk keperluan pekerjaan. Awal-awal ketemu masalah gimana caranya SSH ke instance WSL yang sama untuk melakukan pekerjaan paralel (iya.. iya.. saya n00b).
Waktu itu sudah kepikiran menggunakan ssh, tapi bolak balik ssh server tidak dapat dinyalakan. Ternyata ada caranya buat ngakalin. Begini:
Uninstall ssh yang sudah ada lalu install ulang. Ngehe kan?
Related to previous post about how to setup Issabel as Direct Routing SBC to MSTeams,I got requests from acquintances about the complete configurations from Issabel side.
So here they are:
sip_custom.conf (modify this from Asterisk File Editor webGUI)
replace xxx are Carrier ip address, and port. replace fromdomain with your own FQDN Issabel server.
Outbound to MSTeams DID
I created 3 outbounds route with this order:
Outbound to MSTeams
Outbound to Carrier for REFER
Outbound to Carrier for each DID
The order should as such. And you dont need to setup any Inbound Routes.
Outbound route to MSTeams should contain your assigned DIDs toward MSTeams account. Should look like this:
Outbound Route to Accomodate REFER
Since I dont know how to replace user part of the URI with RPID, I just pick one DID to accomodate REFER. This is less desireable but the REFER outbound route can act as Global CallerID for the direct routing. Notice that the route contains disposable prefix 9 to avoid overriding from 3rd route (i.e Route for each DID).
Outbound Route to Carrier for Each DID
(extra) Asterisk SIP Settings from Unembedded IssabelPBX menu
Point the tlsprivatekey, tlscertfile, and tlscafile to your approriate files. And realm should be the Issabel server’s FQDN. The tlsbindaddr can by any ip address and port you wish to use.
That should do it. If I miss anything, please clue me at the comment.
Should have Issabel server properly installed with ip public and . The server firewall should be hardened by only allowing Carrier and Microsoft cloud ip address blocks (52.112.0.0/14). Even better if the only maintenance can only be accessed by VPN. Dont open your Issabel webGUI, SSH, SIP & RTP ports to public internet whenever possible.
My Issbel (Asterisk) server is already connected to Ofon as the PSTN Carrier, and already has a DID assigned.
Requires to edit chan_sip.c to comply with Microsoft Teams Phone System that demands SIP From and Contact header host part to be FQDN. From header is easy, just add fromdomain at the Asterisk trunk config and you’re good. The Contact header is the tricky one, based on this screenshot clue (stolen from thread https://community.asterisk.org/t/fqdn-in-the-contact-header/77625):
By half-assed editing the chan_sip.c , I expect there will be repercussion somewhere else in the system (plus I am no good at C, should find a better way to insert the change with more elegant solution), so dont share the PBX with something else for production, and use this as POC only.
Dont ever think to commercialize this without Microsoft approval, nor use this for officials. You may not be able to open tickets if you encounter problems with this installation although you are a legit Office 365 tenant with Phone System license. The certified SBC list can be found here.
Should have access to DNS server to add TXT type record for domain authentication.
Should have global admin account to make changes in O365 portal.
In this example, I have two E1 O365 + Phone System licenses. One to be assigned to my account and one to be assigned to SIP trunk domain dummy user.
You cant do multi tenant with this installation. Asterisk itself is a single realm (CMIIW).
Still cant find how to modify Contactheader in OPTIONS, hence you’ll find tlsdontverifyserver=yes in Issabel general config.
Will periodically update this post with something new whenever I find improvement. So forgive me if you find something different when you read back the post later.
Microsoft Teams Phone System Side Config
In this stage you will need to add an SSL’ed domain to Office 365 portal. Microsoft-recommended CA list can be found here. I myself use GeoTrust.
Using global admin to add domain (mine is ast.ofon.biz), to O365 admin portal.
Add a dummy user for that domain and assign O365 + Phone System license for that dummy user. For example, my dummy user for the newly added domain is sip@ast.ofon.biz. If successfully added, I will find the user in Active users table like this:
that is how Microsoft Teams will recognize the SIP trunk to our Issabel (Asterisk) server and assign license to the trunk.
We will have two SIP connection configs for Microsoft Teams Phone System and two SIP connection configs for Carrier. Each connection will have different contexts. One SIP connection for Microsoft Teams will be from-internal, so call from Microsoft Teams will be treated as call from extension. And the other SIP connection will be treated as outbound trunk with from-trunk context. Same deal with the two SIP connections toward Carrier.
Microsoft provides 3 hosts to connect a SIP trunk with:
sip.pstnhub.microsoft.com
sip2.pstnhub.microsoft.com
sip3.pstnhub.microsoft.com
This example will only test the first one (sip.pstnhub.microsoft.com).
Adding Trunk to Microsoft Teams from PBX -> PBX Configuration -> Trunks. Add SIP Trunk and fill these parameters :
To refer to certifcate files, go to PBX -> PBX Configuration -> Unembedded IssabelPBX. At the following page, go to Settings -> Asterisk SIP Settings and then Add field at the Other SIP Settings with these:
Add the Outbound Routes to Microsoft Teams and Carrier (Microsoft Teams outbound should be aboive the Carrier). Since my carrier mostly sends with prefix 0, I have to convert it to E.164. Please modify these according to your apporpriate settings:
At this point, you should be able to call outbound from Microsoft Teams account but not the other way (inbound). As mentioned before, Microsoft Teams Phone System require us to send From and Contact header host as FQDN. The trunk settings in Asterisk wont change Contact header host to FQDN hence we’ll receive this message:
There is no Asterisk source in Issabel distro so we have to get it ourself. From Issabel linux console, git clone the Asterisk github and checkout for 16.7.0 (since this is my Issabel’s Asterisk version).:
cd /usr/src
git clone https://github.com/asterisk/asterisk.git
cd asterisk
git checkout 16.7.0
Edit file /usr/src/asterisk/channel/chan_sip.c. Look at build_contact() we will find these lines:
p->fromdomain will follow whatever “fromdomain=” value in the SIP trunk config.
Update:
Got input from Igo Cunha that the call from MSteams to PSTN will be disconnected after 6 sec. I can confirm I got random disconnect call at about 6 sec from the same direction. Try replace:ast_sockaddr_stringify_remote(&p->ourip) with your Asterisk's FQDN string (e.g "ast.ofon.biz" in my case) instead of p->fromdomain.
Thanks Igo!
I understand this is not elegant way, but that should do it. Compile the source and we will have brand new chan_sip.so. Backup the original one and replace it after:
Although it is possible to connect Direct Routing with Asterisk, still easier using Kamailio (and OpenSIPS) since they’re built solely for SIP packet engineering. Until some of them become certified with Microsoft, I guess I will be using the already ceritfied ones, like Sonus or AudioCodes, or just connect to a hosted Direct Routing Provider in Indonesia, like Ofon. Alternatively, there are Kamailo based products start providing hosted DR, like Gilawa and dSIPRouter. Check them out.