Proxy IP in pjsip Register String? Advanced Settings are ignored

Hello everyone,

it seems like the advanced settings are ignored.
I got the following data from my provider:

  • SIP-Username
  • Password
  • SIP-Domain
  • Proxy-IP

The example from my provider looks like the following:

Request-Line: REGISTER sip:username@domainSIP/2.0 
From: <sip:+496021123450@username@domain>;tag=da43b28730 
To: <sip:+496021123450@username@domain> 
Call-ID: 2679ec74974aa79b 
CSeq: 33605 REGISTER 
Max Forwards: 70 
Content-Length: 0

Output in Asterisk Log Files looks like the following:

REGISTER sip:*Proxy-IP* SIP/2.0	
32021	Via: SIP/2.0/UDP *LAN-FREEPBX-IP*:5060;rport;branch=xxx	
32022	From: <sip:*SIP-Username*@*SIP-Domain*>;tag=xxx	
32023	To: <sip:*SIP-Username*@*SIP-Domain*>	
32024	Call-ID: xxx	
32025	CSeq: 36367 REGISTER	
32026	Contact: <sip:s@*LAN-FREEPBX-IP*:5060;line=fotvwfy>	
32027	Expires: 3600	
32028	Allow: OPTIONS, INVITE, ACK, BYE, CANCEL, UPDATE, PRACK, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, MESSAGE, REFER	
32029	Route: <sip:*SIP-Domain*:5060>	
32030	Max-Forwards: 70	
32031	User-Agent: FPBX-15.0.23(16.24.1)	
32032	Content-Length: 0

No matter what settings I change they always stay the same. Sorry for the dumb question but I get any further on my own.

chan_pjsip requires the proxy to be specified as it would be in an incoming Route header, i.e. with the “;lr” for loose routing appended, if you want the request as indicated by the provider.

If doing this directly, in the config file, you would need to escape the ; with a \

I know that the GUI can accept the ;lr, but I can’t remember if it needs the \

For the trunk, set Outbound Proxy to
sip:Proxy-IP\;lr\;hide
and in Asterisk SIP Settings, check that External Address and Local Networks are correctly set.

Restart Asterisk and retest. There are likely other changes needed, but this should get you closer.

I missed the use of the internal address, as I was only looking for proxy issues. Although Stewart says check the External addresses, he really means set them (unless Proxy IP is within your local network).

@david55 @Stewart1 thanks for the fast replies!

I added the External Adress, Local Network and edited the proxy settings.
Trunk is now registered and outbound calls seem to work fine.

Inbound calls however only work if set the DID to “any”. In the logfiles for the incomming calls I can see that the DID is always “s”. Seems like there is something else which is not configured right in the trunk configuration. I got two phone numbers from my provider so to register them both the DID is necessary if I got that correctly.

I set my phone number in the “Contact User” settings of the trunk configuration. I don’t know if this was the right thing to do but incomming calls seem to work aswell now.

This topic was automatically closed 31 days after the last reply. New replies are no longer allowed.