[Solved] Incoming calls not working - SIP trunk with sipcall.ch

Hello guys,

I spent my last 2 days closed in my office and leaving only for indispensable duties until I understand that I’m not Einstein and I could have tried to ask for help to complete my setup.

I need to setup a PBX with 5 different VoIP provider and I am having hard time with a couple of them.
I opened this topic for the connection with sipcall.ch
From their portal I understood that they use the platform PortaOne Switch to provide service to customers. I don’t know if this information could be useful to understand the issue.

It provides me with a range of 10 numbers from 4144XXXXX10 to 4144XXXXX19 and they are configured as different accounts (so I probably need 10 trunks).

The username is 419944XXXXX12, while the CID is 4144XXXXX12

The reason why I’m going crazy is that if I setup any SIP client it works correctly but if I setup the trunk, no incoming calls.

This is how I setup my sip trunk:

*Outgoing Settings
[/code][code]
Trunk Name: Sipcall_12
[/code][code]
PEER Details: 
useragent=Elastix2.5
username=419944XXXXX12
type=peer
secret=password
host=212.117.XX.XX
fromuser=419944XXXXX12
qualify=yes
[/code][code]
*Incoming Settings
[/code][code]
USER Context: 419944XXXXX12
[/code][code]
USER Details: 
useragent=portasipfriendly
type=friend
qualify=yes
dtmfmode=RFC2833
insecure=port,invite
canreinvite=no
secret=password
username=419944XXXXX12
fromdomain=212.117.XX.XX
host=212.117.XX.XX
disallow=all
allow=ulaw&alaw
[/code][code]
*Registration
[/code][code]
Register String: 419944XXXXX12:[email protected]/4144XXXXX12

The trunk is reachable but not registered. If I call the number 4144XXXXX12 I don’t see anything from the CLI.
If I enable the debug I can see that I’m sending the SIP message OPTIONS because I have qualify set on yes and the reply from the server:

<------------->
--- (7 headers 0 lines) ---
Really destroying SIP dialog '[email protected]:5060' Method: OPTIONS
Reliably Transmitting (no NAT) to 212.117.XX.XX:5060:
OPTIONS sip:212.117.XX.XX SIP/2.0
Via: SIP/2.0/UDP 81.169.XX.XX:5060;branch=z9hG4bK00371e03
Max-Forwards: 70
From: "Unknown" <sip:[email protected]>;tag=as7346743a
To: <sip:212.117.XX.XX>
Contact: <sip:[email protected]:5060>
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
User-Agent: FPBX-2.11.0(11.17.1)
Date: Tue, 16 Jun 2015 11:13:42 GMT
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, PUBLISH, MESSAGE
Supported: replaces, timer
Content-Length: 0
---
<--- SIP read from UDP:212.117.XX.XX:5060 --->
SIP/2.0 501 Unsupported Method
Via: SIP/2.0/UDP 81.169.XX.XX:5060;branch=z9hG4bK00371e03
To: <sip:212.117.XX.XX>;tag=a8be9d6e
From: "Unknown" <sip:[email protected]>;tag=as7346743a
Call-ID: [email protected]:5060
CSeq: 102 OPTIONS
Content-Length: 0
<------------->

sip show peers:

Sipcall_112/419944XXXXX12 212.117.XX.XX         Auto (No)  No             5060     OK (26 ms) 

sip show users:

419944XXXXX12              password                          from-trunk-sip-  No   No

sip show registry:

212.117.XX.XX:5060                     N      419944XXXXX12       120 Unregistered

From the provider’s panel I can see the number is not registered.

Thanks a lot in advance for your help. Please let me know if you need any other info.

Try leaving Incoming Settings blank (nothing in there),
(both in the USER context and USER details fields)

only fill in the [outgoing] [i meant TRUNK, sorry] ones.

Also on my providers’ platform (Blueface) I had to use register string in form of

username:password@host/username

(yes that is SIP USERNAME twice, not the DID number).

I tried, but nothing change. I actually tried a lot of different configurations, really, and I suspect that the issue is not on my side.
What I don’t understand is that I can successfully connect any SIP client to that number. Furthermore that number was already setup before on a sip server (not sure if it was Asterisk based or something else).

I don’t see any calls arriving. I sent an email to the support but they doesn’t seem to reply me back. And I need this to be up asap. :frowning:
Anyone has some advice on what else I could check?

Other than that, observation of SIP conversation can help (asterisk -vvvvvr and in another terminal ngrep (e.g. ngrep -T [your_providers_IP_here] port 5060 ) ) can help seeing what’s it not agreeing with.

(just because you’re under pressure, please don’t take me wrong :
it’s useful to have ngrep (which also requires libpcap, and I see in my bash history, I also tried compiling newer version of ngrep but then not sure if I used it), and ‘screen’ packages installed)

I installed a brand new FreePBX on a virtual machine and setup the trunk. It registered right away!

I only setup the outgoing settings and registration string as following:

username=419944XXXXX12
useragent=portasipfriendly
type=peer
secret=password
qualify=yes
host=212.117.XX.XX
fromuser=419944XXXXX12
context=from-trunk

419944XXXXX12:[email protected]/4144XXXXX12

However, it does not receive calls anyway.

That is a step further because I can see invitation and registration from the asterisk console.

The main differences between the virtual machine (working) and the real server (not working) are:

  • The virtual machine is FreePBX 12.0.68 while the real server is Elastix 2.5 based on FreePBX 2.11.0.38
  • The virtual machine is behind a router and a NAT while the real server has it’s own public ip address. I don’t know if the server provider is blocking something.

I’m lost…

Does the ‘real’ machine generally ‘have Internet’, meaning, can it check for its updates, even download anything from Internet (update its distro from mirrors, for example)? Does it have a routing table setup right? (compare output of ‘route -n’ on both deployments - especially for existence of ‘default gateway’ entry), can it find any host on internet by name (unfortunately I don’t remember the place where the dns servers’ addresses go, check /etc/resolv.conf possibly but YMMV)? Is its host/mask/bcast/network address set up right in ifconfig ?

Sorry for this kind of questions :wink: hope it helps.

I installed that server, updated and setup 4 other trunks. Internet is not an issue on it.
The sipcall.ch support finally replied me with this:

Dear Mr. Frangella,

best regards for your support inquiry.
Presently no active SIP-trunk is active with the collective account (ID XXXX: MyCompanyName), where the mentioned account (ID 419944XXXXX12) is managed in.

First set up the trunk within the productorder -"menu", on the collective account (ID XXXX: MyCompanyName), then only register the defined main number with the PBX and configure the trunking accordingly.

Please note for more details on our collective account products, the manual available in german and french here:
https://support.sipcall.ch/index.php?/sipcallat/Knowledgebase/Article/View/558/95/sipcall-pro--business-konten
https://support.sipcall.ch/index.php?/sipcallat/Knowledgebase/Article/View/559/95/comptes-sipcall-pro--business

Your issue has also been forwarded to the backoffice, to consider your request.

The sip trunk need to be configured from their portal.
I now asked if that include additional costs and then I’ll setup the trunk from the portal.
I’ll keep you updated.

That was not the solution because the authentication doesn’t change setting up a sip-trunk. The only difference is that they deliver all DIDs into 1 channel.

Please help me to troubleshoot this. I have no clue of what to do…

OK (sorry I forgot you’ve written about it in the first post…).
My german’s a bit rusty but can’t see anything out of ‘ordinary’ there too, at a very quick glance.
I still think your best way to look for definitive answer is ngrep, it can understand the SIP packets and can show you what is the server response (if any).

It seems that my server is not sending any invite to the provider. From the tcpdump I can only see the options message but no invite sent.
I really don’t know what to do. I’m thinking to re-install everything at this point…

Does someone have any idea why my server don’t send invites? Or how I could find the reason…

in addition to what you set to it now, what about adding insecure=invite (or as you had it on User options, insecure=invite,port) to the trunk/outgoing options ? (my trunk options do have insecure=invite;) also maybe consider adding deny=0.0.0.0/0 and permit=[most probably the subnet your SIP provider uses] (deny/permit order important,and all that)

( Just a stab in the dark, following http://www.voip-info.org/wiki/view/Asterisk+sip+insecure , since you had the option(s) in what-you-found advice for sipcall.ch )

(Also maybe check if the built in fail2ban has not blacklisted it already, IIUC it adds netfilter/iptables rules or something like that. )

I finally find the solution:

The only difference I had between the virtual and the real server was that one was behind the nat and the other one wasn’t. So it had to be something with the network configuration! Today I found inside the asterisk configuration the settings for nat. On the real server the nat was on (default value) but it has a public IP so I set it to “public IP”. I then forgot about it because nothing was changing but the reason why it was not working is because I forgot a very important step: restart asterisk service !! So the solution was just to disable the nat in the asterisk configuration…

Finally, after 3 days my user is registered:

h2449554*CLI> sip show registry
Host dnsmgr Username Refresh State Reg.Time
212.117.XX.XX:5060 N 419944XXXXX1 105 Registered Wed, 17 Jun 2015 15:13:11

el_es, thank a lot for your support, really.

1 Like

Glad you found it :slight_smile: been there, done that (though not on Asterisk) kind of things :wink: