Asterisk 20 PJSIP Dialing Specific Contact from Multiple Registratons)

Happy Humpday!

For one of our WebRTC apps we’re allowing multiple registrations to a single PJSIP endpoint.

I’m trying to dial a specific registration from the list of available registrations.

Just dialing the endpoint works fine using PJSIP_DIAL_CONTACTS, all registered peers receive the call. If I dial just the endpoint, the first registration receives the call.

However, I need to cherry pick a specific registration.

I tried, as an example, for a known registered endpoint’s IP address and RPORT:

Dial(PJSIP/endpoint/sip:endpoint@1.2.3.4:5060)

Note that while I changed the IP address and RPORT for this port, the public IP and PORT is correct in my actual dial string.

Which results in a long delay and then CHANUNAVAIL.

I also tried:

Dial(PJSIP/endpoint@1.2.3.4:5060)

Which results in endpoint 1.2.3.4:5060 was not found.

So I’m clearly missing something here, any advice would be greatly appreciated.

Big thanks :slight_smile:

Dial(PJSIP/endpoint/sip:endpoint@1.2.3.4:5060)

Will dial the given URI, using the given endpoint. That is how PJSIP_DIAL_CONTACTS also works. If it’s not working, then the URI isn’t correct. Double check, ensure that it’s the right transport type, look at the PJSIP logger.

Hmm… PJSIP_DIAL_CONTACTS shows

PJSIP/endpoint/sip:tum1nihc@1.2.3.4:5060;transport=ws;x-ast-orig-host=g8pjpt5s9ubb.invalid:0

I did try dialing like this as well:

Dial(PJSIP/endpoint/sip:tum1nihc@1.2.3.4:5060)

Okay, thanks, digging in to the logs now :+1:

That’s not equivalent. The full URI is:

sip:tum1nihc@1.2.3.4:5060;transport=ws;x-ast-orig-host=g8pjpt5s9ubb.invalid:0

You need to include at the very least “transport=ws”.

3 Likes

Okay, success! I had to escape the semicolon.

Big thanks for the help, per usual :beer: :beer: :beer:

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