Summary:ASTERISK-07725: It is impossible for a multi-codec phone to talk to a multi-codec phone although both phone have a common codec.
Reporter:chankm (chankm)Labels:
Date Opened:2006-09-12 02:01:19Date Closed:2006-09-13 11:56:28
Versions:Frequency of
Environment:Attachments:( 0) codecnegotiationPatch
( 1) sip.conf
Description: sip1 (caller) <--> Asterisk <--> sip2 (callee)

sip1 supports only g729 and g711
sip2 supports only g711

In sip.conf

allow = g729
allow = g711

allow = g711

sip1 could not talk to sip2 because sip1's preferred codec is g729 while
sip2 preferred codec is g711.

In order to solve this problem, I have made modifications to the
sip_new(..) function in chan_sip.c to prevent Asterisk from selecting a
preferred codec. In sip.conf, canreinvite has to be configured to "yes" for both sip1 and sip2.

sip1 was able to talk to sip2 after the patch and sip.conf is used.

The patch file "patchforCodec" for chan_sip.c is attached. I am using Asterisk- from bristuff-0.3.0-Pre-1q.
The patch also works for situations where a multi-codec phone wants to talk    to another multi-codec phone.  

Comments:By: Denis Smirnov (mithraen) 2006-09-12 02:56:49

1. Please, recreate this patch with last svn trunk (not 1.2), because new features cannot be added to 1.2

2. Create patch with diff -u option (unified diff format)

3. If you want that this patch would be included in Asterisk, you need sign and send disclaimer to Digium.

0. Please, read http://www.digium.com/bugguidelines.html

By: chankm (chankm) 2006-09-12 03:34:10

I have attached the patch created using the last svn trunk.

By: Denis Smirnov (mithraen) 2006-09-12 05:43:08

Ok, thanks. What about disclaimer? ;)

By: chankm (chankm) 2006-09-12 21:07:51

i would not want my code to be included in Asterisk. i guess
I do not need to have any disclaimer ?

By: Denis Smirnov (mithraen) 2006-09-12 21:25:48

You need disclaim your code if you want that any of committers review this code, or this code can be included to Asterisk.

By: Serge Vecher (serge-v) 2006-09-13 11:56:27

>i would not want my code to be included in Asterisk.
Ok, so what is it that you want then? If you do not want your code to be considered for merging into the Asterisk tree, then please do not post your patches on the bug-tracker.

The scenario that you describe works in many installations. To proceed with this issue, you need to read and follow the bug guidelines:
a. Issue needs to be reproduced with latest asterisk release, which is currently, not
b. Issues needs to be reproduced with *unmodified* Asterisk sources from the tarball, meaning that you have to show that this is reproducible without the bristuff patches.
c. Once the above 2 conditions are met, you need to follow these instructions to produce the required SIP debug trace of the failing dialog.
d. Once you have the information available, please reopen the issue with the debug information attached.

1) Prepare test environment (reduce the ammount of unrelated traffic on the server);
2) Make sure your logger.conf has the following line:
  console => notice,warning,error,debug
3) restart Asterik.
4) Enable SIP transaction logging with the following CLI commands:
set debug 4
set verbose 4
sip debug
5) Save complete console log to file and _attach_ said file to the bug.