[Home]

Summary:ASTERISK-15153: ChanSpy Whisper not working properly when peer has VAD and CNG on.
Reporter:Kevin Cao (crackbabie)Labels:
Date Opened:2009-11-17 12:32:03.000-0600Date Closed:2015-03-15 14:26:44
Priority:MinorRegression?No
Status:Closed/CompleteComponents:Applications/app_chanspy
Versions:Frequency of
Occurrence
Related
Issues:
is duplicated byASTERISK-24397 Audiohooks require constant media flow for whispering
Environment:Attachments:
Description:when I use a SIP provider with VAD/CNG that is always ON. firt of all I get this in the CLI:

rtp.c:831 process_rfc3389: Comfort noise support incomplete in Asterisk (RFC 3389). Please turn off on client if possible. Client IP: 0.0.0.0

which is normal and the call would work fine.

the strange thing is when I ChanSpy on the call.
A(Sping)
B(Spied)
C(Person on the other end of the peer.)

A can hear B and C
B can only hear A if C is not silent

so it feels to me that in order for B to hear A there must be audio coming from C for asterisk to mix it in with A's audio.
Comments:By: Leif Madsen (lmadsen) 2009-11-18 10:08:43.000-0600

Could you please provide some additional information such as:

* console output when this happens
* dialplan configuration
* sip debugging and history as per the bug guidelines

Thanks!

By: Kevin Cao (crackbabie) 2009-11-18 11:06:18.000-0600

CONSOLE OUTPUT:

-- Executing [1234567890@OUTGOING_CONTEXT:1] Macro("SIP/8000-00000000", "trunkdial|SIP/SIPProvider1/1235467890|SIP/SIPProvider2/1234567890|SIPProvider1|SIPProvider2") in new stack
   -- Executing [s@macro-trunkdial:1] GotoIf("SIP/8000-00000000", "0?2:4") in new stack
   -- Goto (macro-trunkdial,s,4)
   -- Executing [s@macro-trunkdial:4] Set("SIP/8000-00000000", "CALLERID(all)=CID NAME<8000>") in new stack
   -- Executing [s@macro-trunkdial:5] Goto("SIP/8000-00000000", "1-dial|1") in new stack
   -- Goto (macro-trunkdial,1-dial,1)
   -- Executing [1-dial@macro-trunkdial:1] Dial("SIP/8000-00000000", "SIP/SIPProvider1/1234567890") in new stack
   -- Called SIPProvider1/123546890
   -- SIP/SIPProvider1-00000001 is making progress passing it to SIP/8000-00000000
[Nov 18 11:30:54] NOTICE[6109]: rtp.c:831 process_rfc3389: Comfort noise support incomplete in Asterisk (RFC 3389). Please turn off on client if possible. Client IP: 204.8.108.60
   -- SIP/SIPProvider1-00000001 answered SIP/8000-00000000
   -- Executing [007@ChanSPY_CONTEXT:1] Goto("SIP/9000-00000002", "SPY|s|1") in new stack
   -- Goto (SPY,s,1)
   -- Executing [s@SPY:1] NoOp("SIP/9000-00000002", "007") in new stack
   -- Executing [s@SPY:2] Read("SIP/9000-00000002", "SPYNUM|extension") in new stack
   -- <SIP/9000-00000002> Playing 'extension' (language 'en')
   -- Executing [s@SPY:3] ChanSpy("SIP/9000-00000002", "SIP/8000|qw") in new stack
 == Spying on channel SIP/8000-00000000
[Nov 18 11:31:30] NOTICE[6110]: app_chanspy.c:218 start_spying: Attaching SIP/9000-00000002 to SIP/8000-00000000
[Nov 18 11:31:30] NOTICE[6110]: app_chanspy.c:218 start_spying: Attaching SIP/9000-00000002 to SIP/8000-00000000
 == Done Spying on channel SIP/8000-00000000
 == Spawn extension (SPY, s, 3) exited non-zero on 'SIP/9000-00000002'
 == Spawn extension (macro-trunkdial, 1-dial, 1) exited non-zero on 'SIP/8000-00000000' in macro 'trunkdial'
 == Spawn extension (OUTGOING_CONTEXT, 1235468790, 1) exited non-zero on 'SIP/8000-00000000'

================================================================================

DIALPLAN

[ChanSPY_CONTEXT]
exten=007,1,Goto(SPY,s,1)

[SPY]
exten=s,1,NoOp(007)
exten=s,2,Read(SPYNUM,extension)
exten=s,3,ChanSpy(SIP/${SPYNUM},qw)

================================================================================

Everything works as it should. the only thing is that B(Spied ON) can not hear A(Spy) if C(Called Party) is silent.

When I try it with another SIP Provider with VAD disabled, B can hear A even if C is muted.

I know I can tell SIPProvider1 to just disable VAD. but they won't. and most cheap provider won't. cause they want to save on bandwidth.

By: Leif Madsen (lmadsen) 2009-11-18 12:11:01.000-0600

Do you have internal_timing=yes enabled in asterisk.conf?

(reference:  https://issues.asterisk.org/view.php?id=5374)

By: Kevin Cao (crackbabie) 2009-11-18 12:20:49.000-0600

Tryed both Yes and No, same result.

By: Leif Madsen (lmadsen) 2009-12-01 11:08:02.000-0600

I'm dropping the severity of this down to minor due to the complexity and the borderline feature request of this issue. We will continue to leave this open, but it is likely that a larger change needs to be implemented in order to resolve this correctly.

By: Kevin Cao (crackbabie) 2009-12-01 17:06:05.000-0600

I have tested with 1.6.1.10 and it has the same result.

By: Ronald Chan (loloski) 2009-12-01 22:52:16.000-0600

I think this issue can be considered as major since 90% of the time asterisk is being used on a call center setup, and 90% of the case VAD can't be simply disabled on telco side for the same reason bandwidth savings. This hold's true  all the time in my setup here in my country,

Provider here in the philippines whether small or large use this, yes they suck all the time but this how it is.

It's just IMHO.


Best regards,

Ronald



By: Leif Madsen (lmadsen) 2009-12-02 14:31:05.000-0600

The problem here is the way in which Asterisk handles media. There are many places in Asterisk that expect media at all times, so handling the VAD scearios where audio is not always being sent is non-trivial.

The status will remain at minor for now.

By: Kevin Cao (crackbabie) 2009-12-02 23:51:10.000-0600

more strange thing.

When a ChanSpy started before a call is placed.

B(spied on) can hear A(spy) upto the call is connected with C(called party)

so it works when it's not expecting audio from C(called party). but it stop working when it expect audio from C(called party) and there wasn't any.

I looked over the code in app_chanspy.c audiohook.c and slinfactory.c, everything looks fine there with audio frames. so next I have to take a real good look at rtp.c to see if I can find anything there.

it seem to me that when VAD is enabled on the provider Asterisk wasen't even getting any kind of frames when silence. it should be getting a CNG frame.

in rtp.c it have something to my tiny understanding that it takes a CNG frame and converts it into a blank audio frame. but then again CNG frame is not sent on a set time frame.

so maybe we can do something like this:
while we know the other end is still alive (with controll frames) and if we don't get any audio or CNG frame. we'll just generate and sent a blank frame into the audio flow and it should be handle correctly with all other apps in the stack.

so anyone out there with any pointers of where that happen in the sources would be very helpful.