[Home]

Summary:ASTERISK-12986: codecs settings does work only in device specific section
Reporter:pj (pj)Labels:
Date Opened:2008-10-29 15:51:23Date Closed:2008-12-12 11:14:09.000-0600
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Channels/chan_skinny
Versions:Frequency of
Occurrence
Related
Issues:
Environment:Attachments:( 0) codecs.diff
Description:disallow=all
allow=g729
doesn't work in [general] or [devices] or [lines] sections
it does work only in specific device config section


****** ADDITIONAL INFORMATION ******

[general]
dateformat=D-M-Y        
keepalive=25
disallow=all
allow=g729

[devices]
disallow=all
allow=g729

[PJ]
device=SEP000xxxx          ; 7920
;only here codecs settings has effect!
;disallow=all
;allow=g729
line => 324

[lines]
context=test
language=cz
nat=1
disallow=all
allow=g729

[324]
callerid="test" <111>
Comments:By: Damien Wedhorn (wedhorn) 2008-11-20 14:34:35.000-0600

Added patch.

Behaviour now is that general codec config flows to default_line and default_device. [devices] stuff amends default_device and similar for [lines]. These are copied to individual device and line as they are created.

Added confcapability and confprefs for the configured stuff which doesn't change as device and so on are connected. prefs are based on line prefs if they exist, else the device prefs are used (prefs identifies codec order).

By: pj (pj) 2008-11-29 14:31:17.000-0600

codecs.diff + Asterisk SVN-trunk-r159853
it seems, that it works, one thing, that can be confusing:
f I have codecs settings only under [devices], like:

[devices]
disallow=all
allow=g729

'skinny show line xxx' still shows ulaw/alaw:
Conf Codecs:      0xc (ulaw|alaw)
Neg Codecs:       0x0 (nothing)
Codec Order:      (g729:20)

imho, general codecs settings should be also displayed when issue 'skinny show settings'

By: Damien Wedhorn (wedhorn) 2008-11-29 14:40:57.000-0600

pj, as the codecs can be set for both lines and devices, the codecs is the two results &'d. So in the above config you've basically got lines (ulaw|alaw) and devices (g729). As there's no commonality the result is (nothing).

We could default to all for both lines and devices but then we could run into issues with g723. So, if you want to set codecs in devices, you should set lines to allow=all and vice versa.

I'll have a look at including in skinny show settings. How about 3 lines:

Codecs default line:   0xc (ulaw|alaw)
Codecs default device: 0x? (g729)
Codecs combined:       0x0 (nothing)

By: pj (pj) 2008-11-29 14:46:53.000-0600

I found some more important issue with this patch:
when I haven't any disallow/allow setting under [general] section,
I got following error, and hear no sound from phone headset (7920)

[Nov 29 21:38:01] ERROR[27046]: chan_skinny.c:5052 handle_open_receive_channel_ack_message: Open Receive Channel Failure

By: Damien Wedhorn (wedhorn) 2008-11-29 14:49:33.000-0600

Is the error with the codec configuration you specified above (which would fail as there are effectively _no_ codecs specified). Try adding allow=all to your lines section. If you still have errors, can you included the codec part of 'skinny show line xxx'.

By: pj (pj) 2008-11-29 15:00:49.000-0600

I think my config is correct:

[general]
no codecs settings

[devices]
disallow=all
allow=g729

[lines]
no codecs settings

With this config I got following output in show command:

skinny show device SEP000D2
Device Type: 7920
Conf Codecs:0x100 (g729)
Neg Codecs: 0x100 (g729)
Registered:  Yes
Lines:       1
 324 ()


skinny show line 324
Conf Codecs:      0xc (ulaw|alaw)
Neg Codecs:       0x0 (nothing)
Codec Order:      (g729:20)

it seems, that chan_skinny knows, which codec to use, but when try to call, I got error Open Receive Channel Failure



By: Damien Wedhorn (wedhorn) 2008-11-29 15:08:06.000-0600

Nope, the Neg (for Negotiated) Codecs indicate that you have no codecs for a call. If you don't specify codecs, the default is (alaw|ulaw) for lines, and the same for devices. Because you haven't changed the line stuff, it is still (alaw|ulaw) while your device stuff is (g729).

When the device registers, it sends a message of codecs which is likely (ulaw|alaw|g723|g729), this is check against the devices settings (g729) which results in (g729).

It is then checked against the lines codecs (ulaw|alaw) which results in (nothing).

Add the line allow=all to you lines section, or allow=g729. Either way, you will only be able to use g729.

Codec negotiation:
(ulaw|alaw) & (ulaw) => (ulaw)
(ulaw|alaw) & (g729) => (nothing)
(all) & (g729) => (g729)
(g729) & (g729) => (g729)

By: pj (pj) 2008-11-29 15:17:29.000-0600

OK, I thought differently about this, I think, that if I don't specify codecs in [lines], codecs settings will be simply inherited from [devices]
if I try config you suggests, it works.

By: pj (pj) 2008-11-29 15:28:40.000-0600

it's now imposible to have shared line?
ie. same linenumber configured on more than one device?

[Nov 29 22:24:23] NOTICE[27400]: chan_skinny.c:6476 config_device: Configuring skinny device PJ.
[Nov 29 22:24:23] NOTICE[27400]: chan_skinny.c:6476 config_device: Configuring skinny device PJ2.
[Nov 29 22:24:23] WARNING[27400]: chan_skinny.c:6353 config_parse_variables: Line 324 already used by PJ. Not connecting to PJ2.
[Nov 29 22:24:23] ERROR[27400]: chan_skinny.c:6501 config_device: A Skinny device must have at least one line!

By: Damien Wedhorn (wedhorn) 2008-11-29 15:40:11.000-0600

offtopic, but sort of. They were never actually shared lines. One line was 324@PJ and the other was 324@PJ2. From memory, if you specified dial(Skinny/324) it would reject the dialing with a message to the effect that it was 'ambiguous'.

Since http://bugs.digium.com/view.php?id=13412 was committed, lines are individually configurable, but must also have unique names. The mixing of devices and lines that happened before were limiting ongoing development.

You may want to have a look at the new skinny.conf.sample file.

By: Digium Subversion (svnbot) 2008-12-12 11:14:08.000-0600

Repository: asterisk
Revision: 163582

U   trunk/channels/chan_skinny.c

------------------------------------------------------------------------
r163582 | mvanbaak | 2008-12-12 11:14:08 -0600 (Fri, 12 Dec 2008) | 11 lines

Fix codec capability setup in chan_skinny

Behaviour now is that general codec config flows to default_line and default_device. [devices] stuff amends default_device and similar for [lines]. These are copied to individual device and line as they are created.
Added confcapability and confprefs for the configured stuff which doesn't change as device and so on are connected. prefs are based on line prefs if they exist, else the device prefs are used (prefs identifies codec order).

(closes issue ASTERISK-12986)
Reported by: pj
Patches:
     codecs.diff uploaded by wedhorn (license 30)
Tested by: pj and me

------------------------------------------------------------------------

http://svn.digium.com/view/asterisk?view=rev&revision=163582