How to make call using local channel

Hi All,
I Want to know how to make calls using local channel for use with .call files or AMI .
Below is my code ;-

originateAction = new OriginateAction();
originateAction.setChannel("local/666691976222215@outbound/n");
originateAction.setExten("6666919768203876");
originateAction.setPriority(new Integer(1));
originateAction.setTimeout(new Integer(30000));
originateResponse = managerConnection.sendAction(originateAction, 30000);
System.out.println(originateResponse.getResponse());

It shows me this error in the cli:-

NOTICE[20452]: chan_local.c:710 local_call: No such extension/context 666691976222215@outbound while calling Local channel
[Aug 4 17:03:56] NOTICE[20452]: channel.c:4201 __ast_request_and_dial: Unable to call channel local/6666919768203876@outbound/n
[Aug 4 17:03:56] ERROR[17905]: pbx.c:9366 device_state_cb: Received invalid event that had no device IE
[Aug 4 17:03:56] ERROR[17905]: app_queue.c:1112 device_state_cb: Received invalid event that had no device IE

Please provide the part of extensions.conf containing that part of the outbound context that you expect to match extension 666691976222215 (at least the priority 1 line). If it is in an included file or context, please provide the relevant chains of #includes’s and include =>'s.

Please note that this is the wrong forum for support questions.

[outbound]
exten => _1.,1,Dial(SIP/${EXTEN})
exten => _1.,2,Congestion

should i ask such question on asterisk support

Yes.

_1. will not match 6…! Do you really have an entry in sip.conf for every PSTN number you dial?

Incidentally, making device names match extension numbers is generally considered a security risk, as it makes it easier for a hack to guess credentials.

ok do i need to register the user 6666… for local channel on any sip softphone as we do for sip channel.

You haven’t provided enough information to determine that, but I think it is unlikely.

I would expect you to have sip.conf device that represents the PSTN trunk, and I would expect your outbound context to have something like:

exten => _6., 1, Dial(SIP/PSTNTrunk/${EXTEN})

modified as necessary for any stripping, or adding of digits, and any valid prefixes, other than 6.

Thanks For whatever help u provided actually i am using local channel because of the following reasons
I am using AMI i have use the code originateAction = new OriginateAction(); originateAction.setChannel("SIP/123@provider"); originateAction.setExten("6666919*********"); originateAction.setPriority(new Integer(1)); originateAction.setTimeout(new Integer(30000)); originateResponse = managerConnection.sendAction(originateAction, 30000); System.out.println(originateResponse.getResponse());

NOw in this what happen is the call goes to 123 first if he picks up then the call is forwarded to 6666919********* . I dont want such thing to happen . i just want to call the number and play the message which i relayed. relaying part is working perfectly but the issue persist in this matter.
Kindly Help me in this matter.
Any Help will be Appreciated.

I don’t see why you need a local channel, then. Extensions, don’t need to Dial and Originate doesn’t need to call an extension.

See I need to first call a user say 666691XXXXXXXXX where 6666 is prefix and 91and the remaining is the number . If i am using a channel say SIP/123 .I want to call to the number 666691XXXXXXXXX. The AMI calls the 123 and if the user picks up then the number is dialled . But i want just to call the number without calling 123. As the channel is neccessarry i thought of using local channel and the using extensions to autoanswer so that everytime user calls the 123 will autoanswer and then the call will be directed to the number.
Can this be achieved .
In .call file too i need to specify the channel .How can i solve the issue. As My work is atmost completed only this part is remaining . So please help me in this matter.

SIP/123/91XXXXXXXXX

or

SIP/91XXXXXXXXX@123

However using numeric names for trunks is confusing.

Really, though, you need to do some more background reading as you seem to be stabbing in the dark.

1 Like

Ok I have Solved the problem .Thank You For ur Help

1 Like

I am using –

a. Asterisk 1.8.
b. Sangoma card
c. PRI 30 Channels incoming and outgoing both.

I have seen many examples in internet about calling from SIP mobile but unable to fins any from PRI line.
I have no exposure to SIP.

Can you please tell me how to make call from asterisk to a GSM number using the PRI line.
A reference example will help me i feel.

What conf files are needed for this.
I know extensions.conf is needed.

Please tell me the step by step procedure.

Thanks in Advance
:smile:

Please don’t tail end existing threads. This is the wrong forum for support questions.

The only GSM numbers I know are part of the PSTN numbering space and therefore don’t require any special handling on a PRI connection to the PSTN. I therefore assume that you have missed out some important fact.

I am having same issues, i need extension to pick the call first and then dial the customer number automatically, but after the call is being picked up by the extension person, it dials other extensions within the same office rather than the customer number :frowning:

Please don’t hijack existing threads. If you have the same problem as such an old thread, either the solution is in the thread, or there is unlikely to be a solution.

If I remember correctly, you have posted directly, but without enough debugging information to see what you have done wrong.