* You are viewing the archive for August 18th, 2012

Graceful Restart

Hello,

Is there a way to detect, via cli or any other way, that Asterisk is in “graceful shutdown” mode, not accepting any new calls? Or to put the question a different way, how can I know that Asterisk has restarted again after the command “core restart graceful” in an automated way?


Best regards, Jan Blom

Asterisk Tries Reinvite When Incompatible Codecs On Call Legs

Hi,

I just ran into what seems to be an issue on re-invites. I’m not sure if it’s a bug or as designed, so I thought I’d ask the question.

Here’s my setup:
- Asterisk 1.8.13.0
- Phone A: Polycom ip331, only allowed to use ulaw, canreinvite=yes
- Phone B: Polycom ip330, only allowed to use alaw, canreinvite=yes

Phone A calls the extension of phone B.

After the normal call setup asterisk tries the reinvite:
- To phone B it sends an SDP which asks alaw and connection information of phone A
- To phone A it sends and SDP with only the connection information of phone B

Phone A responds to this with a 488 Not acceptable here.

Asterisk ACK’s and sends another set of reinvites to both phones with the correct codecs and connection information (the asterisk box itself).

Both phones reply 200 OK. Asterisk ACK‘s and immediately sends BYE to both phones.

Is this normal behaviour? I would expect one of two things:
- Asterisk intelligently does not even try reinvite because of the incompatible codecs.
- Asterisk tries the reinvite anyway, but does not end the call if it fails.

To be sure, I also tested this on asterisk 1.8.15.0 and certified-asterisk-1.8.11-cert4. Both have the same result.

Any help would be very appreciated!

Cheers,

Frederic Van Espen

Make Outgoing Calls Through BroadWorks/BroadSoft SIP Gateway From Asterisk

I’ve been given a SIP hard phone pre-configured to work with another party’s BroadWorks system. I want to use my Asterisk system to connect to this SIP service rather than the handset I’ve been given. I have extracted the authentication details from the phone and have successfully registered Asterisk with the gateway (incoming calls work fine) using a line like this in sip.conf:

register => 441000123123@auth.realm:password:authuser@nnn.nnn.nnn.nnn/441000123123

Outgoing calls are proving to be more challenging. I have this so far:

[441000123123]
callerid=”My Name” <441000123123>
type=peer host=nnn.nnn.nnn.nnn auth=authuser realm=auth.realm fromuser= 441000123123
secret=password insecure=invite context=from-sip nat=yes qualify=no canreinvite=no allow=all

The main part I’m confused about is that in most examples I’ve seen, the username and authname are the same value, whereas in this case we seem to have:

A username (the phone number)
An auth name (a different value)
An auth realm A SIP realm (different value to auth realm)
A password A gateway host

When I place a call with Dial(SIP/441000123123/somenumber), I get a 403 response from the gateway. Looking at a packet dump, I can see that Asterisk is not attempting to authenticate. On the other hand, REGISTER requests do authenticate successfully – I can see the digest authentication taking place in tcpdump.

I have observed successful outgoing calls from the hard phone using tcpdump and I can see the phone using digest like so:

Authorization: DIGEST username=”authuser”, realm=”BroadWorks”, nonce=”BroadWorksASHORTHASH”, qop=auth, cnonce=”ASHORTHASH”, nc000001, uri=”sip:number@auth.realm:5060;user=phone”, response=”ALONGERHASH”, algorithm=MD5

What is the correct configuration to use – how do I get Asterisk to successfully authenticate outgoing calls?

Many thanks, James.