Re: [asterisk-users] Update peer IP address

2015-03-30 Thread Sebastian Kemper
On Mon, Mar 30, 2015 at 06:31:46PM +0200, Daniel Heckl wrote:
> Hello
> 
> I use Asterisk 11 with FreePBX 12. Our SIP Provider is Telekom
> Germany. We have sometimes problems with incoming and outgoing calls.
> I hope I can explain it understandable.

Hello Daniel,

I'll find myself in the same situation a few weeks from now :-)

> 
> For example, Asterisk sends a REGISTER to 217.0.23.68 (tel.t-online.de
> ), the message is answered with OK and the
> peer is registered.
> 
> Usually INVITES comes now from this ip address. All works fine. But
> sometimes INVITES comes from an other IP address, for example
> 217.0.23.100. This request Asterisk responds with 401 Unauthorized.
> 
> In the next register procedure REGISTER are sent to the new ip address
> and answered also with OK. But qualify OPTIONS are continue be sent to
> the old ip address. Incoming and outgoing calls are canceled. Outgoing
> calls are answered with Forbidden.
> 
> Even if the REGISTER procedure works with the new ip address, the
> peers are connected with the old address.
> 
> Waiting doesn’t help, only a „sip reload“ update the ip address of the
> peer. 
> 
> What is the solution for this problem? How can asterisk update the
> peer?

I think the solution - for the inbound issue at least - could be to add
more hosts as a peer. Have a looks at this forum post:

http://www.ip-phone-forum.de/showthread.php?t=268787&p=1999371&viewfull=1#post1999371

The user used a template and than he added peers, each with its own IP
address. The provided list was last updated in 2014, though, so I assume
the provider in the meantime has added to that list.

It looks pretty tedious, though, I mean there could be dozens of IPs
you'd have to add. But I guess this is the way to go with Asterisk 11
and chan_sip.

The future looks brighter :-) I read that with pjsip, which I understand
is the replacement for chan_sip, you can have one peer entry and match
an IP range instead of a single host. That should tidy up the dialplan.

What I'm a little afraid of is the SIP provider using IPs out of a range
that they also use for other services. Maybe out of the same range they
hand out IPs to their customers. I guess we got to be careful :-)

Kind regards,
Sebastian

> The Asterisk is local behind a NAT with a firewall, following settings
> are used:
> 
> externhost with DynDNS stun with stun.t-online.de
>  nat=yes srvlookup=yes allowguest=no
> trustrpid=no insecure=invite qualify=yes
> 
> Thank you!  Daniel

> -- 
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
>http://www.asterisk.org/hello
> 
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users


-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] WaitForSilence NEVER detects silence

2015-03-30 Thread Mike A. Leonetti
I have a call server that runs on a few custom AGI scripts initiating 
calls and then managing the calls. I'm getting stuck on the detecting 
silence functions. I wanted to use the silence detecting as a quick 
method of substituting Answering Machine Detection.


However, whenever WaitForSilence is supposed to be detecting silence, it 
always just ends the interval whether or not there is actual silence. If 
I'm still talking, it will consider that as silence also.


My AEL dialplan associated with the calling is:

100 => {
Answer();
WaitForSilence(5000,2,60);
AGI(agi://127.0.0.1/playmessage,${CALLID});
AGI(agi://127.0.0.1/saytext,"Goodbye.");
Hangup();
}



And the CLI just outputs:

== Using SIP RTP CoS mark 5
> Channel SIP/twilio-006e was answered
-- Executing [100@makeCall:1] Answer("SIP/twilio-006e", "") in 
new stack
-- Executing [100@makeCall:2] 
WaitForSilence("SIP/twilio-006e", "5000,2,60") in new stack

-- Waiting 2 time(s) for 5000 ms silence with 60 timeout
-- Exiting with 5000ms silence >= 5000ms required
-- Exiting with 5000ms silence >= 5000ms required
-- Executing [100@makeCall:3] AGI("SIP/twilio-006e", 
"agi://127.0.0.1/playmessage,45") in new stack
-- Playing '/var/nam/data/outgoing/60' (escape_digits=#) 
(sample_offset 0)
> 0x7f2179cf7990 -- Probation passed - setting RTP source address 
to 54.172.61.251:18920
-- Playing '/var/nam/data/tts/9eccb3f2ed77972157becdfbbac7232c' 
(escape_digits=1#) (sample_offset 0)
-- AGI Script agi://127.0.0.1/playmessage 
completed, returning 4
== Spawn extension (makeCall, 100, 3) exited non-zero on 
'SIP/twilio-006e'



In my test above, it waits for 5 seconds of silence twice, but even if 
I'm talking for the 5 seconds it will still just figure that I'm being 
silent when I'm not.


I also tried using AMD to see if that would do a good job of detecting 
an answering machine, but it thinks that everything is a MACHINE.


I know Asterisk is knowledgeable abut detecting silence because I have 
another AGI script that uses the RECORD FILE command that will 
successfully record somebody's voice and stop recording when there is 5 
seconds of silence (which is what I set).


Is there a setting somewhere that I'm missing somewhere for a silence 
threshold for WaitForSilence or am I misunderstanding its use?


The Asterisk version is

Asterisk 11.7.0~dfsg-1ubuntu1


And it's Asterisk installed from an Ubuntu package.

Thanks so much!

--
Mike A. Leonetti
As warm as green tea


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


[asterisk-users] WaitForSilence NEVER detects silence,,Post

2015-03-30 Thread Mike A. Leonetti
I have a call server that runs on a few custom AGI scripts initiating 
calls and then managing the calls. I'm getting stuck on the detecting 
silence functions. I wanted to use the silence detecting as a quick 
method of substituting Answering Machine Detection.


However, whenever WaitForSilence is supposed to be detecting silence, it 
always just ends the interval whether or not there is actual silence. If 
I'm still talking, it will consider that as silence also.


My AEL dialplan associated with the calling is:

100 => {
Answer();
WaitForSilence(5000,2,60);
AGI(agi://127.0.0.1/playmessage,${CALLID});
AGI(agi://127.0.0.1/saytext,"Goodbye.");
Hangup();
}



And the CLI just outputs:

== Using SIP RTP CoS mark 5
> Channel SIP/twilio-006e was answered
-- Executing [100@makeCall:1] Answer("SIP/twilio-006e", "") in 
new stack
-- Executing [100@makeCall:2] 
WaitForSilence("SIP/twilio-006e", "5000,2,60") in new stack

-- Waiting 2 time(s) for 5000 ms silence with 60 timeout
-- Exiting with 5000ms silence >= 5000ms required
-- Exiting with 5000ms silence >= 5000ms required
-- Executing [100@makeCall:3] AGI("SIP/twilio-006e", 
"agi://127.0.0.1/playmessage,45") in new stack
-- Playing '/var/nam/data/outgoing/60' (escape_digits=#) 
(sample_offset 0)
> 0x7f2179cf7990 -- Probation passed - setting RTP source address 
to 54.172.61.251:18920
-- Playing '/var/nam/data/tts/9eccb3f2ed77972157becdfbbac7232c' 
(escape_digits=1#) (sample_offset 0)
-- AGI Script agi://127.0.0.1/playmessage 
completed, returning 4
== Spawn extension (makeCall, 100, 3) exited non-zero on 
'SIP/twilio-006e'



In my test above, it waits for 5 seconds of silence twice, but even if 
I'm talking for the 5 seconds it will still just figure that I'm being 
silent when I'm not.


I also tried using AMD to see if that would do a good job of detecting 
an answering machine, but it thinks that everything is a MACHINE.


I know Asterisk is knowledgeable abut detecting silence because I have 
another AGI script that uses the RECORD FILE command that will 
successfully record somebody's voice and stop recording when there is 5 
seconds of silence (which is what I set).


Is there a setting somewhere that I'm missing somewhere for a silence 
threshold for WaitForSilence or am I misunderstanding its use?


The Asterisk version is

Asterisk 11.7.0~dfsg-1ubuntu1


And it's Asterisk installed from an Ubuntu package.

Thanks so much!

--
Mike A. Leonetti
As warm as green tea


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


[asterisk-users] Update peer IP address

2015-03-30 Thread Daniel Heckl
Hello

I use Asterisk 11 with FreePBX 12. Our SIP Provider is Telekom Germany. We have 
sometimes problems with incoming and outgoing calls. I hope I can explain it 
understandable.

For example, Asterisk sends a REGISTER to 217.0.23.68 (tel.t-online.de 
), the message is answered with OK and the peer is 
registered.

Usually INVITES comes now from this ip address. All works fine. But sometimes 
INVITES comes from an other IP address, for example 217.0.23.100. This request 
Asterisk responds with 401 Unauthorized.

In the next register procedure REGISTER are sent to the new ip address and 
answered also with OK. But qualify OPTIONS are continue be sent to the old ip 
address. Incoming and outgoing calls are canceled. Outgoing calls are answered 
with Forbidden.

Even if the REGISTER procedure works with the new ip address, the peers are 
connected with the old address.

Waiting doesn’t help, only a „sip reload“ update the ip address of the peer. 

What is the solution for this problem? How can asterisk update the peer?

The Asterisk is local behind a NAT with a firewall, following settings are used:

externhost with DynDNS
stun with stun.t-online.de 
nat=yes
srvlookup=yes
allowguest=no
trustrpid=no
insecure=invite
qualify=yes

Thank you!
Daniel-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] How does chan_sip match an ACK?

2015-03-30 Thread Tony Mountifield
I am trying to debug a SIP issue, between an Asterisk 1.2.32 system that
is behind a network device to which I don't have ready access, which is
performing NAT with possibly some kind of SIP ALG, and an Asterisk 11
system on a public IP.

My question is very specific, and I don't need right now to discuss the
ins and outs of the above setup.

What I am seeing is that when I have set up a call from the Asterisk 11
system, the 1.2.32 system is sending 200 OK, and sip debug shows the
ACK response coming back from the Asterisk 11 box. However, the ACK
appears not to be understood, because the 200 OK gets re-sent, multiple
times, and eventually gives up.

My specific question is, what values in the ACK does chan_sip (1.2.32)
use to match the ACK with the pending 200 OK? My understanding of the
chan_sip.c code is not good enough to work it out for certain.

Here is the 200 OK (I've changed the address of the public endpoint):

Mar 30 10:20:20 VERBOSE[5811] logger.c: Retransmitting #5 (no NAT) to 
11.111.11.111:5060:
SIP/2.0 200 OK
Via: SIP/2.0/UDP 
11.111.11.111:5060;branch=z9hG4bK6bee4b53;received=11.111.11.111
From: "Tony Mountifield" ;tag=as4ab948f7
To: ;tag=as76e64309
Call-ID: 21bf5fa61b5e98880b96448118310bf7@11.111.11.111:5060
CSeq: 102 INVITE
User-Agent: Asterisk PBX
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY
Contact: 
Content-Type: application/sdp
Content-Length: 218

v=0
o=root 5732 5732 IN IP4 172.16.141.143
s=session
c=IN IP4 172.16.141.143
t=0 0
m=audio 16282 RTP/AVP 0 101
a=rtpmap:0 PCMU/8000
a=rtpmap:101 telephone-event/8000
a=fmtp:101 0-16
a=silenceSupp:off - - - -

And here is the ACK in reply that is not getting understood:

<-- SIP read from 11.111.11.111:5060:
ACK sip:12345@172.16.141.143 SIP/2.0
Via: SIP/2.0/UDP 11.111.11.111:5060;branch=z9hG4bK36651b68
Max-Forwards: 70
From: "Tony Mountifield" ;tag=as4ab948f7
To: ;tag=as76e64309
Contact: 
Call-ID: 21bf5fa61b5e98880b96448118310bf7@11.111.11.111:5060
CSeq: 102 ACK
User-Agent: Asterisk PBX 11.5.0
Content-Length: 0

So what is it about the ACK that is wrong?

Thanks for any help!

Cheers
Tony
-- 
Tony Mountifield
Work: t...@softins.co.uk - http://www.softins.co.uk
Play: t...@mountifield.org - http://tony.mountifield.org

-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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