Direct dial to IP address and port works in SIP but not PJSIP

When using SIP you can direct dial to a device at a particular IP address and port using this form in your Dial statement:

Dial(sip/$OUTNUM$@dotted.i.p.address:port) (where OUTNUM is replaced by the number you are sending to the device).

But if you are trying to use PJSIP only, and you change SIP to PJSIP, calls fail. The only example I could find for doing this is from here and shows this:

Dial(PJSIP/mytrunk/sip:${EXTEN:1}@203.0.113.1:5060)

What has me confused is the /mytrunk/ part of this. In this case the call isn’t going through a trunk, it’s going direct to a device at a specific IP address. Does this have to be associated with a trunk when using PJSIP, or is there a way to do this without including a trunk name?

It has to be associated with an endpoint. An endpoint defines the configuration to use when talking to the given URI.

1 Like

Thanks for the reply. That does not really make sense to me but could an endpoint also be a PJSIP extension? That would make a lot more sense than a trunk in this particular case.

Extensions and trunks are no different in PJSIP. They are all endpoints, with an endpoint being something you speak SIP to - an ITSP, a gateway, a phone, etc.

1 Like

Okay, great, I will use an extension instead of a trunk then. Thanks!

You could also just define an endpoint that you use for outbound dialing to a SIP URI.

1 Like

Oh okay, that would work too. But I already have an extension associated with that device so in this case the extension would be the most logical choice, I think.

Yes, that is perfectly fine then.

1 Like

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