• V20: 3CX Re-engineered. Get V20 for increased security, better call management, a new admin console and Windows softphone. Learn More.

Portech Configuration with Multiple Concurrent Calls

Status
Not open for further replies.

RichardCrabb1

Joined
Mar 7, 2009
Messages
196
Reaction score
0
Configuration for Portech with 2 or more Simultaneous Calls
I have setup for one of my customers a Portech 2 port GSM gateway. Initially we had a number of issues:-
1. Only the first SIM would allow incoming calls. Incoming calls for the second SIM always failed – pointing to a configuration error
2. We needed to treat the gateway as a device handling 2 concurrent calls, rather than having 3CX route first choice SIM1, and second choice SIM2. If later on we were to change the box for one with four SIMs, similarly we would need to treat it as a gateway with four concurrent calls
3. Calls needed to be distributed evenly between the two SIMs, so that if we used a total of 1200 minutes, each SIM would use round about 600 minutes each
The documented solutions for setting up the Portech MV370 and MV372 would not support the requirements above. I personally was looking for a good GSM trunking solution to help my customers to save money. The opportunity to sell solutions to save customers money with a fixed mobile gateway is high – provided that you have the right solution.
So that other 3CX users can benefit I have documented my solution below. I have fully tested and ran it past the support people of Portech. Much of it is taken from the 3CX solution – which provides the basic functionality needed.
The problem that I encountered with incoming calls was down to incorrect setup when using two or more SIMs. We made a mistake in forgetting to follow the instructions to enter the range of routing entries for each mobile. To achieve the requirement to distribute calls, I have used something called a “SIP Peer Server” that can be downloaded for free from Portech. I could have used their STDP box that costs £115 – maybe a slightly better technical solution. The SIP Peer does not run as a service, so I use FireDaemon Pro to make it start as a service.
Setup IP Address
The first thing to do is to log on to the MV-372 using its default IP address 192.168.0.100 having connected it to the LAN via the gateway’s WAN port. You will have to temporarily re-address the PC you are using to access it to the 192.168.0.0/32 subnet. The username is voip and the password 1234. Go to the network settings page and set the IP address as needed for your network. Also, set the network mode to “bridged”. This allows you to connect another device to the LAN port if needed. Then click “Submit”
Next go to the SNTP settings and set the time zone to your local area. This does not affect interoperability with 3CX.
Now that you have made these two changes go to the Save Change on the left hand side. Click “save” and the device will save the settings and reboot. You must do this for all the changes that you make to the Portech in the next steps. If you forget, then the change will not take place.


Setup 3CX for each SIM
Now, the 3CX needs to be setup for single port gateways for each SIM. In this case two.
• In the 3CX Management Console, click on the “Add PSTN” link in the left-hand side. In the “Name” field, assign a name to this device; e.g. “GSM-gw1”, or “GSM-gw2” etc.
• In the “Brand” field, select “Portech”
• In the “Model” field, select “MV370” or MV372 or whatever model it is
• In the “VoIP Gateway Configuration” page you will need to insert the IP Address of the device (in this example 192.168.103.171), and the port number (default is 5060)
• The “Add VoIP Lines: Create Lines” page will appear and the necessary fields will be pre-populated with suggested values. You may customize these values for your requirements, even though the default values suggested should work well. In particular, the “Identification” field may be set to the number of the line provided by the telephone company for that mobile SIM. Click on the “Next >” button.
• The “Create Outbound Rule” page will allow you to quickly create a rule with which to deliver calls through this device. Specify a prefix for the rule to identify outbound calls. Click on the “Finish” button when ready, or click on the “Skip” button if you do not wish to create an outbound rule for this device at this stage.
• The “Gateway Created” summary page will list the settings you will require to apply to the device.
• If your device can handle 2 SIM cards, you will need to repeat steps 1 to 7, however at step 4 you will need to change the port to 5062.
• If your device can handle 3 or more SIM cards, for the third SIM the port will need to be 5064, for the fourth 5066 etc

Setup the Gateway
• Point your browser to the gateway’s IP.
• On the “Sip Settings” node click on the “Service Domain” subsection, and go to the “Realm 1 (Default)” section
• Click on Mobile 1 in the drop down list.
• Set the “Active” field to “ON”
• Set the “Display Name” field to the Virtual Port Number created by 3CX
• Set the “User Name” field to the Virtual Port Number created by 3CX.
• Set the “Register Name” field to the Virtual Port Number created by 3CX.
• Set the “Register Password” field to the Authentication Password for the Virtual Port Number created by 3CX.
• Set the “Domain Server” field to the Private IP Address of the PBX.
• Set the “Proxy Server” field to the Private IP Address of the PBX
• Click on the “Submit” button
If you wish to set this up for your second SIM Card then repeat the above steps after selecting “Mobile 2” in the drop down list in the first step. You must click the drop down menu and not enter the second SIM in the settings for “realm 2”. Realms 2 and 3 must be both set to “off”.


Routing Range
It is necessary to tell the Portech gateway how each routing table (LAN to mobile and mobile to LAN) relates to each SIM. If this is incorrect, call routing will not work correctly.
Now go to mobile – settings. On Mobile 1, set it to on. Set routing range for 0 to 4. This tells the gateway that the first five entries are for Mobile 1 or SIM1. On mobile 2, set the mobile to “on”. Set routing to 5 to 9. This gives us the potential to use five entries per SIM. We only use one in this example.


It may be advisable to set the band manually that your SIM uses, otherwise it may try to use another band. Calls will then randomly fail. For Orange and T-Mobile use DCS1800. For Vodafone and O2 use PGSM900. You can purchase gateways that support 3G, but are much more expensive.
Call Routing Tables Mobile to LAN
• Go to the “Route” node, click the “Mobile to Lan Settings” subsection, and scroll down to the “Add New” section
• Set the “Position” field to “0” (without the quotes)
• Set the “CID” field to “*” (without the quotes)
• Set the “URL” field to “Virtual Port Number”@“Private IP of PBX”. So for example, if the Virtual Port Number for this SIM card is “10027”, and the Private IP Address of the PBX is “192.168.25.60”, you would set the field to “[email protected]
• Click the “Add” button
If you have a second Sim Card then you should repeat the above steps setting the “Position” field to “5” (without the quotes). Note that for the second SIM card the Virtual Port is 10028.


LAN to Mobile
• Go to the “Route” node, click the “LAN To Mobile Settings” subsection, and scroll down to the “Add New” section
• Set the “Position” field to “0” (without the quotes)
• Set the “URL” field to “*” (without the quotes)
• Set the “Call Num” field to “#” (without the quotes)
• Click the “Add” button
If you have a second SIM Card then you should repeat the above steps setting the “Position” field to “5″ (without the quotes). Similar applies if you have three or more SIM cards. You may then need to go on to page two etc.


Now setup two outbound rules, one for each mobile SIM. In our example we prefixed numbers with 67 and 68 for testing. It should be possible to route calls through the appropriate SIM.

Fair Distribution of Simultaneous Calls
The basic setup of the gateway is complete so that calls can be made to and from the gateway, although at this stage it looks like two separate gateways to the 3CX. The next stage is to setup the SIP Peer Server to allow handling of multiple calls and evenly distributing calls between the two SIMs. Make test calls to convince yourself that it is working correctly in this mode.
Download the Sip Peer Server from Portech. Here is the link. http://www.portech.com.tw/eweb/MV370/Frimware/Dial_peer.zip (the link works despite “frimware” in the path name!) An alternative is to use the Portech STDP device that will do the same job. Personally I have not tried this yet. What needs to be done is to create a DialPeer.ini file for peer server using parameters unique to your network. You need to locate the program and ini file at a safe folder location. The file simply runs – it does not need to be installed. To run it as a service you need a program such as FireDaemon. This will ensure that the program starts whenever the computer starts. For this application it is not good enough to rely on a user to logon unless you know that it will always be logged on – for example only one user configured on a PC not part of a Windows domain.
Here are the contents of the DialPeer.ini file, located in the same folder as dialpeer.exe. In red I have shown what the parameter means:-
[My]
Port=5082 Port on host PC in this case 5082. The host PC IP is 192.168.103.13 port 5082. Point the 3CX trunk to this
[Info]
Total=2 2 ports or lines
[VoipIP]
1=192.168.103.171 IP address of first gateway
2=192.168.103.171 IP address of second gateway (happens to be the same in our case)
[SipPort]
1=5060 Port of 1st gateway
2=5062 Port of 2nd gateway
[RtpPort]
1=20000 RTP port for first gateway
2=20002 RTP port for second gateway
[PtcPort]
1=40000 Internal port for SIP Peer
2=40000
[Stun]
Port1=3478 used for STUN not relevant to our application
Port2=3479
[Window]
Xpos=757
Ypos=1
Width=480
Height=360

The SIP Peer server can support up to 8 ports – sufficient for most purposes.
The next step is to setup a SIP trunk on 3CX to point to the SIP Peer server. The trunk does not need to register, so when configuring select “Generic Sip Trunk”. Enter the IP address of the host machine (in our case 192.168.103.13) and the port number of 5082. Set up the number of lines – again in this case 2. The port number of 5082 is deliberately chosen for security as it will not be forwarded from the public IP address to the 3CX. In any case it should be configured for outbound calls only. Just better to be safe than sorry. For incoming calls 3CX is set to end the call.



Outbound Route for Mobile Numbers
Setup an outbound route. I suggest in the case of the UK any prefix with 07 should be routed to the SIP peer trunk. Once this is setup, make calls to test that the first call uses SIM1, the second uses SIM2 then back to SIM1 etc. The rule needs to placed above the rule that handles calls beginning with 0, whatever that is. If you use 9 or 0 to make external calls, then you need to use 907 or 007 instead.
Managing the SIM contracts
Incoming calls should route to whoever manages the SIM contract. It could be someone in the accounts department for example. It is wise to periodically check how many minutes are being used. The 3CX log reporter can be used by requesting it to find all calls to “07%” without the quotes. Also, log on to the mobile provider website to check.

I hope people may find this useful. Any feedback is welcome.
Kind regards
Richard
 

Attachments

  • network_edited-1.jpg
    network_edited-1.jpg
    30.8 KB · Views: 1,420
  • service-domain.jpg
    service-domain.jpg
    40.1 KB · Views: 1,416
  • mobile-setting-routing-rang.jpg
    mobile-setting-routing-rang.jpg
    61 KB · Views: 1,418
  • mobile-to-LAN.jpg
    mobile-to-LAN.jpg
    31.4 KB · Views: 1,417
  • lan-to-mobile.jpg
    lan-to-mobile.jpg
    34 KB · Views: 1,418
  • 3cx-trunk-for-sip-peer.jpg
    3cx-trunk-for-sip-peer.jpg
    92.6 KB · Views: 1,417
Status
Not open for further replies.
Get 3CX - Absolutely Free!

Link up your team and customers Phone System Live Chat Video Conferencing

Hosted or Self-managed. Up to 10 users free forever. No credit card. Try risk free.

3CX
A 3CX Account with that email already exists. You will be redirected to the Customer Portal to sign in or reset your password if you've forgotten it.