First, you shouldn’t need two trunks to the same provider, just route all your DIDs to the same (sub)account. If this doesn’t work, report what (if anything) appears in the Asterisk log on an attempted incoming call, what the caller hears, and what gets logged at VoIP.ms.
Next, assuming that you want two trunks, are they configured identically, except for username and secret?
That is bizarre, given that it appears registered from your end. Conceivably, you are registering to a different account. To troubleshoot this, set Expiration short, e.g. 120 seconds, so you don’t have to wait long for a re-registration. At the Asterisk command prompt, type pjsip set logger on
wait for a re-registration, and look in the Asterisk log at the REGISTER request and their responses. If you have trouble interpreting them, paste the relevant section of the log at pastebin.com and post the link here.
pjsip has a feature to associate an incoming call to the proper trunk, “Send Line in Registration”. However, this is on by default so it shouldn’t be a problem. Even if this isn’t working, it’s not a problem unless the trunks have different Context, codecs, etc.
Thanks for your time Stewart. Yes, I needed to separate them for the billing purposes.
They are both SIP with identical settings, POP’s but different credentials.
Why are you using chan_sip? There are a lot of details that may be relevant here that I don’t know:
How often does it re-register on auth failures?
Does it give up after some number of failures?
Does “No Authentication” include no response or other conditions that preclude sending auth?
Unless you have a strong reason for using chan_sip, please delete the trunks and set them up as pjsip.
On the pjsip General tab, fill in Username, Secret and SIP Server. Leave everything else default.
On the Advanced tab:
Expiration: 120 (so we don’t have to wait long for re-registration if we need to capture traffic)
Contact User: (same as what you had after the / in your chan_sip Register String, if anything)
From Domain: (same as SIP Server)
From User: (same as Username)
Here is what I see now in asterisk -vvvr after set one as pjsip:
res_pjsip_outbound_registration.c:1383 handle_registration_response: 403 Forbidden fatal response received from ‘sip:sanjose2.voip.ms’ on registration attempt to ‘sip:acc#@sanjose2.voip.ms’, retrying in ‘30’ seconds
I just tested to sanjose2 and was able to register ok. In the VoIP.ms portal, go to Manage Sub Accounts.
Confirm that you don’t have an IP or POP restriction set. Check username. If all correct, generate a new password and paste it into Secret for the trunk.
The optimal time is never, i.e. use a static address and configure that on the provider.
If the provider doesn’t like your proposed interval, they should be overriding it anyway.
Otherwise it depends on things like whether your IP address is unstable, whether it is needed to keep dynamic router rules up (although qualify is normally used for that) and how much bandwidth can you spare for it., etc.
So, most of my trunks are 120s for re-register now. Are you saying that if it works then it means that ether they are okay with it or their servers override my values anyway?
My FPBX machine is behind a dynamic public IP (Spectrum), which I’d say never changes, I have this place for 3 years… My PBX now serves 2 households, I have my softphone with me when I’m on the field and VPN is always on.
It’s expensive CPU’wise and bandwidth’wise to do these SIP packets, ACK, etc. exchanges every 2 minutes. Just my though.
The registrar can reduce the expiry time and it can also, effectively, force expiry times up, but not beyond one hour. The latter is done by rejecting with an offer of an acceptable minimum value.
I’d suggest that 120 seconds is rather aggressive, in your environment. The default is one hour, although there may be reasons for forcing lower values.