Summary:ASTERISK-08335: REFER not working with Cisco hardware when doing local attended call transfer
Reporter:slabber (slabber)Labels:
Date Opened:2006-12-12 03:11:23.000-0600Date Closed:2007-01-12 12:42:18.000-0600
Versions:Frequency of
Environment:Attachments:( 0) debug.tar.gz
( 1) outputclean.txt
( 2) verbosedebug.txt.1
Description:Local attended transfer not working since upgrade to 1.4beta3 - probably related to commit 31274 in chan_sip.c.  It appears that when I try a transfer, asterisk regards the call from the transferer to Asterisk not in state AST_STATE_RING and therefore exits with 'Error: No target channel'.


I've attached a SIP trace, debug and messages files.  Note that in context, I called ext 9105 from 9065.  On 9105 I answer then press transfer which places 9065 on hold.  I then dial 9017 from 9105 and when it starts ringing I press 'Transfer' which generates the sip REFER I think.

This is for 1.4beta3 and also reproduced in SVN-trunk-r48389
Comments:By: Serge Vecher (serge-v) 2006-12-12 08:55:18.000-0600

Can you please redo the debug as per following:?

1) Prepare test environment (reduce the amount of unrelated traffic on the server);
2) Make sure your logger.conf has the following line:
  console => notice,warning,error,debug
3) restart Asterisk with the following command:
  'asterisk -Tvvvvvdddddgc | tee /tmp/verbosedebug.txt'
4) Enable SIP transaction logging with the following CLI commands:
set debug 4
set verbose 4
sip debug
5) Trim startup information and attach verbosedebug.txt to the issue.

By: slabber (slabber) 2006-12-12 09:26:43.000-0600

Doing as requested now crashes Asterisk.  I've posted the verbosedebug.txt and a core file.

By: slabber (slabber) 2006-12-12 09:31:01.000-0600

Actually, ignore that - that trace was with a few lines of code commented out... my bad ;-)

By: slabber (slabber) 2006-12-12 09:41:08.000-0600

OK, now I'm back to the original behaviour after compiling a clean version.  Debug file is now verbosedebug.txt.1

By: Serge Vecher (serge-v) 2006-12-12 09:42:29.000-0600

ok, we can't use the core file from your system. You will need to make a backtrace as per following:


1. Enable DONT_OPTIMIZE flag in menuselect under Compiler Options.
2. Rebuild Asterisk
3. Start Asterisk with '-g' option
4. When crash occurs, perform 'bt' on the core file. Then 'thread apply all bt full'

Let's see the new output. Thanks.

By: slabber (slabber) 2006-12-12 09:47:52.000-0600

Sorry, just to reiterate.. the crash was caused by modifications that I made to the code.  Now there is no crash so no core file.

By: Serge Vecher (serge-v) 2006-12-12 10:02:13.000-0600

slabber, thanks. There should be enough information now for the maintainer of chan_sip to analyze.

By: Anthony LaMantia (alamantia) 2006-12-15 19:25:49.000-0600

slabber, do you have a debug log with readable text?

By: Anthony LaMantia (alamantia) 2006-12-16 03:08:35.000-0600

it looks like you are copying a lot of escape characters from the console output,
which is what is causing your paste to be so un-readable.
maybe if you run asterisk as you were before but add the -n flag to the command line it will resolve your problem,

you can also maybe just ensure logger.conf is setup to log all messages and use the output in /var/log/asterisk/messages

By: slabber (slabber) 2006-12-18 02:51:56.000-0600

try the new outputclean.txt - I've removed all the colour escape sequences with sed.  You can view the old one with 'less' or 'cat' from the command line to retain the colour information if you find it easier.

By: Joshua C. Colp (jcolp) 2007-01-09 23:23:37.000-0600

Two things:

1. The Cisco allows you to complete an attended transfer while the remote side is ringing? Fun.

2. I noticed that your MWI wasn't working via the sip debug. If you grab the latest SVN copy of what you are using and set the buggymwi option to yes in sip.conf it should work again.

By: Joshua C. Colp (jcolp) 2007-01-10 23:57:25.000-0600

Please give 1.4 as of revision 50468 a try. Thanks!

By: slabber (slabber) 2007-01-12 07:13:31.000-0600

I've had to backport the changes to chan_sip.c to the 1.4.0 release because something has seriously broken my res_config_ldap which I need to look into.  The changes have fixed my problem with SIP transfers so I guess this bug is resolved and I'll start a new one for the res_config_ldap problems if I can't figure it out.

Thanks for the tip on the MWI, I've been following this for a while but just haven't had a chance to try it - theres also a note in the most recent Cisco firmware version to suggest that they have also fixed this problem!

By: Joshua C. Colp (jcolp) 2007-01-12 12:29:31.000-0600

Fixed in 1.4 as of revision 50468 and trunk as of revision 50469. Peace!

By: Serge Vecher (serge-v) 2007-01-12 12:42:18.000-0600


1) res_config_ldap is not part of the tree [yet], so post any breakage in bug ASTERISK-5620 directly.
2) if you have successfully tested new Cisco firmware to not exhibit the buggy mwi problem, feel free to ask one of the bug-marshals on #asterisk-bugs irc channel to reopen bug ASTERISK-8339 and report your findings there. The patch that was introduced there was a bit of a hack and we'd be happy to remove it...