Saturday, February 28, 2009

Updated trunk configuration Asterisk, freepbx and Portech MV-3xx

This is my new updated functional configuration of Portech.

This guide will help you settings up Trunk in Asterisk (freebox, trixbox, PBIF, etc.) for Portech GSM Gateway.

The new configuration will pass Caller ID.


First we will configure the Portech MV-372 i believe this configuration will also work with Portech MV-370 and other Portech MV-3xx like MV-374.

Login to your portech

Route
  • Mobile To Lan Settings:
    Item CID URL
    0 * 192.168.x.x (your asterisk ip)

  • Lan To Mobile Settings:
    Item URL Call num
    0 * #
  • Mobile
    • Settings:
      Mobile 1:
      Sip From: Tel/Tel (No reg)
      CLID Presentation: Invocation
      LAN Answer Mode: Income

      Do the same for Mobile 2
  • SIP Settings
    • Service Domain
      You only fill Domain Server and Proxy server with your asterisk IP address:
      Domain Server: 192.168.x.x
      Proxy Server: 192.168.x.x

      Again do the same for Mobile
    • Port Settings
      Make sure SIP Port for Mobile 1 is 5060 and port 5062 for Mobile 2

Other settings are fine you may leave them as they are, only check Network (WAN) settings if you don't have DHCP or you need static IP for Portech gsm gateway.

Don't forget to save changes (should reboot after saving)

Asterisk/Freepbx

Login to your FreePBX and add SIP Trunk

Outbound Called ID: xxxxxxx (put you number here)
Maximum Channels: 1

Outgoing settings
Trunk Name: SIM1 (you may put anything you like)
PEER Details:
host=192.168.x.x (your Portech IP address)
type=peer
port=5060

Incoming Settings:
USER Context: xxxxxxx (put you mobile number)
Leave Incoming settings blank.

Click submit (don't forget the Orange bar on top after you make changes in your server)

Add another SIP Trunk for SIM2

Outbound Called ID: yyyyyyyy (put you phone number here)
Maximum Channels: 1
go to Outgoing settings

Trunk Name: SIM2
PEER Details:
host=192.168.x.x (your Portech IP address)
type=peer
port=5062 (important)

Incoming Settings:
USER Context: yyyyyyyy (put you second phone number)

Again apply changes.

We're almost done. Now to make this work we have to create Outbound Route, so click Outbound Routes
Put Route name as you wish, i have called it Portech_1 (since i will add another and will make it Portech_2)
Dial Patterns: i have put 049XXXXXX because i want only mobile numbers from the same provider to go through this trunk (through Portech) i mean i want to cut the costs right?

Trunk Sequence: i added SIP/SIM1 and SIP/SIM2
You can separate Trunks from OutRoutes if you have SIM cards from two different providers, just create another Outbound Route remove one Trunk from trunk sequence of the first route that we created and add it to this new one. Submit.

Also don’t forget in order to receive calls you need to have Inbound Route setup on Asterisk/freepbx. To get you started just create new Incoming route set you destination to an extension or ring group or any other destionation you would like to transfer calls to.

Only thing you left to do now is click Submit Changes then Apply Configuration Changes and pray for this to work.

Hope this new configuration will work better.

11 comments:

Unknown said...

Outbound your settings work great. Inbound doesn't work for me without enabling anon. sip calls. Even when I do that it doesn't know where to send the call, I've been trying to get it to send the call to my * box and present my trunk # to route the call that way but it does not seem to work. Is yours * server setup to receive anon sip calls and how are you directing the incoming call to a particular ring group or inbound route?

Unknown said...

Oh i guess i should add just few more steps for inbound routes.

Ok this is the way you could try. 1st i do have enabled Allow Anonymous Inbound SIP Calls.
On your SIM trunks under Incoming Settings > USER Context put your mobile number and then create a Inbound Route with any description you like and in the DID Number put exactly the same number that you wrote in USER Context and finally set destination to where you like your calls to go.

Hope it will work

Unknown said...

Ok so what I ended up doing is leaving everything basically like you have it in the post, except for the mobile to lan destination I put the DID number @ * ip. i.e. 8008008000@serverip and adding in freepbx the 8008008000 DID inbound route. Works great!!! Thanks for the tutorial. Only other piece that doesn't quiet work as I would like is the caller id, it puts the number in the name field and a 101 in the number field each time. If I get that worked out I'll post again.

Juanito said...

Hello!

I have one MV-374 working ok (nearly). When I call from outside my softphone start ringing but when I hang up outside phone it still ringing about 5 seconds. Is this ok?

Regards

Staff di Prova il VoIP said...

I've tried your configuration on an MV-370 (only one SIM Card) but even if outbound calls works well when an inbound calls is directed to the Portech a message "the number you have dialed is not in use..." is played to the external caller.
I've tried all settings you have suggested even if in the "Mobile Settings" menu of my MV-370 for CLID presentation the only options available are: OFF or ON (and I've choose : "ON").
It seems to me that the external call is forwarded to Trixbox/Asterisk server but the the inbound route don't works well (I've setted as destnation an internal extension).
Besides, the "allow anonymous SIP calls" don't seems to affect the behaviuor because even if it is set to "NO" or "YES" the message played is the same.
I've tried also to set "8008008000@serverip" as Andy has suggested but the result was the same.
Finally I've tried to set DID number with or without Country code (+39333xxxxxxx or 333xxxxxxx) but don't works too.
Any idea?
Thanks in advance
Cosimo

Unknown said...

Cosimo:

It will be a little difficult to help you without hands-on but i'll try my best.
So reset configuration as per my post and make sure you put you mobile number in your Trunk on both Outbound Called ID and USER Context then for testing (to make sure it works) create an inbound route with Any DID/Any CID (create inbound route give it a desc. and leave both DID and CID blank then set destination to an working extension) and don't forget to set "Allow Anonymous Inbound SIP calls" to YES, it's important otherwise whatever you do it wont work since the portech is not registering in asterisk like in my old configuration post.
If it works then you can create another inbound route where you will put your phone number in DID (same as you wrote in trunk Outbound caller ID) and choose destination as you need.
If you have problems come back and i will be glad to help as much as i can.

Unknown said...

Thanks guys, I found this page really helpful. Patrick

Unknown said...

MV-374 has 4 sims should I use other 2 different ports for sim 3 and sim 4??!?!

Unknown said...

@Kelvin Ekonomi
I never had a chance playing with MV-374 but yeah you should probably assign different ports for each SIM port. Use whatever port you wish e.g.:
Mobile1: 5060
Mobile2: 5062
Mobile3: 5063
Mobile4: 5064

Unknown said...

From all my googling about the MV-37x and asterisk, this was the page that actually made things work, particularly with inbound calling.

My only problem is that for inbound calls (mobile -> lan), if I hang up the calling phone, the destination still rings on. I think Juanito mentioned this problem (June 19, 2009). If however I hangup the destination (iphone phone or sip client), the calling number also immediately hangs up.

Unknown said...

+Hilkiah Lavinier

I'm really glad that my article got you into right direction setting up Portech MV-37x. I remember i had slightly similar problem back then about line didn't hangup after calling party disconnected but can't really remember what was the solution or if it was Portech related or maybe completely another device.

Since i left the company where i worked a lot with Voip devices back in 2009 i never had contact with Portech again unfortunately.

I'll try to dig some old documentation and see if i can find anything. No promises thou :)

Sorry for not being helpful and good luck.