Call ID Set via sip.conf and extensions.conf

Hi all, new to this. Just trying to learn and screw around. I have gotten zoiper to dial out via gotrunk but I haven’t been able to set a call id. This is what my extensions.conf file looks like:

exten => 201,1,Dial(SIP/201)
exten => 201,n,Hangup()
exten => 202,1,Dial(SIP/202)
exten => 202,n,Hangup()
; send all other numbers to outbound trunk
exten => _[0-9].,1,NoOp(#### [from-internal] ####)
exten => _[0-9].,2,Set(CALLERID(num)=+16666666666) ; set Caller ID
exten => _[0-9].,n,Dial(SIP/+${EXTEN}@trunk) ; send call to trunk peer defined in sip.conf
exten => _[0-9].,n,Hangup()

I’m not exactly sure what to do to get the call ID working. I’ve just been test calling my cell. I know that there’s a callerid set in sip.conf too, but I’m not sure how that fits in to all this.


Try it without the leading plus (+).

Your ability to set Caller ID may be restricted by your SIP provider.

You shouldn’t be using chan_sip on new systems, as it is deprecated and has little or no support.

As already noted, providers may ignore your caller ID, or have required you to prove that you receive calls sent to the numbers used. In the USA, the best you can hope for is a B attestation, for STIR/SHAKEN, and downstream operators may choose to suppress such numbers.

Also, typical consumer accounts, use the From header for account identification, so it is not available for caller ID. This requires the provider to have an alternative means for you to supply caller ID, typically Remote-Party-ID or P-Asserted-Identity, and for you to configure to use it.

One thing I have done for experimentation purposes is set up a second Asterisk server on another machine, as my pretend VoIP provider. Then I can exercise functions on the first server for registering with the second one, connecting test calls etc.

PJSIP may be a little more fiddly to set up than old chan_sip, but that’s because it offers so many more options. One thing I do is give all related stanzas the same name, e.g.

type = registration
outbound_auth = test-provider

type = auth

type = aor

type = endpoint
outbound_auth = test-provider
aors = test-provider

type = identify
endpoint = test-provider

If you really want to get deep into the weeds of SIP, you could set up a Kamailio server, and test Asterisk connecting to that. That gives you very low-level control over details of the SIP exchange that Asterisk itself doesn’t offer.

I believe it is the SIP provider that is blocking. Do y’all know of a provider that does not do this?

Which country?

Are you calling someone who expects to have a caller ID that doesn’t belong to you?

(If you are in the USA, you can expect any number you set to be marked as not belonging to you when it reaches the callee. Other countries will either be adopting the same system, or if they lack the infrastructure for that, will not be allowing it at all.

This is mainly happening because fraudsters have used the ability to set caller ID to make it appear that they are calling from a legitimate financial institution, or similar, and there is also the problem of telemarketers generating random local numbers relative to the callee.)

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