[SOLVED] How to set outbound_proxy with pjsip

Hi all;
I’m unable to solve a configuration issue.

What I’m trying to do is this: I need to send an INVITE for outgoing call to sip proxy aa.bb.cc.dd having a request URI like "012345@example.com".

My pjsip.conf is like this:

[myitsp]
type=endpoint
context=xyz
transport=transport_myitsp
aors=myitsp_aor
user_eq_phone=yes

[myitsp_aor]
type=aor
contact=sip:aa.bb.cc.dd:5060
qualify_frequency=10
qualify_timeout=3.0

[myitsp_id]
type=identify
endpoint=myitsp
match=aa.bb.cc.dd

I don’t know how to set outbound_proxy and where to specify “example.com”.
Can anybody give me some hints? I’ve read the docs but I’m unable to pin it down.
Thanks

eehhhh… the wiki…

https://wiki.asterisk.org/wiki/display/AST/PJSIP+with+Proxies

1 Like

Hi Meightee;
I’ve read the wiki, but I can’t figure out how to preserve the called number.

I’ve tried to modify the configuration like this: in the endpoint configuration, i’ve added

outbound_proxy=sip:aa.bb.cc.dd:5060;lr
while in the aor I’ve set
contact=sip:example.com

But doing this make the contact URI in the INVITE something like sip:aa.bb.cc.dd:5060, which is WAY different from 0123456@example.com

I’ve found a solution, which DOESN’T involve the outbound_proxy: I’ve setup a SRV record for _sip._udp.example.com, and that (for now) fixes the issue, but I don’t think that this solution can be universally valid.

You did not put a "\" at the end before “;lr” so it was treated as a comment. It needs to be"\;lr" and then it will be as you want.

1 Like

Thanks! That did the trick.

I suspected that the semicolon was misinterpreted.
I had tried to quote the entire string, but didn’t think of escaping the “;”.