Balanceo de troncales en Elastix (round robin)

21 Jun

Este mini tutorial aplica para FreePBX/Trixbox/Elastix.

La idea tras de esta guía es crear un balanceador de carga. Es decir, tener una sola troncal que automáticamente rote una serie de troncales posibles por las cuales pueden salir las llamadas. Dichas troncales pueden ser DAHDI, IAX2 o SIP, así que esto le agrega flexibilidad.

El código sería algo así (la sintaxis está en AEL para hacer la programación más simple)

[codesyntax lang=”c” tab_width=”3″ blockstate=”expanded”]

// Archivo extensions.ael
context roundrobin {
	_X. => {
		Set(max=10);
		Set(n=0);
		repetir:
		Set(n=${n}+1);
		Set(last=$[(${DB(rr/last)}+1)%${max});
		Set(DB(rr/last)=${last});
		Dial(${DB(rr/trunk${last})}/${EXTEN},30,g);
		if (${DIALSTATUS}!="ANSWERED") {
			if (${n}<${max}) {
				// Repetir ciclo
				goto repetir;
			};
		};
		Hangup;
	};
};
[/codesyntax]

Nos faltan dos pasos:

  1. Inicializar el AstDB con el valor de la primer troncal. Esto es sencillo ejecutando el comando database put rr last 1 dentro del CLI de Asterisk
  2. El paso final es crear una troncal ‘Custom’ dentro de FreePBX/Elastix y agregarla como Local/{OUTNUM}@roundrobin/n. Esto hará uso del canal Local y nos permitirá balancear la carga entre nuestras troncales.

Todas las llamadas que vayan hacia esta troncal ‘Custom’ harán un balanceo de carga entre las lineas contratadas. Util si tienes varias lineas de diferentes proveedores y quieres que el consumo se haga equitativamente.

Suerte,

 

Christian Cabrera

Soy un ingenieron en comunicaciones con especial interés en el área de voz sobre IP y tecnologías sobre información. He usado Asterisk de manera diaria desde hace más de 12 años.En el 2011 co-fundé Enlaza Comunicaciones, una empresa que se especializa en brindar servicios profesionales de consultoría sobre voz sobre IP basadas en Asterisk.

  • Edgar

    Estimado Christian,
    Gracias por compartir tus conocimientos,
    Te comento segui tus instrucciones paso a paso sin lograr que me salieran las llamadas por el custom trunk, estoy usando 2 siptrunks en elastix 1.6.33.
    No se si debo colocar algo adicional en el custom trunk o a nivel de cli en el asterisk para que funcione.
    Saludos Y gracias

    • Edgar,

      Habría que ver donde falla el proceso. ¿Por que no creas un tema nuevo en los foros de discusión, pegas lo que ocurre en tu consola al momento de que generas la llamada y lo revisamos?

      Saludos,

  • Masterchilum

    pero y como sabe este custom trunk que troncales usar, o usa todos?
    e seguido los pasos pero no me hace la llamada. (lineas ocupadas)
    debo asignar a los troncales el contexto roundrobin que hemos añadido?
    y sino donde se pone en el troncal que balance por canal con los parametros r,R,G,g?
    todo lo que encuentro es de hace años y han cambiado hasta los nombres de archivos 😛
    gracias por tu guia

  • Jose Alberto Cid

    == Using SIP RTP TOS bits 184
    == Using SIP RTP CoS mark 5
    — Executing [0452231032598@from-internal:1] Macro(“SIP/400-000003b1”, “user-callerid,SKIPTTL,”) in new stack
    — Executing [s@macro-user-callerid:1] Set(“SIP/400-000003b1”, “AMPUSER=400”) in new stack
    — Executing [s@macro-user-callerid:2] GotoIf(“SIP/400-000003b1”, “0?report”) in new stack
    — Executing [s@macro-user-callerid:3] ExecIf(“SIP/400-000003b1”, “1?Set(REALCALLERIDNUM=400)”) in new stack
    — Executing [s@macro-user-callerid:4] Set(“SIP/400-000003b1”, “AMPUSER=400”) in new stack
    — Executing [s@macro-user-callerid:5] Set(“SIP/400-000003b1”, “AMPUSERCIDNAME=Ing Alberto”) in new stack
    — Executing [s@macro-user-callerid:6] GotoIf(“SIP/400-000003b1”, “0?report”) in new stack
    — Executing [s@macro-user-callerid:7] Set(“SIP/400-000003b1”, “AMPUSERCID=400”) in new stack
    — Executing [s@macro-user-callerid:8] Set(“SIP/400-000003b1”, “CALLERID(all)=”Ing Alberto” “) in new stack
    — Executing [s@macro-user-callerid:9] ExecIf(“SIP/400-000003b1”, “0?Set(CHANNEL(language)=)”) in new stack
    — Executing [s@macro-user-callerid:10] GotoIf(“SIP/400-000003b1”, “1?continue”) in new stack
    — Goto (macro-user-callerid,s,19)
    — Executing [s@macro-user-callerid:19] Set(“SIP/400-000003b1”, “CALLERID(number)=400”) in new stack
    — Executing [s@macro-user-callerid:20] Set(“SIP/400-000003b1”, “CALLERID(name)=Ing Alberto”) in new stack
    — Executing [s@macro-user-callerid:21] NoOp(“SIP/400-000003b1”, “Using CallerID “Ing Alberto” “) in new stack
    — Executing [0452231032598@from-internal:2] NoOp(“SIP/400-000003b1”, “Calling Out Route: RTelcel”) in new stack
    — Executing [0452231032598@from-internal:3] Set(“SIP/400-000003b1”, “MOHCLASS=default”) in new stack
    — Executing [0452231032598@from-internal:4] Set(“SIP/400-000003b1”, “_NODEST=”) in new stack
    — Executing [0452231032598@from-internal:5] Macro(“SIP/400-000003b1”, “record-enable,400,OUT,”) in new stack
    — Executing [s@macro-record-enable:1] GotoIf(“SIP/400-000003b1”, “1?check”) in new stack
    — Goto (macro-record-enable,s,4)
    — Executing [s@macro-record-enable:4] ExecIf(“SIP/400-000003b1”, “0?MacroExit()”) in new stack
    — Executing [s@macro-record-enable:5] GotoIf(“SIP/400-000003b1”, “0?Group:OUT”) in new stack
    — Goto (macro-record-enable,s,15)
    — Executing [s@macro-record-enable:15] GotoIf(“SIP/400-000003b1”, “0?IN”) in new stack
    — Executing [s@macro-record-enable:16] ExecIf(“SIP/400-000003b1”, “1?MacroExit()”) in new stack
    — Executing [0452231032598@from-internal:6] Macro(“SIP/400-000003b1”, “dialout-trunk,12,0452231032598,”) in new stack
    — Executing [s@macro-dialout-trunk:1] Set(“SIP/400-000003b1”, “DIAL_TRUNK=12”) in new stack
    — Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/400-000003b1”, “0?sub-pincheck,s,1”) in new stack
    — Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/400-000003b1”, “0?disabletrunk,1”) in new stack
    — Executing [s@macro-dialout-trunk:4] Set(“SIP/400-000003b1”, “DIAL_NUMBER=0452231032598”) in new stack
    — Executing [s@macro-dialout-trunk:5] Set(“SIP/400-000003b1”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
    — Executing [s@macro-dialout-trunk:6] Set(“SIP/400-000003b1”, “OUTBOUND_GROUP=OUT_12”) in new stack
    — Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/400-000003b1”, “0?nomax”) in new stack
    — Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/400-000003b1”, “0?chanfull”) in new stack
    — Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/400-000003b1”, “0?skipoutcid”) in new stack
    — Executing [s@macro-dialout-trunk:10] Set(“SIP/400-000003b1”, “DIAL_TRUNK_OPTIONS=”) in new stack
    — Executing [s@macro-dialout-trunk:11] Macro(“SIP/400-000003b1”, “outbound-callerid,12”) in new stack
    — Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/400-000003b1”, “0?Set(CALLERPRES()=)”) in new stack
    — Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/400-000003b1”, “0?Set(REALCALLERIDNUM=400)”) in new stack
    — Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/400-000003b1”, “1?normcid”) in new stack
    — Goto (macro-outbound-callerid,s,6)
    — Executing [s@macro-outbound-callerid:6] Set(“SIP/400-000003b1”, “USEROUTCID=”) in new stack
    — Executing [s@macro-outbound-callerid:7] Set(“SIP/400-000003b1”, “EMERGENCYCID=”) in new stack
    — Executing [s@macro-outbound-callerid:8] Set(“SIP/400-000003b1”, “TRUNKOUTCID=”) in new stack
    — Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/400-000003b1”, “1?trunkcid”) in new stack
    — Goto (macro-outbound-callerid,s,12)
    — Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/400-000003b1”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/400-000003b1”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/400-000003b1”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/400-000003b1”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
    — Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/400-000003b1”, “0?sub-flp-12,s,1”) in new stack
    — Executing [s@macro-dialout-trunk:13] Set(“SIP/400-000003b1”, “OUTNUM=0452231032598”) in new stack
    — Executing [s@macro-dialout-trunk:14] Set(“SIP/400-000003b1”, “custom=AMP”) in new stack
    — Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/400-000003b1”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
    — Executing [s@macro-dialout-trunk:16] Macro(“SIP/400-000003b1”, “dialout-trunk-predial-hook,”) in new stack
    — Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/400-000003b1”, “”) in new stack
    — Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/400-000003b1”, “0?bypass,1”) in new stack
    — Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/400-000003b1”, “1?customtrunk”) in new stack
    — Goto (macro-dialout-trunk,s,22)
    — Executing [s@macro-dialout-trunk:22] Set(“SIP/400-000003b1”, “pre_num=AMP:Local/{OUTNUM}@roundrobin/n”) in new stack
    — Executing [s@macro-dialout-trunk:23] Set(“SIP/400-000003b1”, “the_num=”) in new stack
    — Executing [s@macro-dialout-trunk:24] Set(“SIP/400-000003b1”, “post_num=”) in new stack
    — Executing [s@macro-dialout-trunk:25] GotoIf(“SIP/400-000003b1”, “0?outnum:skipoutnum”) in new stack
    — Goto (macro-dialout-trunk,s,27)
    — Executing [s@macro-dialout-trunk:27] Dial(“SIP/400-000003b1”, “Local/{OUTNUM}@roundrobin/n,300,”) in new stack
    — Couldn’t call Local/{OUTNUM}@roundrobin/n
    == Everyone is busy/congested at this time (0:0/0/0)
    — Executing [s@macro-dialout-trunk:28] NoOp(“SIP/400-000003b1”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0”) in new stack
    — Executing [s@macro-dialout-trunk:29] Goto(“SIP/400-000003b1”, “s-CHANUNAVAIL,1”) in new stack
    — Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
    — Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/400-000003b1”, “RC=0”) in new stack
    — Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/400-000003b1”, “0,1”) in new stack
    — Goto (macro-dialout-trunk,0,1)
    — Executing [0@macro-dialout-trunk:1] Goto(“SIP/400-000003b1”, “continue,1”) in new stack
    — Goto (macro-dialout-trunk,continue,1)
    — Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/400-000003b1”, “1?noreport”) in new stack
    — Goto (macro-dialout-trunk,continue,3)
    — Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/400-000003b1”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 0 – failing through to other trunks”) in new stack
    — Executing [continue@macro-dialout-trunk:4] Set(“SIP/400-000003b1”, “CALLERID(number)=400”) in new stack
    — Executing [0452231032598@from-internal:7] Macro(“SIP/400-000003b1”, “outisbusy,”) in new stack
    — Executing [s@macro-outisbusy:1] Progress(“SIP/400-000003b1”, “”) in new stack
    — Executing [s@macro-outisbusy:2] GotoIf(“SIP/400-000003b1”, “0?emergency,1”) in new stack
    — Executing [s@macro-outisbusy:3] GotoIf(“SIP/400-000003b1”, “0?intracompany,1”) in new stack
    — Executing [s@macro-outisbusy:4] Playback(“SIP/400-000003b1”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
    — Playing ‘all-circuits-busy-now.gsm’ (language ‘en’)
    — Playing ‘pls-try-call-later.gsm’ (language ‘en’)
    — Executing [s@macro-outisbusy:5] Congestion(“SIP/400-000003b1”, “20”) in new stack
    == Spawn extension (macro-outisbusy, s, 5) exited non-zero on ‘SIP/400-000003b1’ in macro ‘outisbusy’
    == Spawn extension (from-internal, 0452231032598, 7) exited non-zero on ‘SIP/400-000003b1’
    — Executing [h@from-internal:1] Macro(“SIP/400-000003b1”, “hangupcall”) in new stack
    — Executing [s@macro-hangupcall:1] GotoIf(“SIP/400-000003b1”, “1?endmixmoncheck”) in new stack
    — Goto (macro-hangupcall,s,9)
    — Executing [s@macro-hangupcall:9] NoOp(“SIP/400-000003b1”, “End of MIXMON check”) in new stack
    — Executing [s@macro-hangupcall:10] GotoIf(“SIP/400-000003b1”, “1?nomeetmemon”) in new stack
    — Goto (macro-hangupcall,s,28)
    — Executing [s@macro-hangupcall:28] NoOp(“SIP/400-000003b1”, “End of MEETME check”) in new stack
    — Executing [s@macro-hangupcall:29] GotoIf(“SIP/400-000003b1”, “1?noautomon”) in new stack
    — Goto (macro-hangupcall,s,34)
    — Executing [s@macro-hangupcall:34] NoOp(“SIP/400-000003b1”, “TOUCH_MONITOR_OUTPUT=”) in new stack
    — Executing [s@macro-hangupcall:35] GotoIf(“SIP/400-000003b1”, “1?noautomon2”) in new stack
    — Goto (macro-hangupcall,s,41)
    — Executing [s@macro-hangupcall:41] NoOp(“SIP/400-000003b1”, “MONITOR_FILENAME=”) in new stack
    — Executing [s@macro-hangupcall:42] GotoIf(“SIP/400-000003b1”, “1?skiprg”) in new stack
    — Goto (macro-hangupcall,s,45)
    — Executing [s@macro-hangupcall:45] GotoIf(“SIP/400-000003b1”, “1?skipblkvm”) in new stack
    — Goto (macro-hangupcall,s,48)
    — Executing [s@macro-hangupcall:48] GotoIf(“SIP/400-000003b1”, “1?theend”) in new stack
    — Goto (macro-hangupcall,s,50)
    — Executing [s@macro-hangupcall:50] AGI(“SIP/400-000003b1”, “hangup.agi”) in new stack
    — Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi
    — AGI Script hangup.agi completed, returning 0
    — Executing [s@macro-hangupcall:51] Hangup(“SIP/400-000003b1”, “”) in new stack
    == Spawn extension (macro-hangupcall, s, 51) exited non-zero on ‘SIP/400-000003b1’ in macro ‘hangupcall’
    == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/400-000003b1’

  • hola ya agregue el codigo y la troncal como lo mensionas en el tuto pero no me enlaza las llmadas espereo me puedan ayudar

    este es el resultado del inteinto de llamada

    localhost*CLI> !clear
    localhost*CLI> !clear
    == Using SIP RTP TOS bits 184
    == Using SIP RTP CoS mark 5
    — Executing [0452231032598@from-internal:1] Macro(“SIP/400-00000074”, “user-callerid,SKIPTTL,”) in new stack
    — Executing [s@macro-user-callerid:1] Set(“SIP/400-00000074”, “AMPUSER=400”) in new stack
    — Executing [s@macro-user-callerid:2] GotoIf(“SIP/400-00000074”, “0?report”) in new stack
    — Executing [s@macro-user-callerid:3] ExecIf(“SIP/400-00000074”, “1?Set(REALCALLERIDNUM=400)”) in new stack
    — Executing [s@macro-user-callerid:4] Set(“SIP/400-00000074”, “AMPUSER=400”) in new stack
    — Executing [s@macro-user-callerid:5] Set(“SIP/400-00000074”, “AMPUSERCIDNAME=Ing Alberto”) in new stack
    — Executing [s@macro-user-callerid:6] GotoIf(“SIP/400-00000074”, “0?report”) in new stack
    — Executing [s@macro-user-callerid:7] Set(“SIP/400-00000074”, “AMPUSERCID=400”) in new stack
    — Executing [s@macro-user-callerid:8] Set(“SIP/400-00000074”, “CALLERID(all)=”Ing Alberto” “) in new stack
    — Executing [s@macro-user-callerid:9] ExecIf(“SIP/400-00000074”, “0?Set(CHANNEL(language)=)”) in new stack
    — Executing [s@macro-user-callerid:10] GotoIf(“SIP/400-00000074”, “1?continue”) in new stack
    — Goto (macro-user-callerid,s,19)
    — Executing [s@macro-user-callerid:19] Set(“SIP/400-00000074”, “CALLERID(number)=400”) in new stack
    — Executing [s@macro-user-callerid:20] Set(“SIP/400-00000074”, “CALLERID(name)=Ing Alberto”) in new stack
    — Executing [s@macro-user-callerid:21] NoOp(“SIP/400-00000074”, “Using CallerID “Ing Alberto” “) in new stack
    — Executing [0452231032598@from-internal:2] NoOp(“SIP/400-00000074”, “Calling Out Route: RTelcel”) in new stack
    — Executing [0452231032598@from-internal:3] Set(“SIP/400-00000074”, “MOHCLASS=default”) in new stack
    — Executing [0452231032598@from-internal:4] Set(“SIP/400-00000074”, “_NODEST=”) in new stack
    — Executing [0452231032598@from-internal:5] Macro(“SIP/400-00000074”, “record-enable,400,OUT,”) in new stack
    — Executing [s@macro-record-enable:1] GotoIf(“SIP/400-00000074”, “1?check”) in new stack
    — Goto (macro-record-enable,s,4)
    — Executing [s@macro-record-enable:4] ExecIf(“SIP/400-00000074”, “0?MacroExit()”) in new stack
    — Executing [s@macro-record-enable:5] GotoIf(“SIP/400-00000074”, “0?Group:OUT”) in new stack
    — Goto (macro-record-enable,s,15)
    — Executing [s@macro-record-enable:15] GotoIf(“SIP/400-00000074”, “0?IN”) in new stack
    — Executing [s@macro-record-enable:16] ExecIf(“SIP/400-00000074”, “1?MacroExit()”) in new stack
    — Executing [0452231032598@from-internal:6] Macro(“SIP/400-00000074”, “dialout-trunk,12,0452231032598,”) in new stack
    — Executing [s@macro-dialout-trunk:1] Set(“SIP/400-00000074”, “DIAL_TRUNK=12”) in new stack
    — Executing [s@macro-dialout-trunk:2] GosubIf(“SIP/400-00000074”, “0?sub-pincheck,s,1”) in new stack
    — Executing [s@macro-dialout-trunk:3] GotoIf(“SIP/400-00000074”, “0?disabletrunk,1”) in new stack
    — Executing [s@macro-dialout-trunk:4] Set(“SIP/400-00000074”, “DIAL_NUMBER=0452231032598”) in new stack
    — Executing [s@macro-dialout-trunk:5] Set(“SIP/400-00000074”, “DIAL_TRUNK_OPTIONS=tr”) in new stack
    — Executing [s@macro-dialout-trunk:6] Set(“SIP/400-00000074”, “OUTBOUND_GROUP=OUT_12”) in new stack
    — Executing [s@macro-dialout-trunk:7] GotoIf(“SIP/400-00000074”, “0?nomax”) in new stack
    — Executing [s@macro-dialout-trunk:8] GotoIf(“SIP/400-00000074”, “0?chanfull”) in new stack
    — Executing [s@macro-dialout-trunk:9] GotoIf(“SIP/400-00000074”, “0?skipoutcid”) in new stack
    — Executing [s@macro-dialout-trunk:10] Set(“SIP/400-00000074”, “DIAL_TRUNK_OPTIONS=”) in new stack
    — Executing [s@macro-dialout-trunk:11] Macro(“SIP/400-00000074”, “outbound-callerid,12”) in new stack
    — Executing [s@macro-outbound-callerid:1] ExecIf(“SIP/400-00000074”, “0?Set(CALLERPRES()=)”) in new stack
    — Executing [s@macro-outbound-callerid:2] ExecIf(“SIP/400-00000074”, “0?Set(REALCALLERIDNUM=400)”) in new stack
    — Executing [s@macro-outbound-callerid:3] GotoIf(“SIP/400-00000074”, “1?normcid”) in new stack
    — Goto (macro-outbound-callerid,s,6)
    — Executing [s@macro-outbound-callerid:6] Set(“SIP/400-00000074”, “USEROUTCID=”) in new stack
    — Executing [s@macro-outbound-callerid:7] Set(“SIP/400-00000074”, “EMERGENCYCID=”) in new stack
    — Executing [s@macro-outbound-callerid:8] Set(“SIP/400-00000074”, “TRUNKOUTCID=”) in new stack
    — Executing [s@macro-outbound-callerid:9] GotoIf(“SIP/400-00000074”, “1?trunkcid”) in new stack
    — Goto (macro-outbound-callerid,s,12)
    — Executing [s@macro-outbound-callerid:12] ExecIf(“SIP/400-00000074”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [s@macro-outbound-callerid:13] ExecIf(“SIP/400-00000074”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [s@macro-outbound-callerid:14] ExecIf(“SIP/400-00000074”, “0?Set(CALLERID(all)=)”) in new stack
    — Executing [s@macro-outbound-callerid:15] ExecIf(“SIP/400-00000074”, “0?Set(CALLERPRES()=prohib_passed_screen)”) in new stack
    — Executing [s@macro-dialout-trunk:12] GosubIf(“SIP/400-00000074”, “1?sub-flp-12,s,1”) in new stack
    — Executing [s@sub-flp-12:1] ExecIf(“SIP/400-00000074”, “0?Set(TARGET_FLP_12=0442231032598)”) in new stack
    — Executing [s@sub-flp-12:2] GotoIf(“SIP/400-00000074”, “0?match”) in new stack
    — Executing [s@sub-flp-12:3] ExecIf(“SIP/400-00000074”, “1?Set(TARGET_FLP_12=0452231032598)”) in new stack
    — Executing [s@sub-flp-12:4] GotoIf(“SIP/400-00000074”, “1?match”) in new stack
    — Goto (sub-flp-12,s,7)
    — Executing [s@sub-flp-12:7] Set(“SIP/400-00000074”, “DIAL_NUMBER=0452231032598”) in new stack
    — Executing [s@sub-flp-12:8] Return(“SIP/400-00000074”, “”) in new stack
    — Executing [s@macro-dialout-trunk:13] Set(“SIP/400-00000074”, “OUTNUM=0452231032598”) in new stack
    — Executing [s@macro-dialout-trunk:14] Set(“SIP/400-00000074”, “custom=AMP”) in new stack
    — Executing [s@macro-dialout-trunk:15] ExecIf(“SIP/400-00000074”, “0?Set(DIAL_TRUNK_OPTIONS=M(setmusic^default))”) in new stack
    — Executing [s@macro-dialout-trunk:16] Macro(“SIP/400-00000074”, “dialout-trunk-predial-hook,”) in new stack
    — Executing [s@macro-dialout-trunk-predial-hook:1] MacroExit(“SIP/400-00000074”, “”) in new stack
    — Executing [s@macro-dialout-trunk:17] GotoIf(“SIP/400-00000074”, “0?bypass,1”) in new stack
    — Executing [s@macro-dialout-trunk:18] GotoIf(“SIP/400-00000074”, “1?customtrunk”) in new stack
    — Goto (macro-dialout-trunk,s,22)
    — Executing [s@macro-dialout-trunk:22] Set(“SIP/400-00000074”, “pre_num=AMP:Local/{OUTNUM}@roundrobin/n”) in new stack
    — Executing [s@macro-dialout-trunk:23] Set(“SIP/400-00000074”, “the_num=”) in new stack
    — Executing [s@macro-dialout-trunk:24] Set(“SIP/400-00000074”, “post_num=”) in new stack
    — Executing [s@macro-dialout-trunk:25] GotoIf(“SIP/400-00000074”, “0?outnum:skipoutnum”) in new stack
    — Goto (macro-dialout-trunk,s,27)
    — Executing [s@macro-dialout-trunk:27] Dial(“SIP/400-00000074”, “Local/{OUTNUM}@roundrobin/n,300,”) in new stack
    — Couldn’t call Local/{OUTNUM}@roundrobin/n
    == Everyone is busy/congested at this time (0:0/0/0)
    — Executing [s@macro-dialout-trunk:28] NoOp(“SIP/400-00000074”, “Dial failed for some reason with DIALSTATUS = CHANUNAVAIL and HANGUPCAUSE = 0”) in new stack
    — Executing [s@macro-dialout-trunk:29] Goto(“SIP/400-00000074”, “s-CHANUNAVAIL,1”) in new stack
    — Goto (macro-dialout-trunk,s-CHANUNAVAIL,1)
    — Executing [s-CHANUNAVAIL@macro-dialout-trunk:1] Set(“SIP/400-00000074”, “RC=0”) in new stack
    — Executing [s-CHANUNAVAIL@macro-dialout-trunk:2] Goto(“SIP/400-00000074”, “0,1”) in new stack
    — Goto (macro-dialout-trunk,0,1)
    — Executing [0@macro-dialout-trunk:1] Goto(“SIP/400-00000074”, “continue,1”) in new stack
    — Goto (macro-dialout-trunk,continue,1)
    — Executing [continue@macro-dialout-trunk:1] GotoIf(“SIP/400-00000074”, “1?noreport”) in new stack
    — Goto (macro-dialout-trunk,continue,3)
    — Executing [continue@macro-dialout-trunk:3] NoOp(“SIP/400-00000074”, “TRUNK Dial failed due to CHANUNAVAIL HANGUPCAUSE: 0 – failing through to other trunks”) in new stack
    — Executing [continue@macro-dialout-trunk:4] Set(“SIP/400-00000074”, “CALLERID(number)=400”) in new stack
    — Executing [0452231032598@from-internal:7] Macro(“SIP/400-00000074”, “outisbusy,”) in new stack
    — Executing [s@macro-outisbusy:1] Progress(“SIP/400-00000074”, “”) in new stack
    — Executing [s@macro-outisbusy:2] GotoIf(“SIP/400-00000074”, “0?emergency,1”) in new stack
    — Executing [s@macro-outisbusy:3] GotoIf(“SIP/400-00000074”, “0?intracompany,1”) in new stack
    — Executing [s@macro-outisbusy:4] Playback(“SIP/400-00000074”, “all-circuits-busy-now&pls-try-call-later, noanswer”) in new stack
    — Playing ‘all-circuits-busy-now.gsm’ (language ‘en’)
    — Playing ‘pls-try-call-later.gsm’ (language ‘en’)
    == Spawn extension (macro-outisbusy, s, 4) exited non-zero on ‘SIP/400-00000074’ in macro ‘outisbusy’
    == Spawn extension (from-internal, 0452231032598, 7) exited non-zero on ‘SIP/400-00000074’
    — Executing [h@from-internal:1] Macro(“SIP/400-00000074”, “hangupcall”) in new stack
    — Executing [s@macro-hangupcall:1] GotoIf(“SIP/400-00000074”, “1?endmixmoncheck”) in new stack
    — Goto (macro-hangupcall,s,9)
    — Executing [s@macro-hangupcall:9] NoOp(“SIP/400-00000074”, “End of MIXMON check”) in new stack
    — Executing [s@macro-hangupcall:10] GotoIf(“SIP/400-00000074”, “1?nomeetmemon”) in new stack
    — Goto (macro-hangupcall,s,28)
    — Executing [s@macro-hangupcall:28] NoOp(“SIP/400-00000074”, “End of MEETME check”) in new stack
    — Executing [s@macro-hangupcall:29] GotoIf(“SIP/400-00000074”, “1?noautomon”) in new stack
    — Goto (macro-hangupcall,s,34)
    — Executing [s@macro-hangupcall:34] NoOp(“SIP/400-00000074”, “TOUCH_MONITOR_OUTPUT=”) in new stack
    — Executing [s@macro-hangupcall:35] GotoIf(“SIP/400-00000074”, “1?noautomon2”) in new stack
    — Goto (macro-hangupcall,s,41)
    — Executing [s@macro-hangupcall:41] NoOp(“SIP/400-00000074”, “MONITOR_FILENAME=”) in new stack
    — Executing [s@macro-hangupcall:42] GotoIf(“SIP/400-00000074”, “1?skiprg”) in new stack
    — Goto (macro-hangupcall,s,45)
    — Executing [s@macro-hangupcall:45] GotoIf(“SIP/400-00000074”, “1?skipblkvm”) in new stack
    — Goto (macro-hangupcall,s,48)
    — Executing [s@macro-hangupcall:48] GotoIf(“SIP/400-00000074”, “1?theend”) in new stack
    — Goto (macro-hangupcall,s,50)
    — Executing [s@macro-hangupcall:50] AGI(“SIP/400-00000074”, “hangup.agi”) in new stack
    — Launched AGI Script /var/lib/asterisk/agi-bin/hangup.agi
    — AGI Script hangup.agi completed, returning 0
    — Executing [s@macro-hangupcall:51] Hangup(“SIP/400-00000074”, “”) in new stack
    == Spawn extension (macro-hangupcall, s, 51) exited non-zero on ‘SIP/400-00000074’ in macro ‘hangupcall’
    == Spawn extension (from-internal, h, 1) exited non-zero on ‘SIP/400-00000074’
    localhost*CLI>