Help needed with configuration of PJSIP for use with IMS via proxy

Hi, having had issues getting Asterisk working with an IMS trunk using chan-sip, I have been trying to get it working with pjsip and Asterisk 13.9.0 built with bundled pjproject.

I am creating the config via FreePbx, and verifying manually - there appear to be some issues with PJSIP and FreePbx that are not the subject here.

The registration is not being sent out although Asterisk believes it is:

res_pjsip_outbound_registration.c: No response received from 'sip:ims.mnc010.mcc208.3gppnetwork.org' on registration attempt to 'sip:+3399XXXXXXXXXX@ims.mnc010.mcc208.3gppnetwork.org'

From debug, I see:

res_pjsip_outbound_registration.c:560 handle_client_registration: Outbound REGISTER attempt 10 to 'sip:ims.mnc010.mcc208.3gppnetwork.org' with client 'sip:+3399XXXXXXXXXX@ims.mnc010.mcc208.3gppnetwork.org' [2016-05-16 16:10:46] DEBUG[2538]: pjproject:0 <?>: tsx0x760061a4 Failed to send Request msg REGISTER/cseq=1115 (tdta0x76005138)! err=320053 (DNS "Name Error" (PJLIB_UTIL_EDNS_NXDOMAIN)) [2016-05-16 16:10:46] DEBUG[2538]: res_pjsip_outbound_registration.c:928 sip_outbound_registration_response_cb: Received REGISTER response 502(DNS "Name Error" (PJLIB_UTIL_EDNS_NXDOMAIN)) [2016-05-16 16:10:46] DEBUG[2986]: res_pjsip_outbound_registration.c:785 handle_registration_response: Processing REGISTER response 502 from server 'sip:ims.mnc010.mcc208.3gppnetwork.org' for client 'sip:+3399XXXXXXXXX@ims.mnc010.mcc208.3gppnetwork.org'

The registration has to be via a proxy internet.p-cscf.sfr.net:5064 which Asterisk appears to be ignoring.

To debug, I have used the bundled PJSUA client and successfully registered using the following conf file:

# Test config file for SFR --id sip:+3399XXXXXXXXXX@ims.mnc010.mcc208.3gppnetwork.org --registrar sip:ims.mnc010.mcc208.3gppnetwork.org --realm sfr.fr --username NDI0XXXXXXXXXX.LIBERTALK@sfr.fr --password MYPASSWD --proxy sip:91.68.1.28:5064;lr --use-ims --reg-timeout 3600

My Asterisk PJSIP endpoint is set up as follows:

`[SFR_Lys_PJ]
type=registration
transport=0.0.0.0-udp
outbound_auth=SFR_Lys_PJ
retry_interval=60
max_retries=10
expiration=3600
auth_rejection_permanent=yes
contact_user=+3399XXXXXXXXXX
server_uri=sip:ims.mnc010.mcc208.3gppnetwork.org
client_uri=sip:+3399XXXXXXXXXX@ims.mnc010.mcc208.3gppnetwork.org
outbound_proxy=internet.p-cscf.sfr.net:5064;lr

[SFR_Lys_PJ]
type=identify
endpoint=SFR_Lys_PJ
match=internet.p-cscf.sfr.net

[SFR_Lys_PJ]
type=aor
qualify_frequency=60

[SFR_Lys_PJ]
type=endpoint
transport=0.0.0.0-udp
context=from-trunk
disallow=all
allow=ulaw,alaw,gsm,g726
aors=SFR_Lys_PJ
outbound_auth=SFR_Lys_PJ
from_domain=ims.mnc010.mcc208.3gppnetwork.org
from_user=+3399XXXXXXXXXX@ims.mnc010.mcc208.3gppnetwork.org
t38_udptl=no
t38_udptl_ec=none
fax_detect=no
t38_udptl_nat=no
dtmf_mode=rfc4733

[SFR_Lys_PJ]
type=auth
auth_type=userpass
password=MYPASSWD
username=NDIXXXXXXXXXX.LIBERTALK@sfr.fr`

Having examined the conf file in detail, I have seen that there is nowhere to declare the --use-ims option, although I believe that the is only used by the app and not the lib.

I would appreciate any pointers on where this config is going wrong, and as to why I am unable to register.

Thanks