Summary:ASTERISK-07511: no audio after returning from a dial command executed though AGI
Reporter:Vadim Berezniker (kryptolus)Labels:
Date Opened:2006-08-10 15:11:16Date Closed:2006-09-01 12:41:02
Versions:Frequency of
Environment:Attachments:( 0) full1
( 1) full2
Description:Here's the scenario

User1 calls a number which is directed to an FAGI script
FAGI plays a file and executes a Dial to some other number (via SIP)
The peer hangs up, control returns to FAGI script.
FAGI script plays another file, but this time the file is not heard by the caller. They only hear silence at this point.

It works properly in 1.2.9 but is broken in 1.2.10
To be more specific, it was "broken" by revision 34306 which is:

--- channels/chan_sip.c (revision 34274)
+++ channels/chan_sip.c (revision 34306)
@@ -12911,7 +12911,7 @@
               memset(&p->vredirip, 0, sizeof(p->vredirip));
       p->redircodecs = codecs;
-       if (!ast_test_flag(p, SIP_GOTREFER)) {
+       if (codecs && !ast_test_flag(p, SIP_GOTREFER)) {
               if (!p->pendinginvite) {
                       if (option_debug > 2) {
                               char iabuf[INET_ADDRSTRLEN];

I don't think a sip log is needed, but I'm attaching one anyway to escape from the karma police.
Comments:By: Serge Vecher (serge-v) 2006-08-10 15:37:29

just in case, what does a sip debug log look like with that change reverted?

By: Vadim Berezniker (kryptolus) 2006-08-10 15:42:56

full2 is log with patch reverted

By: Serge Vecher (serge-v) 2006-08-10 15:58:50

thanks, please attach logs uncompressed for easy of review.

By: phsultan (phsultan) 2006-08-30 15:21:55

kryptolus: I was not able to reproduce the problem with both trunk and branch-1.2.

My setup :
- user 1 (Cisco 7960 SIP phone) calls 9999
- 9999 matches the following in extensions.conf :
 exten => 9999,1,Answer()
 exten => 9999,2,agi(test.agi)
 exten => 9999,3,Hangup()
- AGI script streams the 'beep' file
- AGI script calls user2 (Cisco 7960 SIP phone) at 8888
- both users are able to talk to each other
- user2 hangs up
- AGI script streams the 'demo-instruct' file, heard by user1

user1 and user2 are configured as friends in sip.conf, no NAT, and canreinvite=yes. Both the corresponding phones and Asterisk stay in the same VLAN.

However, I noticed two strange things :
- the very first seconds of the secondly streamed file are not heard by user1
- with the ASTERISK-7106 patch removed, an explicit RE-INVITE is sent to user1, then the latter point does not apply

The content of your debug files suggest you're in a NAT environment. Are you able to disable native bridging (canreinvite=no) and/or NAT? Maybe also try to check that the RTP traffic issued by Asterisk when playing the second file is not blocked at some point of the network.

Sorry about filing a patch that messed your setup, as well as others (cf ASTERISK-7242) ;)

By: Vadim Berezniker (kryptolus) 2006-08-30 21:21:06

I will see what I can do with regards to testing. I have some other things I need to take care first.

By: Kevin P. Fleming (kpfleming) 2006-09-01 12:41:02

This should be fixed with the patch just committted; in the future, when you know the breakage was caused by a patch put in to solve an issue in the issue tracker, please request that issue to be reopened rather than opening a new one.