I have configured my carrier settings as below,
[100]
disallow=all
allow=ulaw
allow=g729
type=friend
dtmfmode=rfc2833
qualify=yes
insecure=invite,port
nat=force_rport,comedia
fromuser=xxx.xxx.xxx.xxx
host=xxx.xxx.xxx.xxx
canreinvite=no
port=5060
Global Stirng : VoiPHola=SIP/100
Dial Entry Plan
exten => _1.,1,AGI(agi://127.0.0.1:4577/call_log)
exten => _1.,2,Dial(${100}/3000#${EXTEN:1},,tTo)
exten => _1.,3,Hangup
When I logged in as Agent, there is no calls outgoing and after sometime the Dial Timeout error comes at agent screen...
What is causing the issue?
Your global string variable name is VoiPHola, but your dial variable is ${100}, these have to match. Use ${VoiPHola} and they match.
Note that all the string variable does is get replace with the right side of the equal sign in the dial plan entry when it runs. Thus you COULD just put SIP/100 in Dial(SIP/100/3000#${EXTEN:1},,tTo) instead for the same effect.
But then you wouldn't be using the variable and if you changed this variable definition it would have zero effect anywhere. In theory you can use this variable in multiple carrier configurations (such as a failover dialplan?). Global Strings not really necessary.
MOST importantly (as pointed out by arheops), this is not really the appropriate venue for your question. Vicidial.com has a forum for this where lots of Vicidial Pros and Cons (oops: amateurs) will answer questions like this for you and help you get going.
Related
I have two fields, called 'status_codes' and requests
I want to get number of failed requests.
My equation is [requests - no of success requests]
In the script i wrote something like this _value - doc['#status_codes.200'].value
BUT the value return in the graph is 'N/A'
I'm using elasticsearch(7.6.0) and Grafana(6.6.2).
Following is the out file which i'm sending to elasticsearch
{ "latencies":{
"total":3981710268690,
"mean":43876078,
"50th":916913,
"90th":2217744,
"95th":5162430,
"99th":60233348,
"max":60000209373,
"min":43652
},
"#version":"1",
"latest":"2020-03-05T16:14:44.23387091Z",
"path":"test23.json",
"duration":61163899322,
"wait":552109,
"status_codes":{
"0":90624,
"200":125
},
"earliest":"2020-03-05T16:13:43.069971588Z",
"rate":1483.702004057131,
"throughput":2.0436707446156577,
"#timestamp":"2020-03-05T16:14:44.453Z",
"errors":[
"Post http://www: dial tcp 0.0.0.0:0->10.133.9.87:8688: socket: too many open files",
"Post http://www: dial tcp: lookup internal-netty-load-balancer-937469711.us-east-1.elb.amazonaws.com on 10.20.30.30: dial udp 10.20.30:45: socket: too many open files"
],
"bytes_in":{
"mean":70.90298515686123,
"total":6434375
},
"requests":90749,
"Report_Title":"test23",
"host":"ABS",
"success":0.0013774256465635985,
"end":"2020-03-05T16:14:44.234423019Z",
"bytes_out":{
"mean":70.90298515686123,
"total":6434375
}
}
Also I have used Singlestat plugin as #yash mentioned, but still i could resolve the issue.
Query section
Visualization section
Can someone help me
This is a fairly easy task. You just need to use either of the 'Singlestat Math' or 'Metaqueries' plugin for that. What you need to do is, use the count metric in two queries in the same panel, one for getting the count of successful status codes, and other for unsuccessful status codes. Then you can use either of the plugin to subtract the value of result of query one query from another.
https://grafana.com/grafana/plugins/blackmirror1-singlestat-math-panel
https://grafana.com/grafana/plugins/goshposh-metaqueries-datasource
I suggest you go with the singlestat math plugin, it would be easier to work with, from my experience.
Note: The calculation (A-B) is done in the visualization section and not in query section, in the singlestat math plugin.
P.S. singlestat-math plugin actually adds a new panel in the visualization section. It's a different panel than the default singlestat panel.
Finally I found the the solution as follow,
solution
Thanks everyone.
I was wondering if there is a way to set multiple recipients WITHOUT looping over the list of recipients at my end?! Also most importantly while using variable alphanumeric sender ID and NOT buying a twilio number?
I can do all this for single recipient like this:
$twilio_client->messages->create(
'+64*******', //to
[
'from'=> 'foo',
'body' => 'bar'
]);
Works perfectly fine. However, doesnt work with multiple receivers.
Also note, it was bloody-1-step easy to implement smsbroadcast.com.au and pass all this in a simple call (simple call, quick fast, super easy documentation - unlike twilio which has like a billion lines of confusing documentation, 200 similar products and YET no direct api to check balance, or do a simple thing such as multiple recipients!!)
After a lot of back and through with the support, plus reading all the over-written-essay (so-called documentations), finally I found a way to get all that done.
[Step 1: Configuration]
You have to implement Notify product which is a separate product than the Message product.
So from left menu Notify> Service> add New. Here you need to add a Messaging Service and have it selected here for Notify.
On the Messaging Services page, it will ask you to buy a twilio number. Instead just click on Configure from the left menu and put in all the details you need.
Specifically and importantly, make sure you have Alpha Sender ID checked and a default Alpha Sender text entered there. This will be the default fallback in case if your api call fails to accept the from param.
.
[Step 2: API Call]
//$notify_service_SID = the SID from the Notify Service you added in step 1
$client = new Client($this->Account_SID, $this->auth_token);
$notify_obj = $client->notify->services($notify_service_SID);
//you need receivers in a JSON object such as the following, plus make sure numbers are starting with country code to ensure alpha sender works correctly
$receivers_json = [0=>'{"binding_type":"sms","address":"+614********"}']+[1=>'{"binding_type":"sms","address":"+614*******"}']
$call_ret = $notify_obj->notifications->create([
'toBinding'=> $receivers_json,
'body' => $msg, //actual message goes here
'sms' => [
'from'=> $sender //alphanumeric variable sender
],
]);
.
[Step 3: Check for errors]
There is no direct way to check all errors in twilio when implementing Notify. Here is my mixed approach.
Exception handling to the notifications->create call
$call_ret will have err if the Notify fails, but not when the Message fails. because Notify just passes the call to Message and there is no direct way to check Message errors over Notify call. So you would check for $call_ret['err']
Call the Alerts API; fetch all recent alerts, and match against the Notification SID you received from the last call.
--
Here is how to do the Alerts check:
$alerts = #$client->monitor->v1->alerts->read();
if(is_array($alerts))
foreach($alerts as $av)
{
$t = #$av->toArray();
#parse_str($t['alertText'], $alert_details);
if(isset($alert_details['notificationSid']) && $alert_details['notificationSid'] == $call_retx['sid'])
{
$alert_err = $alert_details['description'];
break;
}
}
$alert_err will carry an error if there was an error. Apart from this there is no direct way to do it. You can fetch these Alerts via crons or you can setup a webhook for them to do a call back. Or simply implement a one call simple api that does it all in super simple way such assmsbroadcast.
A Connection to whois.arin.net is not open to us. Our network administrators say we should use 192.0.47.59 for our whois service.
In some cases I will have a DNS name, in other cases I will have an IP address. I want to get the whois information in either case. My network administrators have allowed access to a specific IP address for the whois service, and I have to use that IP address. The define method allows me to set the IP address of the whois service if I give it the TLD, but I have no way to get it work for IP addresses.
This is related to Setting address of whois service for ruby whois gem, but since I got a partial solution, I know how to call the service, so for my question specific to IP addresses I thought I would start over.
I need to set the address of our whois service. So for a DNS name:
> Whois.whois('wandajackson.com')
Whois::ConnectionError: Errno::EHOSTUNREACH: No route to host - connect(2) for "whois.verisign-grs.com" port 43
from (irb):4
> Whois::Server.define(:tld, 'com', '192.0.47.59')
=> ["com", "192.0.47.59", {}]
irb(main):006:0> Whois.whois('wandajackson.com')
# => #<Whois::Record>
However, I cannot get it to work for IP addresses.
> Whois::Server.define(:ipv4, '74.0.0.0/8', '192.0.47.59')
=> ["74.0.0.0/8", "192.0.47.59", {}]
> Whois.whois('74.220.215.203')
Whois::ConnectionError: Errno::EHOSTUNREACH: No route to host - connect(2) for "whois.arin.net" port 43
from (irb):7
> Whois::Server.define(:ipv6, '2607::/8', '192.0.47.59')
=> ["2607::/8", "192.0.47.59", {}]
> Whois.whois('2607:f8b0:4004:800::200e')
Whois::ConnectionError: Errno::EHOSTUNREACH: No route to host - connect(2) for "whois.arin.net" port 43
from (irb):9
I'm sorry to say but that is a bug with missing 74.0.0.0/8 assigment & if you create your own it is probably not correctly searched for in the defined list thus => The assigment according to IP does not currently work.
Why?
You can check the list and find out which ranges are assigned to ARIN:
Whois::Server.definitions(:ipv4).each { |records| p "IP range #{records[0]}" if records[1] = 'whois.arin.net'}
First without any changes you check your IP address:
Whois::Server.find_for_ip("74.220.215.203")
=> #<Whois::Server::Adapters::Arin:0x00000000030244c0 #type=:ipv4, #allocation="0.0.0.0/1", #host="whois.arin.net", #options={}>
As you can see the record is not found at the authorities so it goes to a fallback 0.0.0.0/1 which is set for whois.arin.net.
I tried to set fatory (gets somehow ignored) and define:
Whois::Server.factory :ipv4, "74.0.0.0/8", "whois.iana.org", :option => Whois::Server::Adapters::Standard
define worked:
Whois::Server.define :ipv4, "74.0.0.0/8", "whois.iana.org"
... , {}], ["222.120.0.0/15", "whois.nic.or.kr", {}], ["222.122.0.0/16",
"whois.nic.or.kr", {}], ["222.232.0.0/13", "whois.nic.or.kr", {}],
["220.0.0.0/6", "whois.apnic.net", {}], ["74.0.0.0/8",
"whois.iana.org", {}]]
As you can see there is assigment of
["74.0.0.0/8",
> "whois.iana.org", {}]]
so you should be able to query IANA now? It appears you are not:
Whois::Server.find_for_ip("74.220.215.203")
=> #<Whois::Server::Adapters::Arin:0x000000000434c250 #type=:ipv4, #allocation="0.0.0.0/1", #host="whois.arin.net", #options={}>
As you can see the #allocation is still getting "0.0.0.0/1" and not 74.0.0.0/8. Why? That I don't know yet. Probably some bug either on searching or finding the correct Object.
Everything is lost? Not really, there is rather simple workaround but you have to understand the implications.
Workaround
If you define your fallback address via:
Whois::Server.define :ipv4, "0.0.0.0/1", "whois.iana.org"
Everything starts to work. Now all the fallback queries will be done via IANA, which should not be a problem in your case as you can't reach ARIN anyways.
Now if you query via IP adddress you get correct results:
Whois::Server.find_for_ip("74.220.215.203")
=> #<Whois::Server::Adapters::Standard:0x000000000351c298 #type=:ipv4, #allocation="0.0.0.0/1", #host="whois.iana.org", #options={}>
Whois.whois("74.220.215.203")
=> "% IANA WHOIS server\n% for more information on IANA, visit http://www.iana.org\n% This query returned 1 object\n\nrefer: whois.arin.net\n\ninetnum:
74.0.0.0 - 74.255.255.255\norganisation: ARIN\nstatus: ALLOCATED\n\nwhois: whois.arin.net\n\nchanged: 2005-06\nsource: IANA\n\n"
I'm starting to use whoisrb and I'm noticing domains from some registrars return nil contact information.
For example:
domain_name = ARGV[0]
r = Whois.whois(domain_name)
t=r.registrant_contact
if t == nil
puts 'Registrant Contact is empty.'
end
Will return "Registrant Contact is empty." Trying to access the contact attributes results in an error, like undefined method 'id' for nil:NilClass (NoMethodError).
If I check the raw record that's being returned, puts r, I can see it's getting the thick record, so the contact information is there in the unparsed raw record.
The two registrars I've noticed this for, so far, are onlinenic.com and namesilo.com. If you try to run whois for those two domains, you'll see what I mean.
I'm checking the ICANN compliant sample here:
https://www.icann.org/resources/pages/approved-with-specs-2013-09-17-en#whois
against onlinenic.com and namesilo.com, and I don't see any substantial differences (maybe I'm missing something, though).
Any ideas why it's having trouble parsing these, or pointers on what I could check to fix it? Thanks.
It happens when the registrar has no parser associated, or the parser doesn't have the definition required to parse the contacts.
In other words, unless a parser exists, it's possible that the registrar details are in the response but the library can't find them.
In that case, the solution is to either add/update the parser corresponding to the specific registrar/registry.
Since this behavior is confusing to whoever is not familiar with the internals of the library, also note that the new release 4 will raise an error in this case (instead of silently returning nil). In this way it will be clear when the value is nil vs the value is unknown.
r = Whois.whois(domain_name)
The r here is a Whois::Record object and you can find the available methods here. registrant_contact is not one of them. You probably have to parse it out yourself.
Curl has an option which allows me to specify to which IP a domain should be resolved
e.g. curl --resolve example.com:443:1.2.3.4 https://example.com/foo
to make sure that a very specific server is called
(e.g. when multiple servers have the same vhost with a load balancer usually in front of it and there are multiple applications running on the same port with different vhosts)
How do I set this value when using Ethon? https://github.com/typhoeus/ethon
This is how I'd expect it to work
Ethon::Easy.new(url: "https://example.com/foo", :resolve => "example.com:443:1.2.3.4")
but I'm getting an invalid value exception (I have tried multiple different formats that came to mind)
Ethon::Errors::InvalidValue: The value: example.com:443:1.2.3.4 is invalid for option: resolve.
I took a look at the code but couldn't figure out how I'd have to provide the value - and the documentation on this is a bit scarce
Thanks in advance for any reply that might point me in the right direction
Thanks to i0rek on Github I got the answer I was looking for:
resolve = nil
Ethon::Curl.slist_append(resolve, "example.com:443:1.2.3.4")
e = Ethon::Easy.new(url: "https://example.com/foo", :resolve => resolve)
#=> #<Ethon::Easy:0x007faca2574f30 #url="https://example.com/foo", ...>
Further information can be found here:
https://github.com/typhoeus/ethon/issues/95#event-199961240