QueueMetrics, qLoader, and Asterisk not talking correctly - asterisk

I have 2 servers, one with QueueMetrics installed and the other with Asterisk and qLoader. Both of these servers are able to communicate with each other and pass data back and forth. The problem that I am running into is that when adding an agent to a queue, neither Queuemetrics or the Asterisk server is recognizing that the agent is being added. I can make a call into the queue and see it being offered to the queue in real-time in QM. When I try to add an agent to the queue, QM says that the agent is being added. When watching the real-time monitor after the agent is added, the agent just never shows up as logged in. I have checked the MySQL database as well and it never shows the agent as being logged in either. I am unsure at this point what is causing the issue, and whether it is that the agent isn't being add to MySQL because of QM or because the agent available isn't being sent to the Asterisk server.
Any help would be greatly appreciated.

i think you need read something about queues setup and check your setup. For example this book: http://cdn.oreilly.com/books/9780596510480.pdf
Unfortanly no way troubleshoot your install without see config&debug.

QueueMetrics uses two different channels to work with the server: it reads data from the queue_log through qloader (and that is working for you) and uses AMI plus a custom Asterisk dialplan to perform actions like logging-on agents.
You can test the AMI and whether the dialplan is included through the DbTester tool - see http://queuemetrics.com/manuals/QM_UserManual-chunked/ar01s20.html#DBTEST - note that you may need to edit the supplied dialplan to match the format of your channel names. Qm is very flexible, but you need to tell it how your environment is set-up.
Or just keep an Asterisk CLI open when trying to log in agents and see what happens.

Related

Is it possible to track a call backwards beyond the last PBX?

We receive international calls into an Asterisk server (13.20) where some of the calls are automated, meaning there is no person involved, sort of M2M.
It is important for us to know where those automated call are coming from. Since it is easy to generate a call with faked ID we want to strengthen the authentication by identifying the original network from where the call was made.
When looking at the Asterisk logs I can see that a call came from Twilio for example, but that's it, no more tracking information.
My question:
Is it possible to track a call backwards beyond the last PBX who transferred the call to my server?
Some operators send some tracking in sip headers
For see more info, check sip debug.
asterisk -r
sip set debug on
However most of operators not provide for clients info about path of calls, some even not store it for internal use.

How handle a non-resumable ordered delivery send port

Has anyone got an elegant way to resolve an ordered delivery send port (with stop sending subsequent messages ticked) that has suspended (non-resumeable)?
Please let me know how you handle it. Do you use any tools, or created any custom tools.
Not a good way out of the box. We have developed some utility to save these messages in case required using BizTalk Explorer OM, however BizTalk Explorer OM also has a limitation of saving only 50 messages in one single service instance. So your best bet is to make sure you have a way to replay those messages from outside by keeping a copy of message.

asterisk get credit card info

I`m trying to build a script that will capture the credit card info like card number,cvc and expiration date using asterisk 11.x and asterisk-java library for AMI/AGI integration.
Right now I am able to build a script that will acquire that info if it is called via dialplan but i have a different scenario:
1. A call enters a queue.
2. An agent from the specific queue answer the call
3. The caller wants to input the card details
4. After the caller has entered the card details is redirected back to agent to continue the call.
My specific problem is related to step 3 as I do not know how to route the caller to my AGI and then back to the same agent. (eventually the agents has to be still involved in (some) call to guarantee that when the caller returns from agi it is still available)
Any idea how can I achieve that ? I know that this is a common practice so I think that there has to be a way.
When the call is delivered to the agent, use a macro to set a custom channel variable with the agent ID or extension in it.
Then, when your credit-card authentication function is done, read the variable and use an AGI command to transfer the call back to the agent.
Further Reading
http://www.voip-info.org/wiki/view/Asterisk+variables
http://www.voip-info.org/wiki/view/Asterisk+manager+Example:+Transfer
Note if this solution solves your problem, please 'accept' it to make it easier for others with the same issue to find it. thanks!
There are no any common practice for business process like you have. That depend of you and your client only.
You can use features conf or transfer. Can transfer to special extension or to conference room.
No way say what suite you better.
For sure you need understand how asterisk work before write any AGI/AMI or dialplan application. I can recommend ORelly's "Asterisk the future of telephony" book as start point.

Alfresco Error reporting via e-mail

Is there a way to set up Alfresco to send email to admins on each server error as in Python Django Error reporting via e-mail?
Thanks in advance for any hint.
The first thing I would say is that you need to really look in to the viability of using e-mails to help admins spot problems with servers. Sending an e-mail can be a heavy operation and as such, particularly with many repeated errors, can make an existing problem worse. And what about the cases where the ability to send e-mails goes down or a problem so severe happens that it simply cannot send e-mails?
For properly setting up reporting on your servers you might want to look at Logstash + Kibana:
http://alfresco.blog.redpill-linpro.com/2014/07/01/alfresco-logging-with-logstash-and-kibana-part-1-the-basics/
That being said, it should be possible to configure log4j to use an SMTP appender if that is the route you want to go down:
What is the proper way to configure SMTPAppender in log4j?
In Alfresco 4.2 you should need to add something such as the following to the log4j.properties in tomcat/webapps/alfresco/WEB_INF/classes/:
#CONFIGURE SMTP
log4j.appender.email=org.apache.log4j.net.SMTPAppender
log4j.appender.email.SMTPHost=mail.mydomain.com
log4j.appender.email.SMTPUsername=myuser#mydomain.com
log4j.appender.email.SMTPPassword=mypw
log4j.appender.email.From=myuser#mydomain.com
log4j.appender.email.BufferSize=1
log4j.appender.email.EvaluatorClass=TriggerLogEvent
log4j.appender.email.layout=org.apache.log4j.PatternLayout
log4j.appender.email.layout.ConversionPattern=%m

Send Newsletter in asp.net to around 10000 emails

i have to write application for sending newsletter.
what is the best way to send newsletter thoundands of users?
My requirement is
Each mail is seprately as To :
Every mail has unique Unsubscribe link
Is is good to use SMTP mail class of .net?
I look aound may questions in so but can't decide which approcah i should go?
There are many suggestions
Multi threaded Windows service
Use Mail Server
Add thread.sleep(2000) between each send.
can anyone suggest good way to imepement this?
I would not recommend asp.net webpage to send, even if you do start it in a separate background thread. I would think you run the risk of the server recycling your process in the middle of the send, which would mess it up. You really need to write some kind of separate service or application to send your emails.
The simplest option would be to just create a quick and dirty console or windows form application.
Also logging is critical just like the other poster said. If it fails you want to know exactly what got sent out and where it stopped so that when you restart it you don't mail all the people who it did work for again. You want to be able to input the starting point for the send, so if you need to restart at number email #5000 you can.
The classes in System.Net.Mail namespace will work just fine for sending your mail.
One of the biggest problems will be finding a email host that will let you send so many emails. Most email hosts have throttling and sometime it changes depending upon server conditions so if the server is being heavily used then the email limits will be more restrictive, and you may only get to set 500 emails per hour.
We have a newsletter that goes out to around 20000 people as separate emails and we had to play around with the delay between emails until we found one that would work for our email host. We ended up with 1.2 sec between emails, so that might be a good starting point.
I think there are email hosts specialize in bulk mailings though so if you get one of those it might not be a problem.
Also if you host your own email this may not be a problem. And if you do host your own mail you will have the option of dropping the mail in the pickup directory and you could just dump it all in there as fast as you want, and let the email service pick it up at it's own pace.
EDIT: Here is the settings to add to the config file for setting the pickup directory
<system.net>
<mailSettings>
<smtp from="support#test.com" deliveryMethod="SpecifiedPickupDirectory" >
<specifiedPickupDirectory pickupDirectoryLocation="Z:\Path\To\Pickup"/>
</smtp>
</mailSettings>
</system.net>
Definitely do not do this in ASP.NET. This is one of the biggest mistakes that new web developers make.
This needs to be a windows app or service that can handle this much volume.
I've written pages that send emails, but not nearly the volume yours will. Nonetheless, I would recommend the following based on code I have implemented in the past:
Use the web application to write out the email and all the recipient addresses to database table(s).
Have a process that is outside of ASP.NET actually send the emails. This could be a vbs file that is set up as a scheduled task, or (preferably) a windows service. The process would take the text of the email, append the unsubscribe link, and once sent successfully flag the database record as sent. That way, if the send fails, it can try again later (the send process loops over all the records flagged as unsent).
If you need a log of what was sent and when, you just need to keep the sent records in the database tables. Otherwise, just delete the records once sent successfully.
IMHO sending emails within the ASP.NET worker process is a bad idea because you don't know how long it will take and if the send fails there's little opportunity to retry before the page times out.
Create a webpage to "Design" the newsletter in. When they hit Send, queue the newsletter up somewhere (database) and use another program (windows service, etc) to send the queued letter. This will be many times more effecient and potentially fault tolerant if designed properly.
I have written a Newsletter module (as part of a bigger system) in ASPNET MVC 2, Entity Framework and using the System.Net.Mail namespace. It is kicked off in view and actually just runs in a controller with a supporting method to do the send. As each email is sent I track whether there is a hard bouce (an exception is thrown) and I update that database record stating a fail with the exception, otherwise I update the record stating success. We also do personalisation so we have 'tags' that get replaced by an extra field in the database (stored as XML for flexibility). This helps handle an unsubscribe function.
My code is quite simple (please don't flame me for using exception handling as business logic ;) and it works like a charm.
This is all done on a VPS at http://maximumasp.com which also hosts 4 sites with pretty decent traffic. We use their SMTP servers. We notified them that we needed this service and have had no problems relationship-wise.
We had 2GB of RAM on the machine running Windows 2008 and it was doing 6 emails/sec. We bumped it up to 3GB as the web sites needed it and now the mailout is doing about 20emails/sec. Our mailouts range from 2,000 to 100,000 email addresses.
In short, ASP.NET can be used to handle a mailout, and if you add in some logic to handle record updating the worry of losing your way mid-send is mitigated. Yes there are probably slicker ways to do this. We are looking in to MQMS and threading, and separating that out to windows service to make it more stable and scalable as we put more clients and larger lists on, but for now it works just fine with reasonable reporting and error handling.

Resources