Originate Command - Always Anonymous?

Hello all!

I’ve created a web page with a dialer to create a call in Asterisk, the way we managed to get it working was through the Channel Originate command:

channel originate PJSIP/extension extension extensiongettingthecall@testeligacoes

Now, this command is working perfectly, I’ve created the dialplan for testeligacoes as such:

exten => _X.,1,NoOp(Teste de ligacoes teams)
exten => _X.,n,Set(CALLERID(name) “teste”)
exten => _X.,n,Dial(PJSIP/${EXTEN}, 60)
exten => _X.,n,Hangup()

; ==-- Fim do teste de ligações – ==

However, the line that sets the calleridname seems to be getting ignored, as all calls are coming in through Anonymous extension for the PJSIP/EXTENSION, the receiving end is visualizing the call as being set from the other ext, as programmed, but I want the person ORIGINATING the call to get the callerid “Internal Call”, how can I achieve this?

smartcore*CLI> channel originate PJSIP/6656 extension 6692@testeligacoes
– Called 6656
– PJSIP/6656-0000024f is ringing
> 0x7f62e9bc3e60 – Strict RTP learning after remote address set to:
– PJSIP/6656-0000024f answered
– Executing [6692@testeligacoes:1] NoOp(“PJSIP/6656-0000024f”, “Teste de ligacoes teams”) in new stack
– Executing [6692@testeligacoes:2] Set(“PJSIP/6656-0000024f”, “CALLERID(name) “teste””) in new stack
[2022-07-08 10:37:24] WARNING[93453][C-0000081c]: pbx_variables.c:1208 pbx_builtin_setvar: Set requires an ‘=’ to be a valid assignment.
– Executing [6692@testeligacoes:3] Dial(“PJSIP/6656-0000024f”, “PJSIP/6692, 60”) in new stack
– Called PJSIP/6692
> 0x7f62e9bc3e60 – Strict RTP switching to RTP target address as source
– PJSIP/6692-00000250 is ringing
== Spawn extension (testeligacoes, 6692, 3) exited non-zero on ‘PJSIP/6656-0000024f’

And here is a Printscreen for what’s being said in the softphone:

Sorry for the print, can someone give me a light?

Thank you all!

I’ve fixed the “=” situation, but I got the same result:

smartcore*CLI> channel originate PJSIP/6656 extension 6692@testeligacoes
– Called 6656
– PJSIP/6656-00000252 is ringing
– Added contact ‘sip:6682@;rinstance=7191FE5B;x-ast-orig-host=’ to AOR ‘6682’ with expiration of 600 seconds
== Endpoint 6682 is now Reachable
– Contact 6682/sip:6682@;rinstance=7191FE5B;x-ast-orig-host= is now Reachable. RTT: 59.541 msec
> 0x7f62f87b5f20 – Strict RTP learning after remote address set to:
– PJSIP/6656-00000252 answered
– Executing [6692@testeligacoes:1] NoOp(“PJSIP/6656-00000252”, “Teste de ligacoes teams”) in new stack
– Executing [6692@testeligacoes:2] Set(“PJSIP/6656-00000252”, “CALLERID(name)=“teste””) in new stack
– Executing [6692@testeligacoes:3] Dial(“PJSIP/6656-00000252”, “PJSIP/6692, 60”) in new stack
– Called PJSIP/6692
> 0x7f62f87b5f20 – Strict RTP switching to RTP target address as source
– PJSIP/6692-00000253 is ringing
== Spawn extension (testeligacoes, 6692, 3) exited non-zero on ‘PJSIP/6656-00000252’

Here’s the invite:

INVITE sip:6656@;rinstance=2D303D9C SIP/2.0
Via: SIP/2.0/UDP;rport;branch=z9hG4bKPj93f07484-4bdb-4a1b-84a5-369bb053e369
From: “Anonymous” sip:anonymous@anonymous.invalid;tag=b7c37339-b2bc-44ba-a12d-aae672197d55
To: sip:6656@;rinstance=2D303D9C
Contact: sip:asterisk@
Call-ID: 48d7420e-87e2-48df-a719-cb7581b78a4a
CSeq: 21680 INVITE
Supported: 100rel, timer, replaces, norefersub, histinfo
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 16.26.0
Content-Type: application/sdp
Content-Length: 329

o=- 636607409 636607409 IN IP4
c=IN IP4
t=0 0
m=audio 10976 RTP/AVP 3 8 0 18 101
a=rtpmap:3 GSM/8000
a=rtpmap:8 PCMA/8000
a=rtpmap:0 PCMU/8000
a=rtpmap:18 G729/8000
a=fmtp:18 annexb=no
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16

Incorrect format. Set(CALLERID(name)=teste) will do the job.

Did that already, same result!

The CLI command, “channel originate”, does not allow setting the callerid. It shows up as anonymous as a result. You would need to dial a Local channel instead and set it in the dialplan on the first call leg before dialing the real destination.

That would be accomplished through the AMI, right

The AMI Originate action does allow callerid to be set.

Unsure on how to dial a local channel if not from Channel Originate or AMI, could you clarify that please?

This is the INVITE for the A leg. The A leg connects before any dialplan is run. If you use call files, or, I think, AMI, you can set the caller ID for the originate, but you can’t do so for CLI or dialplan invocation. For these, you need to use a local channel to make the call, so that the A side ends up being a Dial, as well as the B side.

Local channels are documented on the wiki[1]. You dial them just like a normal channel, for example using “channel originate”.

[1] Local Channel - Asterisk Project - Asterisk Project Wiki

And there’s no way to do this in the CLI command for the channel originate? This specific situation all the callerids will be exactly the same, so if possible I could run a channel originate PJSIP/ext callerid=Internal ext@dialplan.

I’m not sure if this exists. I’m just asking as a means to make it possible, as I’m not sure on how to do this through the local channels,

If it isn’t possible I’ll try to look on the wiki as suggested by jcolp

Missing an =


The “channel originate” CLI command does not support setting the callerid as I mentioned. There’s no option to it do that.

Alright! I’m checking how to use the local channels to do that, this is somewhat new for me but will post an update if I get it working!


I’m having a situation where I need to change the anonymous@anonymous.invalid caller ID to Portuguese if the situation happens,

Is there a way to change this? I need to change the text that appears once we receive a call using a channel originate command.

Please note: I do not want to change the caller ID, all I want is to translate the anonymous.invalid to a more user-friendly message in Portuguese.

How can I achieve this? Where is this error set?

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