Page 1 of 1

SIP problem with incoming calls

Posted: Thu Dec 08, 2016 12:07 pm
by oonyxx
Hi there,
i am new to Mikrotik routerboard and i don't know much about the configurations. Just the basic stuff, NAT, DHCP etc.

I have problem when transferring calls from an Asterisk server to another in 2 separate location. I have created the NAT for both public IP's of the location and also the SIP Trunk between the two servers. It worked fine for a long time. A week or so now i get this problem, either the call goes to the other location but no voice either the call doesn't arrive at all. The configuration is the same as it was when it was working fine. While searching i came up with some posts that SIP service ports might create problems with incoming calls. So on the MT router that accepts the calls in location B i disabled it and on the MT router that sends calls i leaved it enabled. When this problem occurred i had to restart the MT router on the sending location A. After the restart all it was fine! Until today. It is really frustrating that one configuration that worked fine doesn't work just it did anymore.

I am guessing that the problem is on the MT router on the sending location A... From the Asterisk CLI i get the message "Unable to create channel of type SIP", which make me think that there is some NAT or Firewall Problem...

NAT Configuration
Location A (sending calls): dst-nat of IP of location A with IP of location B with a range 5000-35000 (SIP Service port is Enabled) - MT Routerboard v6.33.3 RB951-2n
Location B (receiving calls): dst-nat of IP of location B with IP of location A with a range of 5000-35000 (SIP Service port is also Enabled) - MT Routerboard v6.19 RB951Ui-2HnD

Any suggestions please? This problem is driving me nuts...

Re: SIP problem with incoming calls

Posted: Thu Dec 08, 2016 4:52 pm
by tnarnold
On Asterisk you have an option directmedia:
Try this option to "no" if you don't have too many clients or you have a powerful hardware to Asterisk, and try again.

Re: SIP problem with incoming calls

Posted: Fri Dec 09, 2016 4:39 pm
by oonyxx
Hi and thank you for replying. I have already added that option to the dialplans of both Asterisk servers... As matter of fact i rebooted the two Mikrotik routers on both ends (SIP Service posts are ENABLED on both of them, the MT router on the sending point has also enabled in SIP Service Ports the Direct Media) and the call transfer miraculously worked (!)

But this is something proved nothing but temporary... I had this problem 3-4 times before, i again restarted both routers and media converters on both sides and it was fixed but after 1-2 days the same problem occurred again...

This is really strange!
Image of MT router settings in Sending point
http://imgur.com/a/IwMNr

Image of MT router settings in Receiving point
http://imgur.com/a/XXiMn

PS: i checked online and directmedia is the same as canreinvite, which i directmedia is for Asterisk 1.6 but i have 1.4

Thanks @tnarnold

Re: SIP problem with incoming calls

Posted: Fri Dec 09, 2016 5:35 pm
by pe1chl
SIP and NAT are not friends... maybe you can solve the issue by setting up a VPN that allows
traffic between the locations without having NAT on the endpoint addresses? That usually clears
up a lot of issues.

Re: SIP problem with incoming calls

Posted: Fri Dec 09, 2016 6:48 pm
by tnarnold
SIP and NAT are not friends... maybe you can solve the issue by setting up a VPN that allows
traffic between the locations without having NAT on the endpoint addresses? That usually clears
up a lot of issues.
Exactly,... I think is a good practice to setup a vlan only to sip/rtp communication and with the mikrotik it'll be easy.

Re: SIP problem with incoming calls

Posted: Fri Dec 09, 2016 6:57 pm
by oonyxx
SIP and NAT are not friends... maybe you can solve the issue by setting up a VPN that allows
traffic between the locations without having NAT on the endpoint addresses? That usually clears
up a lot of issues.
Exactly,... I think is a good practice to setup a vlan only to sip/rtp communication and with the mikrotik it'll be easy.
I am not sure if i know how to do that. I don't know much about Mikrotik configuration. Any link that might help me set up this?

Thanks

Re: SIP problem with incoming calls

Posted: Sat Dec 10, 2016 12:23 am
by MTeeker
....I am not sure if i know how to do that. I don't know much about Mikrotik configuration. Any link that might help me set up this?
To start with, here is a link that gives some good background to your issues. Your project will involve several steps along the way.

http://www.voip-info.org/wiki/view/NAT+and+VOIP

I'm pretty sure more specific and pointed questions relating to Mikrotik configurations/settings will arise along the way such as how-to VLAN in MikroTik, best method of VPN for your setup (current and future needs), and QoS for VoIP, etc.. Just ask then.

Good luck.

Re: SIP problem with incoming calls

Posted: Sun Dec 11, 2016 4:32 pm
by tnarnold
SIP and NAT are not friends... maybe you can solve the issue by setting up a VPN that allows
traffic between the locations without having NAT on the endpoint addresses? That usually clears
up a lot of issues.
Exactly,... I think is a good practice to setup a vlan only to sip/rtp communication and with the mikrotik it'll be easy.
I am not sure if i know how to do that. I don't know much about Mikrotik configuration. Any link that might help me set up this?

Thanks
http://wiki.mikrotik.com/wiki/Manual:Interface/VLAN