I have a few issues which I dont quite know how to address or explain. This is my situation; I have 47 trunks actively working in - out ,but the latest 3 trunk I added are having issues. All config is 1/1 identical but , when an incoming call is received, asterisk rejects via 401 unauthorized.
There are no explicit authentication in place
all other trunks work fine ,as all settings are 1/1 identical
When I enabled logger debug, saw a lot of messages like
" res_pjsip_endpoint_identifier_ip.c: Source address x.x.x.x does not match identify ‘1234567890’
My endpoints aer configured as real time, everything works perfectly except for the latest 3 trunks I added . I know the settings are identical as I checked them one by one , also I have a prepared query that runs when creating the EP 's so I know there are no typos.
The only difference between the success and failed attempt is the ; Line = xxx parameter in the invite header , which I have no idea what it is for. The provider was supposed (and is I suppose) sending calls without authentication , and I have to in-auth configured.
Any help / input / advise will be highly appreciated.
You haven’t shown the configuration of a working and non-working.
The line parameter is enabled on the outbound registration. If enabled then the line parameter is placed in it, which allows incoming calls to be associated with the outbound registration and directed to the dialplan. If the line option is not enabled then it won’t be present. It may also not be present if the provider strips the parameter out.
Then you’d have to look at the outbound REGISTER and see if the line parameter is present. If it is, then the provider is stripping it and you can’t use that. If it isn’t present then you may need to restart Asterisk or something.
is the line option I see in within the trace file related to what I have set? I am I understating it correctly ? If that option is not present could it result to 401 Unauthorized? Will it be better if I just ask my provider to provide authorization when forwarding th incoming call to us, will that help?. But that doesn’t really explain why all of a sudden these issues started to happen . Only 3 trunks are having this issue, all other 45 of them are working perfectly fine.
If the “line” option is set on an outbound registration then we create a random string and put it in the “line” parameter in the Contact we send to the provider on the REGISTER. The provider is supposed to send this back to us if they send a call to us. If they do, we are able to associate it with the outbound registration and match the endpoint. If they don’t, we can’t.
You haven’t provided a SIP REGISTER of a non-working trunk, so I can’t comment on that.
If line is not supported then generally you have to do IP based matching, and that only works for a single trunk as all incoming calls will be associated with that.
I don’t know why it’s not working for some, but if Asterisk is putting the line parameter in the outbound registration then Asterisk is behaving as it should.
all outbound calls are working properly. All inbound is ok except for EP xx87, xx69 and xx68. Other than this, all is well. I’ve been arguing with our provider that it must be related to something / some setting on their end. But because the call is hitting our asterisk and asterisk is rejecting the call, they are kind of throwing the bomb back to us thanks again, Ucin
As I’ve stated, it does not contain the line parameter so it can’t match the configured endpoint in the outbound registration. As you haven’t provided the outbound registration, I can’t say if it’s their fault or not.
thanks, I thought the command does what is intended to
pjsip send register <registration> | *all
Unregisters the specified (or all) outbound registration(s) then starts registration(s) and schedules re-registrations.
un-registers and re-registers. So I guess the provider is not using the registration information correctly or is removing part of it as I understand. Since the line option is present, they should be using it for any communication request (maybe only for inbound perhaps ? )
IP based matching wont work as far as I know (I read a couple of your previous posts regarding this topic) all trunks are from the same provider,same single IP, and when I tried to add math IP value, calls started to hit the wrong match header and resulting in 404 not found because it was trying to send 1111 > 11122 because of the IP
honestly I’m open to all other suggestions. Currently we’re in a ping pong situation where they keep throwing the ball to me and I’m doing the same. all trunks are working fine with 1/1 identical settings, same provider ,same IP ,really everything is exactly the same
Why do you have multiple trunks? That suggests you are using service that is intended for use by small businesses and individuals, directly connecting phones to the service. A service oriented at businesses of any size should be providing you with trunks that support multiple calls and multiple called numbers.
unfortunately, thats how things are here. One customer 10 numbers 10 separate registrations. I have a total of 40+ from the same provider all with same IP, at some point it’s bound to conflict . I’m puzzled…
Did you test these trunks on a sip phone ? Do they work as expected . Dont blame a working asterisk before testing the new trunks.
Did you do a pjsip show endpoint X
and compare it with a show endpoint Y ?
Are they completely similar ? I really think it might be you application not providing correct parameters … you can also test modify one working trunk put ip of malfunctioning trunk in it anf reload. See what happens.
You can also add the trunks manually and see.
You czn install a vm and test them too