====== New Be360 creation ======
===== Access the server =====
Access the Be360Whatsapp machine:
* **Server**: 35.156.230.51
* **Username**: centos
* **SSH identity file**: bp-demo.pem
===== Copy an existing folder =====
Copy an existing folder **AND REMEMEBR WHICH YOU USED, YOU WILL NEED THAT LATER**. \\
* Customer with a domain: \\ sudo cp -r be360cft/ be360customername/
* Customer without domain: \\ sudo cp -r be360farmacie/ be360customername/
===== Delete files =====
Now that you have copied the directory, you have to move in it, running this command: \\
cd be360customername/ \\
With ls -l you can see the folder's content.
You have to delete all the files **__except__**:
* app.js
* constants.json
* files/ (don't delete the folder, but **delete its content**)
* filesIn/ (don't delete the folder, but **delete its content**)
* main.js
* package-lock.json: contains the packages you install with npm install and their version
sudo rm wab.log
sudo rm *.log.gz
sudo rm -rf node_modules/
sudo rm package.json
rm -f files/*
rm -f filesIn/*
===== Install Json Packages =====
After deleting files you will have to install the packages in this directory. To do so run the following command:
npm i
To check if it worked you should see a new file named **package.json**
===== Modify files =====
In this part you will have to edit the content of the remaining files in the directory.\\
The first file we'll be edit is **constants.json** and it will be like that:
{
"bpdomain":"*tenantname*.beincontact.becloudsolutions.com",
"bptenant":"*tenantname*.beincontact.becloudsolutions.com",
"bpappid":"see point 1",
"type":"WHATSAPP",
"from":"vedi punto 5",
"basicauth":"vedi punto 6",
"url":"https://*vedi punto 7*.api.infobip.com/whatsapp/1/message/text",
"localFilePath":"http://wab*nometenant*.ccaas.becloudsolutions.com/files/"
}
- bpappid
* Go on the [[https://beincontact.becloudsolutions.com/admin/|admin portal]] and instert in the URL the correct tenant at the start of the domain.
* On the menu on the left click on the **Scenarios** drop bar and then on the **Chat** option.
* Selevt the scenario name called **WhatsApp**.
* In the **Scenario Entries** part you will have to copy the value of the **unique identyfier**.
* Paste the value in the Json.
- from
* Login into [[https://portal.infobip.com/login?callback=https%3A%2F%2Fportal.infobip.com%2Fhomepage|Infobip]] with the credential of the tenant's account.
* On the menu on the left click on the **Channels and Numbers** voice and then on the **Numbers** options.
* There you will find a number. Copy it and pu it in the Json field.
- basichauth
* Search on the internet a Basic Authenticator Generator.
* Insert the username and password where the website tells you to and generate the "token".
* Copy it and put it in the Json.
- url
* Login into [[https://portal.infobip.com/login?callback=https%3A%2F%2Fportal.infobip.com%2Fhomepage|Infobip]] with the credential of the tenant's account.
* On the menu on the left click on the **Developer Tools** voice and then on the **API Keys** options.
* In the section that you will have just opened, there will be a **Documentation** sectopn in the middle part of the screen. Click on it.
* Here you will find an URL. Copy only the value before the first dot.
* paste in in the Json.
- localFilePath
* Go on [[https://becloud-solutions.signin.aws.amazon.com/console|AWS Dashboard]] and log into it.
* Open **Amazon Route 53** and then on the **Hosted Zones**.and the **ccaas.becloudsolutions.com THE PUBLIC ONE**.
* You will now have to copy the IP address of the record name whose name corrispond to the initial direcotry from where you copied the files at the beginning.
* Click on **Create record** and in the **record name** field insert "wab+tenantname" and in the **Value** field paste the IP address or the domani you copied in the last point.
* Click on **Create record**.\\
The second file to edit will be the **app.js** file.
* Open it and go to the end of the file. There will be a string starting with **app.listening**.
* Cange the string with the correct name.
* For the port number you will have to exit the file editing and run this command: **netstat -tulpn** and use a port not displayed.
* After you choose wihich port to use just put it in the file and close it.
* To make sure everything is correct read the file and check if there are any other string/port/URLs to change.\\
The third file will be main.js.
* Open the file for example with an editor like **vim**.
* Search the subdomain of the copied tenant and, for vim, use the command **%s/oldtext/newtext/g** where old text is the old tenant subdomain and new is the new tenant subdomain.
* Repete the same command but instead put in the old field the old tenant name and in new the new tenant name.
* **CAREFULL** at line 126 you will need to add the username and password that you used to create the Basic Authenticator.
* To make sure everything is correct read the file and check if there are any other string/port/URLs to change.\\
The fourth file will be **server.config.js**
* To access this file go into the superior fodler and open the file.
* You will see a very clear scheme that you will have to edit juust by adding a new item coping on the existing and changing the fileds.
===== IT Billing =====
The purchased **numbers** must be entered in the shared file in {{0:sharepoint.png?20}}[[https://becloudsolutionssrl.sharepoint.com/:x:/r/sites/IT_Billing/_layouts/15/Doc.aspx?sourcedoc=%7B03326DA4-B2C5-4838-9706-0EBAF2190980%7D&file=Costi-fornitori-Tecnici.xlsx&action=default&mobileredirect=true|IT Billing]] for **technical supplier costs**.
\\ Depending on the carrier you are using, you will need to add a row to the table or add a unit in the quantity column.\\
The customer's **name** must be added to the {{0:sharepoint.png?20}}[[https://becloudsolutionssrl.sharepoint.com/:x:/r/sites/IT_Billing/_layouts/15/Doc.aspx?sourcedoc=%7B313F6BC5-5A4F-4CFC-BA4E-902C23F8D496%7D&file=Traffico-Telefonico_2026.xlsx&action=default&mobileredirect=true | Traffico Telefonico]] file.
\\ Add a new sheet, copy an existing one and delete the data inside of it. \\