I am in the process of upgrading a very old Asterisk system to 18.3. Part of this process is moving to pjsip. I’m using pjsip_wizard.conf for configuration, and I’m at the point where it looks “Registered”:
I was wondering if it looked like I missed anything. (This is my first foray into using pjsip.) I realize it may be “working”, but I’d prefer for it to be “optimal”.
I understand that my provider sets the registration interval. I want to know how to avoid the useless SIP exchange (REGISTER / Trying / Unauthorized) that is happening every 60s before the successful REGISTER exchange.
I have local_net, external_media_address and external_signaling_address configured in the transport-udp-nat stanza in pjsip.conf. I’m trying to understand why the OPTIONS message is being sent with the server’s internal IP address in the From: header. Are there some other settings I’m missing?
(As for using TCP/TLS, unless things have changed, last time I checked Vitelity is UDP-only. And that’s another bridge to cross later… right now I’d just like to get the old config working under 18.3.)
It’s not useless. It provides the random challenge (nonce) for the authentication. Nonces only have a short lifetime, so even trying with the same one as last time won’t normally help.
Ah, thanks david551! The piece about the nonce in the first registration attempt is what I was missing, and makes sense. So that explains that, at least!
If anybody has any ideas about the OPTIONS message (sent after the REGISTER exchange is completed) returning 404 Not Found, I’d be happy to try out some suggestions…
Hmm. I thought it might be related to REGISTER using:
From: <sip:vitel_subacct@inbound5.vitelity.net>;tag=0ac443a5-43e2-4cfb-9563-41b7726856fa
To: <sip:vitel_subacct@inbound5.vitelity.net>
but OPTION sending this:
From: <sip:vitel_subacct@192.168.1.10>;tag=282e737c-7158-45ee-94c7-0bba2d458381
To: <sip:outbound.vitelity.net>
I was thinking the “Not Found” reply could be related to the lack of an account name in the To: header… but not sure what I’d need to adjust in pjsip_wizard.conf to try forcing a username to be included in that To:.
Thanks for taking the time to reply, david551. Much appreciated!
Seems silly to me to send a SIP OPTIONS message if it’s not doing anything useful… if for no other reason than it’s extra noise when I’m watching SIP debug logs.
Assuming it serves no purpose, is there a setting to disable sending the OPTIONS message after each REGISTER?
Alternatively, is there a way to add a username to the OPTIONS message’s To: header to see if that makes the peer reply back with an OK so it doesn’t seem like an error?
They serve the purpose of detecting whether there is something at the other end, so that you don’t have to wait for a timeout to know the call will fail, and also to calibrate the size of the timeout used, so you don’t resend prematurely.
For chan_sip, they are controlled by qualify and qualifyfreq(ency)
Ah, that’s a good piece of info and an association that I was missing.
In pjsip_wizard.conf, I went ahead and set aor/qualify_frequency = 0 on my inbound trunk since it requires registration… and it stopped the OPTIONS message that generated the “Not Found” reply from being sent.
But it was unexpected that a successful REGISTER exchange doesn’t count as a successful “qualification”. Since my provider sets a 60s registration timeout, I’m already exchanging messages as frequently as setting aor/qualify_frequency = 60 would. But when it’s set to 0, it just shows up as NonQual. I was hoping to only need to send qualifications for the outbound endpoint. (My provider has separate hosts for inbound registration and outbound calls.)
In any case, thanks again for the insight, david551. I like to understand the reason for the traffic coming to/from my network and devices, and now it makes a bit more sense.