Receiving SMS Confirmation Codes to E-mail Using NetPing SMS

  • Published In: Tutorial
  • Created Date: 2016-06-13
  • Hits: 40

Today there are a lot of services, which require authorization through a confirmation code to work with them. The code can be received through SMS message only. In the scale of a company, employees of which work remotely, the issue of getting such SMS message can be solved by redirecting the message to e-mails of a group of company employees. To do this, there is a need to register an office e-mail account on a corporate email server or register it at one of the popular free services.

Let us consider a simple case, when a gateway NetPing SMS and equipment with the application Trap Receiver are located in one local network. A scheme works the next way:

  • a gateway of NetPing SMS is an SMS message;
  • on its basis, NetPing SMS forms SNMP Trap, which contains a text of an SMS message and a phone number of a sender;
  • NetPing SMS sends SNMP Trap to a PC/server, where it is received by the application Trap Receiver and forms on its basis a body of a letter for sending

A solution is very simple in implementing and can be easily realized because only one application with a minimal amount of settings is used.

Requirements

To implement this solution, there is a need to have:

  • NetPing SMS gateway with a preinstalled SIM card;
  • free application Trap Receiver;
  • Windows OS for the application Trap Receiver to operate. This can be either a virtual machine on present servers or a full OS or a PC connected to a local network or a remote PC in the Internet network

If the equipment with the application Trap Receiver is not located in the same network with a NetPing SMS network – after a router with a NAT and/or Firewall function, there is a need to allow incoming packages via SNMP Trap (UDP/162) protocol to the equipment with the application Trap Receiver to have a possibility to get SNMP Trap externally. For additional information, there is a need to see a documentation for a router or address a network administrator.

If necessary, a NetPing SMS gateway can be connected to the network via Wi-Fi through an adapter WiFi VAP11N. The adapter is purchased separately. For additional information, there is a need to address a user guide.

Configuring NetPing SMS

Set a NetPing SMS device into operating condition according to corresponding sections of a user guide and a firmware description:

  • insert a SIM card of a mobile network operator;
  • configure necessary parameters to work with the data network;
  • indicate an IP address of a PC/server with a preinstalled application Trap Receiver to send SNMP Trap notifications on the page «SETTINGS» of a NetPing SMS device web interface
    Configuring SNMP Trap

Configuring Trap Receiver Application

Install the application Trap Receiver in Windows environment and launch it. Go to the settings of the application via the button «Configure»:

Configuring Trap Receiver

Then go to the tab «email»:

Adding an SMTP server to Trap Receiver

The settings are shown for the case when a free email service mail.ru is used. If another service is used, specify the details in a documentation or at a service administrator.

where:

SMTP Server: smtp.mail.ru

SMTP Port: 465
From: service e-mail, which has been registered for sending SMTP Trap.
To: e-mail, where emails containing SMTP Trap will be sent 
Subject: New SMS from number %VBDATA4% – a subject of a letter (may contain certain variables – see below).
Message: %VBDATA3% \n from number %VBDATA4% – a body of a letter (may contain certain – see below).
SSL Required: enable SSL encoding – without it none modern email service works.
Authentication Required: enable as well and go to the setting via the button «Set».
User/Account: in this case a registered service e-mail.
Password: a password from a service e-mail. 

Variables that can be used in a subject and body of a letter:

  • %SENDERIP%
  • %SPECIFICTYPE%
  • %GENERICTYPE%
  • %COMMUNITY%
  • %SENDEROID%
  • %VBOIDn%
  • %VBDATAn%

Variables «%VBOIDn%» and «%VBDATAn%» may be used to add a necessary OID or data to a letter from N VarBind. For example, «%VBDATA1%» will transfer data from the first VarBind. Line shift «\n» and carriage return «\r» are supported as well in a body of a letter.

Therefore, if received SNMP Trap consist of four VarBinds (it is possible to check this by clicking one of traps twice in the application Trap Receiver):

Browsing SNMP TRAP in Trap Receiver

In settings of e-mail we will use «%VBDATA3%», which is a text of a message, «%VBDATA4%», which is a phone number, from which a message has been received (for a general awareness). Optionally it is possible to use a bigger amount of variables and text, as well as symbols of line shift and carriage return. Apply changes.

Then go to the section «Actions» and configure a rule, according to a condition of which received SNMP Trap will be sent to the e-mail specified before:

Creating a rule in Trap Receiver

Use a sender's IP address as a criterium «Watch» as the simplest variant. It is an IP address of a NetPing SMS device in a local network. Then in the section of actions mark an e-mail and click the button «Configure». In the opened window choose a profile to send an e-mail, which was configured before. Apply changes.

Result

Thus, when a gateway of a NetPing SMS receives an SMS message, a letter of the next appearance will be sent to a specified email:

An SMS by an email


Tags: NetPing SMS
comments powered by Disqus