[DIAL+MACRO] - Problems running macro with Dial

Dear ,
I have the need to use the Answering Machine Detection, but am having the following problems :

I have a context that has several include that after the Dial has a macro that will call the AMD . However, only works in the first context , if rota_1 to other context the macro is not executed .
The list would help to solve this problem .

1.8.11.0 Asterisk ( Elastix )

Follow my context :

[contexto-amd]
include => rota_1
include => rota_2
include => rota_3
include => rota_4
include => rota_5
include => rota_6
include => rota_7
include => rota_8
include => rota_9
include => rota_10
include => rota_11

[rota_1]
exten => _1X.,1,NoOp(rota_1)
exten => _1X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _1X.,n,Hangup

[rota_2]
exten => _2X.,1,NoOp(rota_2)
exten => _2X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _2X.,n,Hangup

[rota_3]
exten => _3X.,1,NoOp(rota_3)
exten => _3X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _3X.,n,Hangup

[rota_4]
exten => _4X.,1,NoOp(rota_4)
exten => _4X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _4X.,n,Hangup

[rota_5]
exten => _5X.,1,NoOp(rota_5)
exten => _5X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _5X.,n,Hangup

[rota_6]
exten => _6X.,1,NoOp(rota_6)
exten => _6X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _6X.,n,Hangup

[rota_7]
exten => _7X.,1,NoOp(rota_7)
exten => _7X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _7X.,n,Hangup

[rota_8]
exten => _8X.,1,NoOp(rota_8)
exten => _8X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _8X.,n,Hangup

[rota_9]
exten => _9X.,1,NoOp(rota_9)
exten => _9X.,n,Dial(sip/tr_vono/${EXTEN:1},60,M(analisechamada))
exten => _9X.,n,Hangup

[rota_10]
exten => _10X.,1,NoOp(rota_10)
exten => _10X.,n,Dial(sip/tr_vono/${EXTEN:2},60,M(analisechamada))
exten => _10X.,n,Hangup

[rota_11]
exten => _11X.,1,NoOp(rota_11)
exten => _11X.,n,Dial(sip/tr_vono/${EXTEN:2},60,M(analisechamada))
exten => _11X.,n,Hangup

[macro-analisechamada]
exten => s,1,AMD(2500|1500|300|5000|120|50|4|384)
exten => s,n,GotoIf($[${AMDSTATUS}=HUMAN]?humn:mach)
exten => s,n(mach),NoOp(Voz De Maquina)
exten => s,n,WaitForSilence(2500)
exten => s,n,Hangup
exten => s,n(humn),NoOp(Voz De Humano)
exten => s,n,WaitForSilence(500)
exten => s,n,Answer
exten => s,n,Hangup

Thank you ,
PS: Sorry for bad English

Ivan Paes José

Dear ,

Performed collection of SIP signaling exchange my asterisk box with my VoIP provider , I realized that when hard for the company 's mobile comes Rota_1 signaling 183 , as the mobile is off occurs voice message informing the operator that mobile off and the message is 200 , that the application before AMD goes into operation , as follows:

Picture collection of packages:

https://www.dropbox.com/s/souqmcku42z2yv0/chamada_AMD_ok.png

Log fragment co CLi Asterisk :

- Called sip/tr_vono/04884091055
- SIP/tr_vono-00000018 is making progress passing it to Local/04884091055@ context - amd- 00000004 ; 2
- @ Local/04884091055context - amd- 00000004 , 1 is making progress passing it to SIP/6000-00000016
- Answered SIP/tr_vono-00000018 Local/04884091055@ context - amd- 00000004 ; 2
- Executing [ s @ macro - analisechamada : 1 ] AMD ( " SIP/tr_vono-00000018 " , " " ) in new stack
- AMD : SIP/tr_vono-00000018 ( N / A) 04,884,291,055 ( Fmt : slin )
- AMD : initialSilence [ 2500 ] greeting [ 1500] afterGreetingSilence [ 800 ] totalAnalysisTime [ 5000 ] minimumWordLength [ 100 ] betweenWordsSilence [ 50 ] maximumNumberOfWords [ 3 ] silenceThreshold [ 256 ] maximumWordLength [ 5000 ]
- AMD : Channel [ SIP/tr_vono-00000018 ] . Changed state to STATE_IN_SILENCE
- AMD : Channel [ SIP/tr_vono-00000018 ] . Answering Machine : silenceDuration : 2500 initialSilence : 2500
- Executing [ s @ macro - analisechamada : 2 ] GotoIf ( " SIP/tr_vono-00000018 " , " 0 ? Humn : mach " ) in new stack
- Goto (macro analisechamada s, 3 )
- Executing [ s @ macro - analisechamada : 3 ] NoOp ( " SIP/tr_vono-00000018 " , " Voice Of Machine " ) in new stack
- Executing [ s @ macro - analisechamada : 4 ] Hangup ( " SIP/tr_vono-00000018 " , " " ) in new stack

== Spawn extension ( macro - analisechamada , s , 4 ) exited non - zero on ’ SIP/tr_vono-00000018 ’ in macro ’ analisechamada '
== Spawn extension (context - amd , 04884091055 , 2 ) exited non - zero on ’ Local/04896039084@ context - amd- 00000004 ; 2 '
- No one is available to answer at this time ( 1:0 / 0 / 0 )
- Executing [ 104884091055 @ default: 2 ] Hangup ( " SIP/6000-00000016 " , " " ) in new stack
== Spawn extension (default , 104884091055, 2 ) exited non - zero on ’ SIP/6000-00000016 ’

When held call to another mobile from another mobile phone company has the message 183 , but there comes the 200 and RTP packets . With that asterisk has not received the attention has not gone to AMD do voice analysis .

Picture collection of packages:

https://www.dropbox.com/s/m68vrkk2mcfdejs/chamada_nao_ok.png

Log fragment co Asterisk CLI :

 - Called sip/tr_vono/04896039084
- SIP/tr_vono-0000001e is making progress passing it to Local/04896039084@ context - amd- 00000006 ; 2
- @ Local/04896039084context - amd- 00000006 , 1 is making progress passing it to SIP/6000-0000001c

== Spawn extension (default , 204896039084, 1 ) exited non - zero on ’ SIP/6000-0000001c '
== Spawn extension (context - amd , 04896039084, 2 ) exited non - zero on ’ Local/04896039084@ context - amd- 00000006 ; 2 ’

Therefore , I believe that to be a problem with the application but AMD signaling that the VoIP provider gives me .
With This I closed this "problem " .

Thank you.

Ivan Paes José