[asterisk-users] [asterisk-dev] MixMonitor doesn't work right with SIP and Zap/Flash transfers

Atis Lezdins atis at iq-labs.net
Wed Jan 9 09:11:26 CST 2008


Vinicius Fontes wrote:
> Hey guys, I don't know if this is the right place to ask this. I was  
> thinking about reporting a bug, but maybe it's better to sort out if  
> this is really a bug or just me being lame.
> 
> I want to record *every* call in my Asterisk box, so I use the  
> MixMonitor() application like this is my extensions.conf:
> 
> exten => _0X.,1,Answer()
> exten => _0X.,n,MixMonitor(${CALLERID(num)}-${STRFTIME($ 
> {EPOCH},America/Sao_Paulo,%Y-%m-%d-%H-%M-%S)}-${EXTEN}.wav)
> exten => _0X.,n,Dial(IAX2/pabx-canall/${EXTEN},60,tT)
> 
> exten => _2XX,1,Answer() exten => _2XX,n,MixMonitor(${CALLERID(num)}-$ 
> {STRFTIME(${EPOCH},America/Sao_Paulo,%Y-%m-%d-%H-%M-%S)}-${EXTEN}.wav)  
> exten => _2XX,n,Dial(SIP/${EXTEN},60,tT)
> 
> The scenario is as following:
> 
> 1) 201 asks operator for an external call, hangs up. The audio file is  
> stored correctly. From the CLI:
> 
> [Jan 8 16:20:19] -- Executing [200 at default:1] Answer("SIP/ 
> 201-081d8740", "") in new stack
> [Jan 8 16:20:19] -- Executing [200 at default:2] MixMonitor("SIP/ 
> 201-081d8740", "201-2008-01-08-16-20-19-200.wav") in new stack
> [Jan 8 16:20:19] -- Executing [200 at default:3] Dial("SIP/201-081d8740",  
> "SIP/200|60|tT") in new stack
> [Jan 8 16:20:19] == Begin MixMonitor Recording SIP/201-081d8740
> [Jan 8 16:20:19] -- Called 200
> [Jan 8 16:20:19] -- SIP/200-081fac90 is ringing
> [Jan 8 16:20:23] -- SIP/200-081fac90 answered SIP/201-081d8740
> [Jan 8 16:20:27] == Spawn extension (default, 200, 3) exited non-zero  
> on 'SIP/201-081d8740'
> [Jan 8 16:20:27] == End MixMonitor Recording SIP/201-081d8740
> 
> 
> 
> 
> 2) 200 dials to the PSTN. So far so good.
> 
> [Jan 8 16:20:35] -- Executing [021047020 at default:1] Answer("SIP/ 
> 200-081d8740", "") in new stack
> [Jan 8 16:20:35] -- Executing [021047020 at default:2] MixMonitor("SIP/ 
> 200-081d8740", "200-2008-01-08-16-20-35-021047020.wav") in new stack
> [Jan 8 16:20:35] -- Executing [021047020 at default:3] Dial("SIP/ 
> 200-081d8740", "IAX2/pabx-canall/021047020|60|tT") in new stack
> [Jan 8 16:20:35] == Begin MixMonitor Recording SIP/200-081d8740
> [Jan 8 16:20:35] -- Called pabx-canall/021047020
> [Jan 8 16:20:35] -- Call accepted by 200.248.136.140 (format alaw)
> [Jan 8 16:20:35] -- Format for call is alaw [Jan 8 16:20:35] -- IAX2/ 
> pabx-canall-16384 answered SIP/200-081d8740
> 
> 
> 
> 
> 3) Extension 200 is a Polycom SoundPoint 301 IP phone. It presses the  
> Transfer button, putting 021047020 in hold and dialing to 201 who  
> answers the call:
> 
> [Jan 8 16:20:45] -- Started music on hold, class 'default', on IAX2/ 
> pabx-canall-16384
> [Jan 8 16:20:51] -- Executing [201 at default:1] Answer("SIP/ 
> 200-081fac90", "") in new stack
> [Jan 8 16:20:51] -- Executing [201 at default:2] MixMonitor("SIP/ 
> 200-081fac90", "200-2008-01-08-16-20-51-201.wav") in new stack
> [Jan 8 16:20:51] -- Executing [201 at default:3] Dial("SIP/200-081fac90",  
> "SIP/201|60|tT") in new stack
> [Jan 8 16:20:51] -- Called 201
> [Jan 8 16:20:51] == Begin MixMonitor Recording SIP/200-081fac90
> [Jan 8 16:20:51] -- SIP/201-081edf80 is ringing
> [Jan 8 16:20:54] -- SIP/201-081edf80 answered SIP/200-081fac90
> 
> 
> 
> 
> 4) The operator says "here's your call" to 201 and presses Transfer on  
> the phone once more. The call is transferred correctly, but:
> [Jan 8 16:20:57] -- Stopped music on hold on IAX2/pabx-canall-16384
> [Jan 8 16:20:57] == Spawn extension (default, 021047020, 3) exited non- 
> zero on 'SIP/200-081d8740'
> [Jan 8 16:20:57] == End MixMonitor Recording SIP/200-081d8740
> [Jan 8 16:20:57] == End MixMonitor Recording SIP/200-081fac90
> 
> 
> Notice that all the MixMonitor processes stopped!
> 
> 
> 
> 5) 201 finally hangs up the phone:
> 
> [Jan 8 16:21:45] == Spawn extension (default, 201, 3) exited non-zero  
> on 'IAX2/pabx-canall-16384'
> [Jan 8 16:21:45] -- Hungup 'IAX2/pabx-canall-16384'
> 
> 
> 
> So, all the audio regarding the important part -- the call to the PSTN  
> itself -- is simply lost.
> 
> I noticed that if I use Asterisk's built-in transfer features (atxfer,  
> blindxfer) everything works fine. Too bad the users are so used to  
> that Transfer button. I tried it using FXS channels and the FLASH  
> button on the phone, same results.
> 
> Is there any workaround for this? I'm running these from a separate  
> box so any procediment you guys could suggest will be tried as it is  
> not in production. I'm also willing to give you any information needed.

Make sure you have "canreinvite=no" for peers, that will ensure that RTP 
is always passed trough asterisk. Now your Polycom might send audio 
directly to other phone.

Btw, asterisk-dev is for development discussions, but this is 
configuration problem. If unsure, you should write to asterisk-users 
first (cross-posted there)

Regards,
Atis



More information about the asterisk-users mailing list