Originate command

Hello,
I’m trying to dial out from the terminal using the originate command.

internal works fine
asterisk -rx “originate SIP/701 application Playback hello-world”

but when trying to dial out nothing
asterisk -rx “originate SIP/(trunk name)/(external number) application Playback hello-world”

i know its not much of an explanation, but I’m not sure what I’m missing from the external. i know my trunk works, i can call out on it.
my goal is to call a phone number and play a message.
Thanks.

Most ISP do not allow the calls from cli because you are sending like anonymous, but better to check the sip debug and find where the call fails

ITSPs rejecting anonymous calls isn’t something I have heard of before. On the other hand, too many of them accept faked caller IDs!

If that really is the problem, use a local channel on the A side, so that you can explicitly set the caller ID.

When you use originate command to initiate the call, anonymous is used as the username on the sip uri : example '"Anonymoussip:anonymous@sip.rapidvox.com;

as anonymous is not a valid user

For this reason your carrier will reject the call. Most of the time this problem can be solved adding the fromuser option in your trunk settings.

Some ITSPs may reject the call.

Generally fromuser covers cases where the ITSP uses the From header to identify the account, typically in the case of ITSPs that are providing a service for individual phones, not for PABXes. Normally if they do that, you will need to use fromuser even if a caller ID is available to Asterisk.

In Asterisk terms, the ITSP end is configured as host=dynamic; type=user, whereas, for PABX support, host=dynamic, type=peer is better.

thanks all, i got it to work just by adding local and forwarding 701 to external phone number. its a hack but it works.

asterisk -rx “originate local/701 application Playback hello-world”

i will try other ways.

on a side note, how would all of you initiate an external call from the linux command line and play a message to the receiver.