Originate from AMI does not work for Asterisk 1.6.1.11

Get help with installing, upgrading and running Asterisk.

Moderators: muppetmaster, Moderator, Support

Originate from AMI does not work for Asterisk 1.6.1.11

Postby irfanlateef » Tue Jan 12, 2010 2:39 pm

Hi,

I am using Astersik version : Connected to Asterisk 1.6.1.11 currently running
I am using Asterisk-Java version astersik-java-1.0.0.M3

I am issuing the following command:
Code: Select all
    OriginateAction dial = new OriginateAction();
        dial.setChannel("Local/DIAL@numeric_pager_context");
        dial.setContext("numeric_pager_context");
        dial.setExten("ANSWER");
        dial.setPriority(1);
        dial.setAsync(true);
        dial.setVariable("dial_string","DAHDI/g0/7324201936");
        dial.setVariable("timeout","30");
        dial.setVariable("post_dtmf","0987654321");

        originateResponse = managerConnection.sendAction(dial, 30000);
        System.out.println(originateResponse.getResponse());


I have the following console log of the application:
-------------------------------------------------------------

Jan 12, 2010 3:17:10 PM org.asteriskjava.manager.internal.ManagerConnectionImpl connect
INFO: Connecting to XXX.YY.9.42:5038
Jan 12, 2010 3:17:11 PM org.asteriskjava.util.internal.FileTrace getFile
INFO: Writing trace to /export/home/cbus/tools/sipasterisk/aj-trace_2010-01-12T15:17:11.471EST_XXX.YY.47.93:46752_XXX.YY.9.42:5038.txt
Jan 12, 2010 3:17:11 PM org.asteriskjava.manager.internal.ManagerConnectionImpl setProtocolIdentifier
INFO: Connected via Asterisk Call Manager/1.1
Jan 12, 2010 3:17:11 PM org.asteriskjava.manager.internal.ManagerConnectionImpl doLogin
INFO: Successfully logged in
Jan 12, 2010 3:17:11 PM org.asteriskjava.manager.internal.ManagerConnectionImpl doLogin
INFO: Determined Asterisk version: Asterisk 1.6
Error
Jan 12, 2010 3:17:11 PM org.asteriskjava.manager.internal.ManagerConnectionImpl disconnect
INFO: Closing socket.
Jan 12, 2010 3:17:11 PM org.asteriskjava.manager.internal.ManagerReaderImpl run
INFO: Terminating reader thread: No more lines available: null

The trace file has the following
-------------------------------------
2010-01-12T15:17:11.796EST >>> action: Originate^M
>>> actionid: 21471211_2#^M
>>> exten: ANSWER^M
>>> async: true^M
>>> variable: dial_string=DAHDI/g0/7324201936^M
>>> variable: timeout=30^M
>>> variable: post_dtmf=0987654321^M
>>> context: numeric_pager_context^M
>>> priority: 1^M
>>> channel: Local/DIAL@numeric_pager_context^M
>>> ^M
2010-01-12T15:17:11.802EST <<< Response: Error
2010-01-12T15:17:11.850EST <<< ActionID: 21471211_2#
2010-01-12T15:17:11.852EST <<< Message: Permission denied ( DONT KNOW WHY PERM DENIED ???? )


I have the following in the extensions.conf
Code: Select all
[numeric_pager_context]
exten => DIAL,1,Dial(${dial_string},${timeout})
exten => DIAL,n,Verbose(1,Dial failed with result ${DIALSTATUS})
exten => DIAL,n,Hangup()

exten => ANSWER,1,Verbose(1,Received an ANSWER)
exten => ANSWER,n,WaitForSilence(5)
exten => ANSWER,n,SendDTMF(${post_dtmf})
exten => ANSWER,n,Hangup()


I verified that the dialplan is there in Asterisk:

cbusivr*CLI> dialplan show numeric_pager_context
[ Context 'numeric_pager_context' created by 'pbx_config' ]
'ANSWER' => 1. Verbose(1,Received an ANSWER) [pbx_config]
2. WaitForSilence(5) [pbx_config]
3. SendDTMF(${post_dtmf}) [pbx_config]
4. Hangup() [pbx_config]
'DIAL' => 1. Dial(${dial_string},${timeout}) [pbx_config]
2. Verbose(1,Dial failed with result ${DIALSTATUS}) [pbx_config]
3. Hangup() [pbx_config]

-= 2 extensions (7 priorities) in 1 context. =-

I have the following in the Asterisk Log:
[Jan 12 15:19:21] DEBUG[32024] chan_sip.c: Destroying SIP dialog 17b9d2f30502bff50c11340f2080f352@mt.att.com
[Jan 12 15:19:39] DEBUG[12779] manager.c: Manager received command 'Challenge'
[Jan 12 15:19:39] DEBUG[12779] manager.c: Manager received command 'Login'
[Jan 12 15:19:39] VERBOSE[12779] manager.c: == Manager 'cbusapp' logged on from XXX.YY.47.93
[Jan 12 15:19:39] DEBUG[12779] manager.c: Manager received command 'Originate'
[Jan 12 15:19:40] DEBUG[12779] manager.c: Manager received command 'Logoff'
[Jan 12 15:19:40] VERBOSE[12779] manager.c: == Manager 'cbusapp' logged off from XXX.YY.47.93

This code was working in Asterisk 1.4.22 with astersik-java 0.0.3
It stopped working after I upgraded to 1.6.1.11

Appreciate your help and feedback. This is blocking my project.

Thanks and lot in advance.

Irfan Lateef
AT&T
irfanlateef
Newsterisk
 
Posts: 33
Joined: Fri Nov 14, 2008 5:09 pm

Re: Originate from AMI does not work for Asterisk 1.6.1.11

Postby david55 » Wed Jan 13, 2010 12:10 pm

Permission denied is a manager.conf problem. New versions of Asterisk have more permission categories.
david55
Moves Like Spencer
 
Posts: 12570
Joined: Fri Sep 26, 2008 5:03 am

Re: Originate from AMI does not work for Asterisk 1.6.1.11

Postby irfanlateef » Wed Jan 13, 2010 2:21 pm

David55,

Thanks for the hint. It is not documented anywhere that originate command used be part of call group in Asterisk 1.4.22
and it has now been seperated out as a sepearate category in Asterisk 1.6.1.11

So I modified the manager.conf from

read = system,call,log,verbose,command,agent,user
write = system,call,log,verbose,command,agent,user

To the following: just added the originate command

read = system,call,log,verbose,command,agent,user,originate
write = system,call,log,verbose,command,agent,user,originate

This solved my perm denied problem.

Hope this will help all the folks who are having such problems.

The following link has the manager conf details

http://www.voip-info.org/wiki/view/Asterisk+config+manager.conf

but it has originate int he call group which threw me off.
This link should be updated for the 1.6.1.11 version manager conf.

Thanks,
irfanlateef
Newsterisk
 
Posts: 33
Joined: Fri Nov 14, 2008 5:09 pm


Return to Asterisk Support

Who is online

Users browsing this forum: No registered users and 1 guest