[asterisk-users] Call file structure and syntax
Mike Ely
mikeely at amyskitchen.net
Mon Jun 28 18:41:02 CDT 2010
Well, I¹ve tried this, and something just isn¹t right. Here¹s the context
from "dialplan show," so I know it¹s loaded anyway:
[ Context 'PressTwo' created by 'pbx_config' ]
'*' => 1. Goto(accept|s|1) [pbx_config]
'1' => 1. ForkCDR(v,s(fullcmd=${Data})) [pbx_config]
2. Background(${Data}) [pbx_config]
3. Background(repeatmsg) [pbx_config]
4. WaitExten(5,m) [pbx_config]
5. Hangup() [pbx_config]
'2' => 1. Background(calllater) [pbx_config]
2. ForkCDR(v,s(reject=${Data})) [pbx_config]
3. Hangup() [pbx_config]
'3' => 1. Goto(accept|1|2) [pbx_config]
'i' => 1. Goto(accept|s|1) [pbx_config]
's' => 1. Answer() [pbx_config]
2. Background(important) [pbx_config]
3. WaitExten(5,m) [pbx_config]
't' => 1. Goto(accept|s|1) [pbx_config]
I (hopefully correctly) translated your dialplan into a simple AMI command
set thus:
Action: Originate
Channel: SIP/ShoreTel-1
Variable: "Data=/var/lib/asterisk/sounds/custom/msg1.wav"
Context: PressTwo
priority: 1
Number: 7979
When I hit AMI via telnet, login, and execute the above, here's the output:
Response: Error
Message: Originate failed
Event: Newchannel
Privilege: call,all
Channel: SIP/ShoreTel-1-00000004
ChannelState: 0
ChannelStateDesc: Down
CallerIDNum:
CallerIDName:
AccountCode:
Exten:
Context: from-internal
Uniqueid: 1277768352.7
Event: VarSet
Privilege: dialplan,all
Channel: SIP/ShoreTel-1-00000004
Variable: SIPCALLID
Value: 39251bb451a38e136293d70252d0ddc5 at 10.10.6.45
Uniqueid: 1277768352.7
Event: VarSet
Privilege: dialplan,all
Channel: SIP/ShoreTel-1-00000004
Variable: Data
Value: /var/lib/asterisk/sounds/custom/msg1.wav
Uniqueid: 1277768352.7
Event: NewAccountCode
Privilege: call,all
Channel: SIP/ShoreTel-1-00000004
Uniqueid: 1277768352.7
AccountCode:
OldAccountCode:
Event: NewCallerid
Privilege: call,all
Channel: SIP/ShoreTel-1-00000004
CallerIDNum:
CallerIDName:
Uniqueid: 1277768352.7
CID-CallingPres: 0 (Presentation Allowed, Not Screened)
Event: Hangup
Privilege: call,all
Channel: SIP/ShoreTel-1-00000004
Uniqueid: 1277768352.7
CallerIDNum: <unknown>
CallerIDName: <unknown>
Cause: 17
Cause-txt: User busy
Event: RTPReceiverStat
Privilege: reporting,all
SSRC: 0
ReceivedPackets: 0
LostPackets: 0
Jitter: 0.0000
Transit: 0.0000
RRCount: 0
Event: RTPSenderStat
Privilege: reporting,all
SSRC: 462309403
SentPackets: 0
LostPackets: 0
Jitter: 0
SRCount: 0
RTT: 0.000000
Event: RTPReceiverStat
Privilege: reporting,all
SSRC: 0
ReceivedPackets: 0
LostPackets: 0
Jitter: 0.0000
Transit: 0.0000
RRCount: 0
Event: RTPSenderStat
Privilege: reporting,all
SSRC: 1486119401
SentPackets: 0
LostPackets: 0
Jitter: 0
SRCount: 0
RTT: 0.000000
Thing is, I know I can dial out via that SIP trunk, and it's a test system
nobody else is using, so why am I getting "User busy" here?
On 6/22/10 10:31 AM, "Danny Nicholas" <danny at debsinc.com> wrote:
> #1 once you¹ve got to this point, AMI would be a better option than a call
> file
> #2 - using AMI or a call file, you are going to want to use the context-based
> method instead of application to get the most ³bang for your buck²
>
> I use a bigger instance of this to play a message and accept 1 or 2 from the
> user
> ; this context is used by AMI to play a message
> [accept]
> exten => s,1,Answer
> exten => s,n,Background(important)
> exten => s,n,WaitExten(5,m)
> exten => 1,1,ForkCDR(v,s(fullcmd=${Data}))
> exten => 1,n,Background(${Data})
> exten => 1,n,Background(repeatmsg)
> exten => 1,n,WaitExten(5,m)
> exten => 1,n,Hangup
> exten => 2,1,Background(calllater)
> exten => 2,n,ForkCDR(v,s(reject=${Data}))
> exten => 2,n,Hangup
> exten => 3,1,Goto(accept|1|2)
> exten => *,1,Goto(accept|s|1)
> exten => i,1,Goto(accept|s|1)
> exten => t,1,Goto(accept|s|1)
>
> here¹s the call file
> Action => 'Originate',
> Channel => DAHDI/1,
> Variable => "Data=/tmp/test.gsm²,
> Exten => 'SIP/170',
> Context => 'accept',
> priority => 1,
> Number => 5551212
> Using the accept context, 5551212 is called on DAHDI/1 and user hears
> important.gsm. then they press 1 to hear test.gsm or 2 to hear it later.
>
> Hope this is helpful
>
>
> From: asterisk-users-bounces at lists.digium.com
> [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Mike Ely
> Sent: Tuesday, June 22, 2010 12:02 PM
> To: Asterisk Users Mailing List - Non-Commercial Discussion
> Subject: [asterisk-users] Call file structure and syntax
>
> Hi there,
>
> I¹ve been looking to do an outbound dialer for systems alerting, etc. and have
> in large part followed the recipe here:
> http://www.voip-info.org/tiki-index.php?page=Asterisk+auto-dial+out
>
> That and the associated pages at voip-info give a basic set of recipes for
> callfiles, but nowhere there or in my copy of the O¹Reilly book by Meggelen,
> Madsen, & Smith can I find a detailed discussion of what goes into a callfile,
> how to get it to do things like interact with the shell (I¹d like ³Press 2² in
> my outbound call to do something of value), etc. I¹ve googled around but
> haven¹t found what I¹m looking for, just other people¹s ³Hello World²
> callfiles. As of now, I can make outbound calls well enough, but want more...
>
> Can someone point me in the right direction for this?
>
> Thanks,
> Mike
>
>
More information about the asterisk-users
mailing list