[asterisk-users] Timeout for AGI/HAGI connections

2019-01-07 Thread Mitch Claborn

Asterisk 16.1.0

I'm using hagi and SRV records for a "high availability" configuration 
of AGI servers.  When the first AGI server in the list is completely 
down, asterisk quickly moves on to the next one. That is all good.


My concern is what will happen if asterisk can actually connect to the 
first AGI server and initiate the script, but something is internally 
wrong with the server and it takes a long time to respond.


Is there some way to set a timeout value, so that if the AGI 
server/script does not respond in (some amount of time) that asterisk 
will time out and treat it as a failure?


Even better would be if that timeout would trigger a retry on the next 
server in the SRV record list.



--

Mitch

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] [asterisk-app-dev] ARI Node JS Bridge.addChannel

2019-01-07 Thread Matt Riddell


> On Jan 7, 2019, at 12:25, Joshua C. Colp  wrote:
> 
> On Mon, Jan 7, 2019, at 1:23 PM, Matt Riddell wrote:
>> Hiya,
>> 
>> I would have expected this to show the channels in the bridge inside 
>> the anonymous function - it shows the bridge is empty though?
>> 
>>var bridge = ari.Bridge();
>>bridge.create({
>>type: 'holding',
>>name: event.application+" bridge"
>>}, function(err, bridge) {
>>bridge.addChannel({
>>channel: incoming.id
>>}, function(err) {
>>console.log("Added to bridge")
>>console.log(bridge.channels).   ; 
>> <——— This Line
>>console.log(err);
>>});
>> 
> 
> I believe you are accessing the snapshot, essentially, of the bridge at the 
> time it was created in which case there would be no channels. You would need 
> to retrieve an up to date snapshot to get the current state.

Yeah cool that worked:

ari.bridges.get({bridgeId: bridge.id}, function (err, newBridge) {
console.log("New Bridge: "+newBridge.channels)
});
___
asterisk-app-dev mailing list
asterisk-app-...@lists.digium.com
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] [asterisk-app-dev] ARI Node JS Bridge.addChannel

2019-01-07 Thread Matt Riddell


> On Jan 7, 2019, at 12:25, Joshua C. Colp  wrote:
> 
> On Mon, Jan 7, 2019, at 1:23 PM, Matt Riddell wrote:
>> Hiya,
>> 
>> I would have expected this to show the channels in the bridge inside 
>> the anonymous function - it shows the bridge is empty though?
>> 
>>   var bridge = ari.Bridge();
>>   bridge.create({
>>   type: 'holding',
>>   name: event.application+" bridge"
>>   }, function(err, bridge) {
>>   bridge.addChannel({
>>   channel: incoming.id
>>   }, function(err) {
>>   console.log("Added to bridge")
>>   console.log(bridge.channels).   ; 
>> <——— This Line
>>   console.log(err);
>>   });
>> 
> 
> I believe you are accessing the snapshot, essentially, of the bridge at the 
> time it was created in which case there would be no channels. You would need 
> to retrieve an up to date snapshot to get the current state.

Yeah cool that worked:

ari.bridges.get({bridgeId: bridge.id}, function (err, newBridge) {
console.log("New Bridge: "+newBridge.channels)
});
___
asterisk-app-dev mailing list
asterisk-app-...@lists.digium.com
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] [asterisk-app-dev] ARI Node JS Bridge.addChannel

2019-01-07 Thread Joshua C. Colp
On Mon, Jan 7, 2019, at 1:23 PM, Matt Riddell wrote:
> Hiya,
> 
> I would have expected this to show the channels in the bridge inside 
> the anonymous function - it shows the bridge is empty though?
> 
> var bridge = ari.Bridge();
> bridge.create({
> type: 'holding',
> name: event.application+" bridge"
> }, function(err, bridge) {
> bridge.addChannel({
> channel: incoming.id
> }, function(err) {
> console.log("Added to bridge")
> console.log(bridge.channels).   ; 
> <——— This Line
> console.log(err);
> });
> 

I believe you are accessing the snapshot, essentially, of the bridge at the 
time it was created in which case there would be no channels. You would need to 
retrieve an up to date snapshot to get the current state.

-- 
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

___
asterisk-app-dev mailing list
asterisk-app-...@lists.digium.com
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] [asterisk-app-dev] ARI Node JS Bridge.addChannel

2019-01-07 Thread Matt Riddell
Hiya,

I would have expected this to show the channels in the bridge inside the 
anonymous function - it shows the bridge is empty though?

var bridge = ari.Bridge();
bridge.create({
type: 'holding',
name: event.application+" bridge"
}, function(err, bridge) {
bridge.addChannel({
channel: incoming.id
}, function(err) {
console.log("Added to bridge")
console.log(bridge.channels).   ; <——— This 
Line
console.log(err);
});

Reason being, I’m creating a queue need to move channels between bridges 
depending on agent/customer status etc

Cheers,

Matt Riddell
___
asterisk-app-dev mailing list
asterisk-app-...@lists.digium.com
http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Configure SIP reply timeout (timerb in sip.conf)

2019-01-07 Thread Markus

Reply to self: Found the problem after reading this post:

http://lists.digium.com/pipermail/asterisk-dev/2010-March/042735.html

You need to set timert1 in the peer config to *something*, otherwise it 
will ignore the timerb setting. Bug? It now looks like this and works fine:


[peer01]
host=1.2.3.4
type=peer
context=nowhere
disallow=all
allow=alaw
allow=ulaw
canreinvite=no
dtmfmode=rfc2833
timert1=500
timerb=2000

timert1=500 is the default anyway, according to sip.conf comments...

Regards
Markus


Am 07.01.2019 um 17:23 schrieb Markus:

Dear list,

Asterisk 11.25.0 user here. I'm trying to set up failing over to a 
second SIP peer if the first SIP peer doesn't answer on our SIP INVITE 
within 2 seconds.


In sip.conf I set timerb=2000 for this peer, but it doesn't seem to have 
any effect. The timeout is 6.5 seconds instead, which is in line with 
this description from sip.conf:


"timerb: Call setup timer. If a provisional response is not received in 
this amount of time, the call will autocongest. Defaults to 64*timert1 
(Which is 100 ms = rougly 6.5 seconds)"


Maybe I cannot set timerb on a peer-basis? Here's my peer config:

[peer01]
host=1.2.3.4
type=peer
context=nowhere
disallow=all
allow=alaw
allow=ulaw
canreinvite=no
dtmfmode=rfc2833
timerb=2000

Thank you!
Markus




--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

[asterisk-users] Configure SIP reply timeout (timerb in sip.conf)

2019-01-07 Thread Markus

Dear list,

Asterisk 11.25.0 user here. I'm trying to set up failing over to a 
second SIP peer if the first SIP peer doesn't answer on our SIP INVITE 
within 2 seconds.


In sip.conf I set timerb=2000 for this peer, but it doesn't seem to have 
any effect. The timeout is 6.5 seconds instead, which is in line with 
this description from sip.conf:


"timerb: Call setup timer. If a provisional response is not received in 
this amount of time, the call will autocongest. Defaults to 64*timert1 
(Which is 100 ms = rougly 6.5 seconds)"


Maybe I cannot set timerb on a peer-basis? Here's my peer config:

[peer01]
host=1.2.3.4
type=peer
context=nowhere
disallow=all
allow=alaw
allow=ulaw
canreinvite=no
dtmfmode=rfc2833
timerb=2000

Thank you!
Markus

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
 https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users

Re: [asterisk-users] Switched from Asterisk 1.8 to 13 - CDR ringtime now always zero

2019-01-07 Thread Joshua C. Colp
On Mon, Jan 7, 2019, at 3:04 AM, Stefan Viljoen wrote:
> Hi guys
> 
> A few months ago I upgraded most of my Asterisk servers to 13 from 1.8. 
> I've still got about 25% of my servers on 1.8.
> 
> I've since noticed that ringtime on Asterisk 13 - the time difference 
> between "start" and "answer" in the CDR record for any call, and 
> between "duration" and "billsec" - has completely disappeared. E. g. 
> the two times and two durations are now the same for all outgoing calls 
> made on Asterisk 13.
> 
> On 1.8 the time difference between "start" and "answer" and "duration" 
> and "billsec" was always my ring time - e. g. if I phone out to my 
> cellphone from one of my 1.8 servers, the amount of seconds the call 
> rings on my cell in my 1.8 instances is the difference between "start" 
> and "answer" in the 1.8-generated CDR record, and the difference 
> between "duration" and "billsec".
> 
> E. g. on 13, I see this (zero ringtime) for a call that I make to my 
> cellphone to test, with my cellphone ringing for at least 10 seconds 
> and ringing heard on the Yealink connected to the asterisk - e. g. 
> completely wrong:

This is the way it is supposed to work[1], but it ultimately depends on your 
dialplan. Are you using Local channels? Are you doing Answer in the dialplan? 
What is the complete flow?

[1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+12+CDR+Specification

-- 
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: www.digium.com & www.asterisk.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users