Question

best way to make many simultaneous calls

Asked by: jellydog

Hi, What is the best method for making 100's of simultaneous calls using Asterisk (i am running 1.6.0.9 on Ubuntu 8.10) Currently, I am using Asterisk Manager Interface (AMI) through webservice calls but it seems awefully slow. Thanks for any tips.

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2009-05-27 at 14:04:51ID24443078
Tags

asterisk

Topics

Voice Over IP

,

Asterisk Open Source Telephony

,

IP Telephony

Participating Experts
1
Points
500
Comments
33

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. simultaneous updating of data locally and on webserver.
    I have 3 locations using access, who periodically have to upload data to a database(sql server) as well as download any data and reconcile that data. Have thought about a solution, any changes to the client database at individual locations would also be done at the webse...
  2. Asterisk on Ubuntu
    im following the link below to setup asterisk on a ubuntu server https://wiki.ubuntu.com/AsteriskOnUbuntu im unable to continue at this point Now, to configure the databases for FreePBX: root@server:/usr/src/freepbx# mysqladmin create asterisk and im gettin error messa...

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: xuserx2000Posted on 2009-06-01 at 09:39:19ID: 24519299

Have you looked at using call files ?
http://www.voip-info.org/tiki-index.php?page=Asterisk+auto-dial+out

You can also generate calls using the AMI, without a web interface.....I guess it depends on how you have things setup as to which solution is best for you.  Can you give a more detailed description of your setup ?....

 

by: jellydogPosted on 2009-06-01 at 10:02:42ID: 24519499

I have tried .call files and it seems slow. I would put 50 call files in the /outgoing directory and my server would pick up about 5 or 6 of them at a time and as those calls completed, it would pick up another .call file. I was getting results of >3.5 minutes for it to process the 50 calls. I have already confirmed with my voip provider that I have hundreds of channels available to me.
Most recently, I have been using AMI and passing the Originate command (using URL with rawman?  parameters) which seems to work but fear the http overhead will bite me when trying to make many calls. Also, this approach seems to have a show-stopper. The Originate action implies a Dial() app and since I need to set some CDR values BEFORE the Dial() takes place, Originate does not allow for this. I also need to make decisions based on DIALSTATUS. For instance, if I pass info using Originate and number dialed is BUSY, the call never enters my dialplan context where I set and evaluate Dialstatus and CDR values.  If a line is BUSY, my voip provider just sends a message back to my server and the context in my dialplan is never entered into. I cannot figure out another way to enter the dialplan via AMI - Originate seems to be the only way in. Is there another way?

I am now looking into using FastAGI. Thanks for your help.

 

by: xuserx2000Posted on 2009-06-01 at 10:50:25ID: 24519957

You can use a tcp connection to the AMI as well....also, the orginate command does support channel variables that you can set.

Try this as a test...

Create a call file the same way you would as if you were going to drop it into a the spool directory... but with logon parameters....
Example..
---------------------------------------
action: login
username: myamiusername
secret: myuniquepassword
events: off

Action: Originate
Channel: zap/g1/XXXXXXXXXX
Context: default
Exten: 3307
Priority: 1
Callerid: 5555555555
Timeout: 30000
Variable: CDRvar1=3307|zapchan=SIP/3108


---------------------------------make sure to include the two empty lines after the last line, which denotes the "return"...
Save the file as originate.txt on your c:

Now...
Download NetCat,..."nc.exe" to your c:\


Now try this at command line from the root of C:\

nc.exe 192.168.0.XXX 5038 < originate.txt
--------------------------------------------------------------------------

This method was used for our test application, before we moved to a purely winsock connection to the AMI.

"ConMan" is an asterisk connection manager API, for the AMI, that is useful for developing applications that utilize asterisk. http://www.voip-info.org/wiki/view/Asterisk+Connection+Manager


 

by: jellydogPosted on 2009-06-01 at 12:31:51ID: 24520915

Thanks, that example works. However, I need to track (DIALSTATUS) and call files nor Originate command set that value. It seems to only get set when I use the Dial() app. If I run Dial() in my context, I am then placing a second call because the Call file already invoked the call before entering the dialplan. I am trying to do something like this (below) but cannot figure out how I can do this since call files and Originate already dialed the number.

thnaks.

http://www.voip-info.org/wiki/view/Asterisk+dial+plan+-+working+example (see macro-dial-sip)

macro-dial-sip]
;
;
;      Enter with these
;            ARG1 = number to dial
;            ARG2 = timeout value
;            ARG3 = flag determines if hangup or return on no answer
;                  HR = hangup and return (default)
;                  RT = return without hangup (must set)
;
;      Returns with FOUNDME = DIALSTATUS
;
 exten => s,1,SetGlobalVar(FOUNDME=ANSWER)
 exten => s,2,Dial(SIP/${ARG1}${SIPCO1},${ARG2})
 exten => s,3,SetGlobalVar(FOUNDME=${DIALSTATUS})
 exten => s,4,Goto(s-${DIALSTATUS},1)
;
;      returns here if busy
;
 exten => s,103,SetGlobalVar(FOUNDME=BUSY)
 exten => s,104,Goto(s-BUSY,1)
;
 exten => s-BUSY,1,BackGround(the-party-you-are-calling)
 exten => s-BUSY,2,BackGround(is-curntly-busy)
 exten => s-BUSY,3,SetGlobalVar(FOUNDME=BUSY)
 exten => s-BUSY,4,Goto(s-CLEANEXIT,1)
;
 exten => s-CANCEL,1,BackGround(canceled)
 exten => s-CANCEL,2,SetGlobalVar(FOUNDME=CANCEL)
 exten => s-CANCEL,3,Goto(s-CLEANEXIT,1)
;
 exten => s-CHANUNAVAIL,1,BackGround(channel)
 exten => s-CHANUNAVAIL,2,BackGround(is-curntly-unavail)
 exten => s-CHANUNAVAIL,3,SetGlobalVar(FOUNDME=CHANUNAVAIL)
 exten => s-CHANUNAVAIL,4,Goto(s-CLEANEXIT,1)
;
 exten => s-NOANSWER,1,BackGround(nbdy-avail-to-take-call)
 exten => s-NOANSWER,2,SetGlobalVar(FOUNDME=NOANSWER)
 exten => s-NOANSWER,3,Goto(s-CLEANEXIT,1)
;
 exten => s-ANSWER,1,SetGlobalVar(FOUNDME=ANSWER)
 exten => s-ANSWER,2,Goto(s-CLEANEXIT,3)
;
 exten => s-.,1,BackGround(something-Usr2bly-wrong)
 exten => s-.,2,SetGlobalVar(FOUNDME=ERROR)
 exten => s-.,3,Goto(s-CLEANEXIT,1)
;
 exten => s-CLEANEXIT,1,GotoIf($[${ARG3} = RT]?3:2)
 exten => s-CLEANEXIT,2,Hangup
 exten => s-CLEANEXIT,3,NoOp

 

by: xuserx2000Posted on 2009-06-01 at 12:42:56ID: 24521014

The reason is this...

${DIALSTATUS}, gives you the status of the last dial command...and in your case it is this line...
Dial(SIP/${ARG1}${SIPCO1},${ARG2})

So the dialstatus you are pulling is the status of the call placed to the SIP phone...

What you need is to seperate the code for the outbound call...

For example....
Your outgoing call is 5555555555..... so in the dialplan, where you have the pattern matching to send outbound...that is where you would be chekcing the dialstatus, before sending it to "S,1"...

Does that make sense ?

 

by: jellydogPosted on 2009-06-01 at 17:19:43ID: 24523050

Thank you, that does make sense. I tried some things but still stuck - when I echo {DIALSTATUS} from the [outbound] context, it is blank. Here is what I have (and thanks again for looking and helping me out)


callfile-
channel: SIP/1212XXXXXXX@flowroute ;my voip provider defined in sip.conf
context: outbound
extension: s
priority: 1

dialplan-
[outbound]
exten => +1Nxxxxxxxxx,1,Dial(SIP/${EXTEN}${SIPCO1})
exten => s,1,Set(FOUNDME=${DIALSTATUS})
exten => s,2,NoOP(dialstatus is ${DIALSTATUS}
exten => s,3,Goto(s-${DIALSTATUS})

CLI Output-
    -- Attempting call on SIP/1212XXXXXXX@flowroute for s@outbound:1 (Retry 1)
  == Using SIP RTP CoS mark 5
       > Channel SIP/flowroute-0826ac00 was answered.
    -- Executing [s@outbound:1] Set("SIP/flowroute-0826ac00", "FOUNDME=") in new stack
    -- Executing [s@outbound:2] NoOp("SIP/flowroute-0826ac00", "dialstatus is ") in new stack

 

by: jellydogPosted on 2009-06-03 at 17:01:23ID: 24542554

I do realize the typo in the pattern matching where "+" should be an underscore. Also the missing closing parenthesis on the NoOP line. My code is correct and same results. Thanks.

 

by: xuserx2000Posted on 2009-06-04 at 07:46:07ID: 24547527

"coolleomod: A message has been sent to some of our more experienced experts asking them to review your question. We will check back again to see if you are getting the help you need."

what's that supposed to mean ?....   I have the most points in Asterisk for this year....
Over zealous mod ?
----------------------------------------------------------------------------------------------------------------------

Ok JellyDog...

if you could post the entire contents of your extensions.conf file...that would help a lot.  Also the sip.conf file leaving out any password and IP information if you could.

This is what I think it should look like...

[outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}${SIPCO1},30)
exten => _1NXXNXXXXXX,n,Set(__MYDIALSTATUS=${DIALSTATUS}) ;optional - used for inheritence
exten => _1NXXNXXXXXX,n,NoOP(Dial Status: ${DIALSTATUS})
exten => _1NXXNXXXXXX,n,Goto(call-${DIALSTATUS})
exten => _1NXXNXXXXXX,n (call-ANSWER), Goto(????); send to ? if answered
exten => _1NXXNXXXXXX,n (call-NOANSWER), Goto(????) ;send to  ? if not answered
exten => _1NXXNXXXXXX,n (call-BUSY), Goto(????) ;send to ? if busy
exten => _1NXXNXXXXXX,n (call-CANCEL),Goto(????);callee hungup before connected
exten => _1NXXNXXXXXX,n (call-), Goto(s-NOANSWER) ;no status was set so default to not answered

...in the Goto(???)....you need to fill those in for yourself according to where you want it to go in the dialplan...    

Additionally,...${MYDIALSTATUS} you would need if you are connecting this call into another context within the dialplan where you are going to reference the status of the originated call.



 

by: xuserx2000Posted on 2009-06-04 at 07:54:15ID: 24547630

I have a space before the goto's....you will need to check this for syntax, since it was written "on the fly" without testing.

 

by: jellydogPosted on 2009-06-04 at 10:54:03ID: 24549521

Hi - and thanks so much for getting back. I am posting everything and you can see that the console output indicates the call gets "dialed" before the Dial() app defined in my context. It must be because of the way sipconf and call file are set up. Here it all is attached. Please correct me where I went awry... :)

SIP.CONF
[general]
disallow=all
allow=ulaw
allow=g729
register => myname:mysecret@70.137.153.130
 
[1000]
type=friend
host=dynamic
context=phones
secret=1000
 
[flowroute]
type=friend
secret=mysecret
username=myname
host=sip.flowroute.com
dtmfmode=rfc2833
context=outbound
qualify=yes
canreinvite=no
allow=ulaw
allow=g729
insecure=port,invite
----------------------------------
DIALPLAN
[general]
clearglobalvars=yes
autofallthrough=no
 
[global]
SIPCO1=@flowroute
 
[default]
exten => s,1,Verbose(1|Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()
 
[inbound]
exten => s,1,Answer()
exten => s,n,Playback(hello-world)
exten => s,n,Hangup()
 
[internal]
exten => 1000,1,Verbose(1|Extension 1000)
exten => 1000,n,Dial(SIP/1000,30)
exten => 1000,n,Hangup()
 
[msgaccept]
exten => s,1,Playback(outboundmsgs/thankyouaccept)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup()
 
[msgdecline]
exten => s,1,Playback(outboundmsgs/thankyoudecline)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup()
 
[human]
exten => s,1,Playback(outboundmsgs/hellomark)
exten => s,2,Background(outboundmsgs/how_to_ack)
 
exten => 1,1,Goto(msgaccept,s,1) ;pressed 1 accepted
exten => 2,1,Goto(msgdecline,s,1) ;pressed 2 declined
exten => 3,1,Goto(s,1) ;replay msg
 
exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(s,1)
 
[visit]
exten => s,1,Wait(2)
exten => s,2,Playback(outboundmsgs/nonhuman)
exten => s,3,Playback(vm-goodbye)
exten => s,4,Hangup()
 
[outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}${SIPCO1},30)
exten => _1NXXNXXXXXX,n,Set(__MYDIALSTATUS=${DIALSTATUS}) ;optional - used for $
exten => _1NXXNXXXXXX,n,NoOP(Dial Status: ${DIALSTATUS})
exten => _1NXXNXXXXXX,n,Goto(call-${DIALSTATUS})
exten => _1NXXNXXXXXX,n (call-ANSWER),Goto(detect,s,1) ; send to [detect] if an$
exten => _1NXXNXXXXXX,n (call-NOANSWER),Goto(noanswer,s,1) ;send to [noanswer] $
exten => _1NXXNXXXXXX,n (call-BUSY),Goto(busy) ;send to [busy] if busy
exten => _1NXXNXXXXXX,n (call-CANCEL),Goto(cancel);callee hungup before connect
exten => _1NXXNXXXXXX,n (call-CHANNELUNAVAIL),Goto(cancel)$
exten => _1NXXNXXXXXX,n (call-),Goto(s-NOANSWER) ;no status was set so default $
 
[detect]
exten => s,1,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,BackgroundDetect(silence/3,1000,50)
exten => s,n,Verbose(3,answering machine detected)
exten => s,n,Set(MACHINE=1)
exten => s,n,BackgroundDetect(silence/10,1000,50,30050)
exten => s,n,NoOp(too long of a message)
exten => s,n,Set(CDR(callresult)=messagetoolong)
exten => s,n,Hangup()
 
exten => talk,1,GotoIf($[${MACHINE}=1]?2:3)
exten => talk,2,Goto(visit,s,1)       ; this is a machine
exten => talk,3,Goto(human,s,1)       ; this is a human
 
[noanswer]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=No Answer)
exten => s,n,Hangup()
 
[busy]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=Busy)
exten => s,n,Set(CDR(priorityretry)=1)
exten => s,n,Hangup()
 
[cancel]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=Canceled)
exten => s,n,Hangup()
 
-----------------------------
CALL FILE
Channel: SIP/12125551212@flowroute
Callerid: 1000
Context: outbound
Extension: 12125551212
Priority: 1
-----------------------------
CONSOLE
ubuntu*CLI>
    -- Attempting call on SIP/12125551212@flowroute for 12125551212@outbound:1 (Retry 1)
  == Using SIP RTP CoS mark 5
       > Channel SIP/flowroute-0870ce10 was answered.
    -- Executing [12125551212@outbound:1] Dial("SIP/flowroute-0870ce10", "SIP/12125551212,30") in new stack
  == Using SIP RTP CoS mark 5
[Jun  4 13:28:38] WARNING[29798]: chan_sip.c:4181 create_addr: No such host: 12125551212
[Jun  4 13:28:38] WARNING[29798]: app_dial.c:1450 dial_exec_full: Unable to create channel of type 'SIP' (cause 20 - Unknown)
  == Everyone is busy/congested at this time (1:0/0/1)
    -- Executing [12125551212@outbound:2] Set("SIP/flowroute-0870ce10", "__MYDIALSTATUS=CHANUNAVAIL") in new stack
    -- Executing [12125551212@outbound:3] NoOp("SIP/flowroute-0870ce10", "Dial Status: CHANUNAVAIL") in new stack
    -- Executing [12125551212@outbound:4] Goto("SIP/flowroute-0870ce10", "call-CHANUNAVAIL") in new stack
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:

Select allOpen in new window

 

by: xuserx2000Posted on 2009-06-04 at 11:24:35ID: 24549846

Your call file is connecting the number..."to itself"....

Should look something like this...

Channel: SIP/12125551212@flowroute
Callerid: 1000
Context: Phones
Extension: 1000
Priority: 1

That would pass the completed call to extension 1000...
Although I assume you want to pass a completed call off to [detect]....or "something"..

Give me a little while...I have to run out for a minute,...I look at this tonight and test it on my test box.

I think you are 90% there with the dialplan logic....just gonna be a matter of working out the kinks.
As you can see from the CLI, the dialstatus is getting set....but it was "chanunavail" since the channel was trying to connect to an extension based on the same number.

 

by: jellydogPosted on 2009-06-04 at 11:42:45ID: 24550030

That is great news, you rock! thanks so much for the help!

 

by: jellydogPosted on 2009-06-05 at 07:04:16ID: 24556509

You're right in that I need to pass the the completed call to [detect], not an extension. Please let me know if you were able to test out a scenario where that would work. Thanks!!

 

by: xuserx2000Posted on 2009-06-05 at 07:51:18ID: 24557020

I didn't have a chance to test last night, I some of my own issues I had to work on.
After putting some thought into it however, I think it needs to be restructured to accomplish your goal.
Here's what I would like you to try(after you make a backup of your extensions.conf), because i'm doing something similar to this already...

First we create a "system" context...which will hold an arbitrary extension...This extension does nothing except help place the call and allow at least 10 seconds to everything else to happen.

[system]
exten => sys,1,Answer()
exten => sys,n,Wait(10) ; This time should be more than the total time to evaluate the call.
exten => sys,n,Hangup()

Next, the call file is going to use the system extension which only serves to help place the call....10 seconds should be more than enough to evaluate the call whether answered or not...and the detection process...

Channel: SIP/12125551212@flowroute
Callerid: 1000
Context: system
Extension: sys
Priority: 1


Try this, and post the CLI output.

 

by: xuserx2000Posted on 2009-06-05 at 07:58:37ID: 24557096

PS:...once you get the DIALSTATUS working, and the detect working....you should Transfer() to the IVR that will play the message, and allow the calee to press options.  This will disconnect the "sys" extention from the process and put the caller into the ivr...otherwise after 10 seconds the would be disconnected.

 

by: jellydogPosted on 2009-06-06 at 09:58:59ID: 24563541

Hi, I think I am back to square one again. Dialstatus never gets set because I am not issuing the Dial() app. It only ever seems to have a value when I have Dial() in my dialplan. After adding the [system] context, I just get 10 seconds of silence and then it hangs up. I tried adding my dialstatus evaluation code before and after the Answer() in [system], but dialstatus still never gets set.

 

by: jellydogPosted on 2009-06-06 at 10:02:10ID: 24563551

this is the CLI output and last version of [system]:
ubuntu*CLI>
    -- Attempting call on SIP/12125551212@flowroute for sys@system:1 (Retry 1)
  == Using SIP RTP CoS mark 5
       > Channel SIP/flowroute-09f940a8 was answered.
    -- Executing [sys@system:1] NoOp("SIP/flowroute-09f940a8", "dialstatus is ") in new stack
    -- Executing [sys@system:2] Answer("SIP/flowroute-09f940a8", "") in new stack
    -- Executing [sys@system:3] NoOp("SIP/flowroute-09f940a8", "dialstatus is ") in new stack
    -- Executing [sys@system:4] Goto("SIP/flowroute-09f940a8", "call-") in new stack
[Jun  6 12:53:14] NOTICE[6770]: pbx.c:3230 pbx_extension_helper: No such label 'call-' in extension 'sys' in context 'system'
[Jun  6 12:53:14] WARNING[6770]: pbx.c:8942 pbx_parseable_goto: Priority 'call-' must be a number > 0, or valid label
  == Spawn extension (system, sys, 4) exited non-zero on 'SIP/flowroute-09f940a8'
-------------------------------
[system]
exten => sys,1,NoOP(dialstatus is ${DIALSTATUS})
exten => sys,n,Answer()
;exten => sys,n,Wait(10)
exten => sys,n,NoOP(dialstatus is ${DIALSTATUS})
exten => sys,n,Goto(call-${DIALSTATUS})
exten => sys,n,(call-ANSWER),Goto(detect,s,1) ; send to [detect] if an$
exten => sys,n,(call-NOANSWER),Goto(noanswer,s,1) ;send to [noanswer] $
exten => sys,n,(call-BUSY),Goto(busy) ;send to [busy] if busy
exten => sys,n,(call-CANCEL),Goto(cancel);callee hungup before connect$
exten => sys,n,(call-CHANNELUNAVAIL),Goto(cancel)
exten => sys,n,(call-),Goto(s-NOANSWER) ;no status was set so default $
exten => sys,n,Wait(10)
exten => sys,n,Hangup()

 

by: xuserx2000Posted on 2009-06-06 at 20:01:24ID: 24565127

first, there is a syntax error on your labels.
this....
exten => sys,n,(call-),Goto(s-NOANSWER) ;no status was set so default $
should be...
exten => sys,n(call-),Goto(s-NOANSWER) ;no status was set so default $
So take out the comma's...

Also, these goto expressions should be in the outbound context...not the sys.

 

by: xuserx2000Posted on 2009-06-06 at 20:15:35ID: 24565149

[outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}${SIPCO1},30)
exten => _1NXXNXXXXXX,n,Set(__MYDIALSTATUS=${DIALSTATUS}) ;optional - used for inheritence
exten => _1NXXNXXXXXX,n,NoOP(Dial Status: ${DIALSTATUS})
exten => _1NXXNXXXXXX,n,Goto(call-${DIALSTATUS})
exten => _1NXXNXXXXXX,n(call-ANSWER),Goto(detect,s,1); send to ? if answered
exten => _1NXXNXXXXXX,n(call-NOANSWER),Goto(noanswer,s,1) ;send to  ? if not answered
exten => _1NXXNXXXXXX,n(call-BUSY),Goto(busy,s,1) ;send to ? if busy
exten => _1NXXNXXXXXX,n(call-CANCEL),Goto(cancel,s,1);callee hungup before connected
exten => _1NXXNXXXXXX,n(call-),Goto(s-NOANSWER) ;no status was set so default to not answered
exten => _1NXXNXXXXXX,n,Hangup()
Try with these changes...

;=============system context

[system]
exten => sys,1,Answer()
exten => sys,n,Wait(10) ; This time should be more than the total time to evaluate the call.
exten => sys,n,Hangup()


;=============results
;the detect needs some work,
[detect]
exten => s,1,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,BackgroundDetect(silence/3,1000,50)
exten => s,n,Verbose(3,answering machine detected)
exten => s,n,Set(MACHINE=1)
exten => s,n,BackgroundDetect(silence/10,1000,50,30050)
exten => s,n,NoOp(too long of a message)
exten => s,n,Set(CDR(callresult)=messagetoolong)
exten => s,n,GotoIf($[${MACHINE}=1]?machines:humans)
exten => s,n(machines),Goto(visit,s,1)       ; this is a machine
exten => s,n(humans),Goto(human,s,1)       ; this is a human
exten => s,n,Hangup()
 
[msgaccept]
exten => s,1,Playback(outboundmsgs/thankyouaccept)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup()
 
[msgdecline]
exten => s,1,Playback(outboundmsgs/thankyoudecline)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup()
 
[human]
exten => s,1,Playback(outboundmsgs/hellomark)
exten => s,2,Background(outboundmsgs/how_to_ack)
 
exten => 1,1,Goto(msgaccept,s,1) ;pressed 1 accepted
exten => 2,1,Goto(msgdecline,s,1) ;pressed 2 declined
exten => 3,1,Goto(s,1) ;replay msg
 
exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(s,1)
 
[visit]
exten => s,1,Wait(2)
exten => s,2,Playback(outboundmsgs/nonhuman)
exten => s,3,Playback(vm-goodbye)
exten => s,4,Hangup()

[noanswer]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=No Answer)
exten => s,n,Hangup()
 
[busy]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=Busy)
exten => s,n,Set(CDR(priorityretry)=1)
exten => s,n,Hangup()
 
[cancel]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=Canceled)
exten => s,n,Hangup()


;==========Call file.


Channel: SIP/12125551212@flowroute
Callerid: 1000
Context: system
Extension: sys
Priority: 1

 

by: jellydogPosted on 2009-06-07 at 08:53:49ID: 24566844

Hi, my initial test was with the goto's in the outbound context. I just moved them when trying different things... With this configuration, my call gets placed and then goes to [system] and sits there for 10 seconds and hangs up. It seems that the call to 12125551212 (actually using my cell number) gets executed before entering the [system] context. Even if I comment out the entire [outbound] context and reload the dialplan, the call still rings my phone with the same result below. It is as if one has no control of the Dial() routine being called by whatever monitors /outgoing dir or Originate requests. Thanks so much keeping on this with me... Is there possibly another conf file involved?

ubuntu*CLI>
    -- Attempting call on SIP/12125551212@flowroute for sys@system:1 (Retry 1)
  == Using SIP RTP CoS mark 5
       > Channel SIP/flowroute-0a06f460 was answered.
    -- Executing [sys@system:1] Answer("SIP/flowroute-0a06f460", "") in new stack
    -- Executing [sys@system:2] Wait("SIP/flowroute-0a06f460", "10") in new stack
    -- Executing [sys@system:3] Hangup("SIP/flowroute-0a06f460", "") in new stack
  == Spawn extension (system, sys, 3) exited non-zero on 'SIP/flowroute-0a06f460'
[Jun  7 11:42:36] NOTICE[24513]: pbx_spool.c:348 attempt_thread: Call completed to SIP/12125551212@flowroute

[general]
clearglobalvars=yes
autofallthrough=no
 
[global]
SIPCO1=@flowroute
 
[default]
exten => s,1,Verbose(1,Unrouted call handler)
exten => s,n,Answer()
exten => s,n,Wait(1)
exten => s,n,Playback(tt-weasels)
exten => s,n,Hangup()
 
[inbound]
exten => s,1,Answer()
exten => s,n,Playback(hello-world)
exten => s,n,Hangup()
 
[internal]
exten => 1000,1,Verbose(1,Extension 1000)
exten => 1000,n,Dial(SIP/1000,30)
exten => 1000,n,Hangup()
 
[phones]
include => internal
include => outbound
 
[system]
exten => sys,1,Answer()
exten => sys,n,Wait(10)
exten => sys,n,Hangup()
 
[msgaccept]
exten => s,1,Playback(outboundmsgs/thankyouaccept)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup()
 
[msgdecline]
exten => s,1,Playback(outboundmsgs/thankyoudecline)
exten => s,2,Playback(vm-goodbye)
exten => s,3,Hangup()
 
[human]
exten => s,1,Playback(outboundmsgs/hellomark)
exten => s,2,Background(outboundmsgs/how_to_ack)
 
exten => 1,1,Goto(msgaccept,s,1) ;pressed 1 accepted
exten => 2,1,Goto(msgdecline,s,1) ;pressed 2 declined
exten => 3,1,Goto(s,1) ;replay msg
 
exten => i,1,Playback(pbx-invalid)
exten => i,n,Goto(s,1)
 
 
[visit]
exten => s,1,Wait(2)
exten => s,2,Playback(outboundmsgs/nonhuman)
exten => s,3,Playback(vm-goodbye)
exten => s,4,Hangup()
 
[outbound]
exten => _1NXXNXXXXXX,1,Dial(SIP/${EXTEN}${SIPCO1},30)
exten => _1NXXNXXXXXX,n,Set(__MYDIALSTATUS=${DIALSTATUS}) ;optional - used for $
exten => _1NXXNXXXXXX,n,NoOP(Dial Status: ${DIALSTATUS})
exten => _1NXXNXXXXXX,n,Goto(call-${DIALSTATUS})
exten => _1NXXNXXXXXX,n (call-ANSWER),Goto(detect,s,1) ; send to [detect] if an$
exten => _1NXXNXXXXXX,n (call-NOANSWER),Goto(noanswer,s,1) ;send to [noanswer] $
exten => _1NXXNXXXXXX,n (call-BUSY),Goto(busy) ;send to [busy] if busy
exten => _1NXXNXXXXXX,n (call-CANCEL),Goto(cancel);callee hungup before connect$
exten => _1NXXNXXXXXX,n (call-CHANNELUNAVAIL),Goto(cancel)
exten => _1NXXNXXXXXX,n (call-),Goto(s-NOANSWER) ;no status was set so default $
exten => _1NXXNXXXXXX,n,Hangup()
 
[detect]
exten => s,1,Set(TIMEOUT(digit)=5)
exten => s,n,Set(TIMEOUT(response)=10)
exten => s,n,Set(MACHINE=0)
exten => s,n,BackgroundDetect(silence/3,1000,50)
exten => s,n,Verbose(3,answering machine detected)
exten => s,n,Set(MACHINE=1)
exten => s,n,BackgroundDetect(silence/10,1000,50,30050)
exten => s,n,NoOp(too long of a message)
exten => s,n,Set(CDR(callresult)=messagetoolong)
exten => s,n,GoToIf($[${MACHINE}=1]?machines:humans)
exten => s,n(machines),Goto(visit,s,1) ;this is a machine
exten => s,n(humans),Goto(human,s,1)   ;this is a human
exten => s,n,Hangup()
 
[noanswer]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=No Answer)
exten => s,n,Hangup()
 
[busy]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=Busy)
exten => s,n,Set(CDR(priorityretry)=1)
exten => s,n,Hangup()
 
[cancel]
exten => s,1,Set(CDR(accountcode)=${EXTEN})
exten => s,n,Set(CDR(callresult)=Canceled)
exten => s,n,Hangup()
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:

Select allOpen in new window

 

by: jellydogPosted on 2009-06-07 at 09:06:59ID: 24566892

maybe I am going about this all wrong. I have an automated alert system to which users subscribe. They must enter their phone number into the system. When an alert needs to be sent, my server calls the subscribers and plays the alert message. I need to know if:
1. the call failed (possibly due to thier erroneous entry of thier number, or phone disconnected)
2. the call was answered
3. the line was BUSY (so I can prioritize this callee to get queued to be called again)
4. the call went UNANSWERED (so I can prioritize this callee to get queued to be called again)
5. the call was CANCELED
6. Channel unavailable

My reports are using the CDR tables that get populated with these details. Eventually, items 3 and 4 would be managed inside of the dialplan. Anyway, using DIALSTATUS seemed the way to go - but if there is a better option... ;)

 

by: xuserx2000Posted on 2009-06-07 at 13:36:22ID: 24567983

change the call file to this..

Channel: SIP/12125551212@flowroute
Callerid: 1000
Context: detect
Extension: s
Priority: 1

That will feed all answered calls to detect.


Read this: http://www.voip-info.org/wiki/view/Asterisk+auto-dial+out+deliver+message

 

by: jellydogPosted on 2009-06-07 at 15:38:04ID: 24568334

Hmmm, that puts me back to what I had originally. We created the [system] context to try and trap the ability to read DIALSTATUS. Prior to that, I was entering the dialplan at [detect]. I read the wiki a while back. Maybe it is just not possible to read DIALSTATUS when using call files or AMI.

You mentioned you had a test system. Have you tried to make a call with a call file and echo dialstatus? (without invoking a second Dial() app?)

Again, I can't thank you enough for helping me.

 

by: xuserx2000Posted on 2009-06-08 at 07:27:08ID: 24572435

You only really need to read the dialstatus if the call IS NOT answered...
If it's answered, you already know it's answered...because the ivr plays.

Place a call, with that call file, and DONT answer the call.  Let's see where the dialplan takes it, and what the dialstatus shows in the CLI.



Also, have you read any of this from the wiki ?

Callfiles and Call Detail Records :
Avoid missing CDR records: Use either a) Context/Extension/Priority in the call file instead of Application/Data, or b) call a Local channel instead of directly calling the desired channel. Else Asterisk will bypass the process that tracks the call and no CDR record will be generated. When using Context/Extension/Priority, you are really using a Goto type function which just puts the call into the correct part of the dialplan and to it is the same as if the caller had dialed the call manually and so the call is logged.

http://www.voip-info.org/wiki/view/Asterisk+local+channels
In Manager API or in a call-file, a CDR will not be generated without using the local channel. At its simplest, use these examples to Dial:


For Manager API or in a call-file use the following to specify an outbound call. (the trailing '/n' is important):

Channel: local/PHONENUMBERTOCALL@outbound/n

And in extensions.conf:

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


Maybe you should try using a local channel on the call file ....

 

by: jellydogPosted on 2009-06-08 at 17:51:26ID: 24577494

ok - I think I can make this work. My call file now looks like this:
Channel: local/121255512121@outbound/n
Callerid: 1000
Context: detect
Extension: s
Priority: 1

and my [outbound] captures DIALSTATUS for everything but 'ANSWERED' - which, if it was answered,  I just set a variable=ANSWERED manually in [detect] (as you pointed out :). This does cause multiple CDR records per call, but I think I can live with that.

THANK YOU SO MUCH FOR SEEING THIS THROUGH!!!




 

by: jellydogPosted on 2009-06-08 at 17:53:18ID: 31585993

Thanks xuserx2000 - You are a Master

 

by: jellydogPosted on 2009-06-08 at 18:47:12ID: 24577705

Further testing has created a new issue. If I use local/12125551212@outbound/n, then the playback of the file is very choppy and incomprehensive. Switching back to SIP/12125551212@flowroute plays the ivr just fine. Any ideas as to why this would occur? thanks.

 

by: jellydogPosted on 2009-06-08 at 19:10:06ID: 24577773

I will post this as a new issue. Thanks again.

 

by: xuserx2000Posted on 2009-06-08 at 19:31:48ID: 24577851

cool... I knew we could make it work.

Not sure why using a local channel would make a difference in sound quality...  if I had to guess I would say it probably has something to do with codec transcoding.

 

by: jellydogPosted on 2009-06-09 at 18:49:31ID: 24587495

What about Transfer() - would that help it? I have not implemented that since I kinda dont understand where to put it. (you mentioned it earlier). What do you think?

 

by: jellydogPosted on 2009-06-09 at 19:26:19ID: 24587615

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...