Help request: How to run an AGI script without a channel

I need to originate a call, through either the management interface, the cli, or via AGI EXEC Originate(), but NOT via dropping a call into /var/spool/asterisk/outgoing. The call is only outgoing from the server. That is, the program is one end of the call, there is no extension.

The problem is that I need to set the callerid prior to originating the call out an IAX2 channel. But setting a callerid requires a channel, except in the case of spooled calls which allows for specifying the callerid and the channel at the same time.

I’ve played around with DeadAGI but that doesn’t work. (The remote IAX2 server I am calling, requires a specific callerid to be set for the outgoing call. I.E. its a long distance carrier.)

Does anyone have any ideas?

[quote=“sgrantham”]I need to originate a call, through either the management interface, the cli, or via AGI EXEC Originate(), but NOT via dropping a call into /var/spool/asterisk/outgoing. The call is only outgoing from the server. That is, the program is one end of the call, there is no extension.

The problem is that I need to set the callerid prior to originating the call out an IAX2 channel. But setting a callerid requires a channel, except in the case of spooled calls which allows for specifying the callerid and the channel at the same time.

I’ve played around with DeadAGI but that doesn’t work. (The remote IAX2 server I am calling, requires a specific callerid to be set for the outgoing call. I.E. its a long distance carrier.)

Does anyone have any ideas?[/quote]
Use the AMI Originate command. Should do what you are looking for.

voip-info.org/tiki-index.php … +Originate

I guess I didn’t explain well enough. I have to set the channels caller ID before I originate the call otherwise the call will not be accepted. So the order would be-- Action: SetVar followed by Action: Originate. But… (dummy numbers and identifiers in this text)…

Action: SetVar
Channel: IAX2/someid@somerserver/18005551234
Variable: CALLERID
Value: 987654321

Yields…

Response: Error
Message: No such channel

Every other programmable communication system I’ve used (ISDN, SS7, T1R2, T1D4, TCP, ad nauseum…) always works the same way. 1. Allocate a channel/socket/connection, 2. Set the channel/socket/connection parameters. 3. Tell the channel/socket/connect to connect or tell it to listen.

Obviously I’m missing something very simple here. Help…

[code]Action: Originate
Channel: IAX2/someid@somerserver/18005551234
Callerid: 8005551234

Then add wherever you want it to connect on answer here:

Context:
Exten:
Priority:[/code]

That works! Thank you dave.