MixMonitor not creating files

Hi, I want every call to be recorded in *wav format. I wrote a dialaplan adding MixMonitor to every extension. However MixMonitor bahaves in a way that I don’t understand. Below is an example from my dialplan and CLI log. In this case the *wav file is not beeing created. I am sure it is not file permissions related problem.
In another case, a call between Twinkle and Linphone the *wav file is created when I call from Twinkle to Linphone, but not when I call from Linphone to Twinkle. Similar story with calls placed 3G dongle <-> Twinkle.

Can anyone shine some light as why in the xample below the *wav file is not being created?

I suspect that MixMonitor triggers when channel is bridged but in some cases it just doesn’t know about that. My Twinkle and Linphone are configured to go after ports 5066 and 5067 respectively.
So is there a way to tell MixMonitor where to look for the channel being bridged?

I also have problems with one way audio when making calls to/from 3G dongle and I also suspect it can be related to ports configured this way.

-- Executing [111@sip-local:2] Set("SIP/2102-00000000", "MONITOR_FILENAME=/tmp/20140510-132911-FROM-2102-TO-111") in new stack -- Executing [111@sip-local:3] MixMonitor("SIP/2102-00000000", "/tmp/20140510-132911-FROM-2102-TO-111.wav,bW(4)") in new stack == Begin MixMonitor Recording SIP/2102-00000000 -- Executing [111@sip-local:4] Playback("SIP/2102-00000000", "hello-world") in new stack -- <SIP/2102-00000000> Playing 'hello-world.gsm' (language 'en') -- Executing [111@sip-local:5] StopMixMonitor("SIP/2102-00000000", "") in new stack -- Executing [111@sip-local:6] Hangup("SIP/2102-00000000", "") in new stack

exten => 111,1,NoOp() ;A hello world if you dial 111 same => n,Set(MONITOR_FILENAME=/tmp/${STRFTIME(${EPOCH},,%Y%m%d-%H%M%S)}-FROM-${CALLERID(num)}-TO-${EXTEN}) same => n,MixMonitor(${MONITOR_FILENAME}.wav,ab) ;same => n,Answer() same => n,Playback(hello-world) same => n,StopMixMonitor() same => n,Hangup()

Audio hooks have no concept of SIP constructs, like port numbers. They work on the technology independent media frames in the core of Asterisk.

I can’t remember if the MixMonitor application requires channels to be bridged, but there are no channels being bridged in your dialplan fragment.

From Asterisk help about MixMonitor I read that option “b - Only save audio to the file while the channel is bridged. does not include conferences”. And indeed, if I delete this option from the MixMonitor line, I see that the *wav files are being created.
If you say that the channels are not being bridged in my dialplan then why the wav files are not being created if option “b” is included?
How to debug one way audio? Can it have anything to do with ports being used by sip phones? Twinkle and Lipnhone have an option bindport=5066/5067 in sip.conf.

Read the definition of the option carefully.

Also, I’ve already told you that MixMonitor is not aware of SIP constructs, like ports.