elastix
Information
Community
Developers
What We Sell
Forums
Addons
Download
Information
Community
Social Networks
For Developers
Manufacturer Support
Appliances
Training & Certification

[Resuelto] Night mode a IVR que selecciona destino

Eres nuevo en Elastix y Voz sobre ip? Empieza aquí

[Resuelto] Night mode a IVR que selecciona destino

Postby eNoisy » Thu Aug 02, 2012 10:57 am

Hola!

Lo que intento hacer en el momento es crear un script que me permita direccionar todas las llamadas entrantes al PBX a un numero elegido dentro de un ivr.
(Elastix 1.6-12)

Lo que intento hacer es activar el day/night mode asi:

Day --> Todas las llamadas entrantes dirigidas al Ring Group 600
Night --> Todas las llamadas entrantes dirigidas al un destino que se puede escoger por el usuario en el momento de activar el modo nocturno. Al activarlo el usuario es enviado a un IVR asi:
(1) Destino 1 (Ring Group 606 que contiene numero de telefono movil1)
(2) Destino 2 (Ring Group 607 que contiene numero de telefono movil2)
(1) Destino 3 (Ring Group 608 que contiene numero de telefono movil3)
(1) Destino 4 (Ring Group 609 que contiene numero de telefono movil4)

Configuracion:

[app-daynight-toggle] y [app-daynight] modificados dentro del archivo extensions_override_freepbx.conf



[app-daynight]
include => app-daynight-custom
exten => 0,1,GotoIf($["${DB(DAYNIGHT/C${EXTEN})}" = "NIGHT"]?ext-group,"${DESTINATION}",1:ext-group,600,1)
--------------------------------------------------------------------------------------
***************^CREO QUE ESTE ES MI ERROR. NO SE SI ES CORRECTO USAR EL "${DESTINATION}" ASI. TENGO QUE SER CAPAZ DE PASAR EL VALOR DE LA VARIABLE COMO UN PARAMETRO QUE EXT-GROUP PUEDA USAR Y TIMBRAR AL RING GROUP DESEADO????? Y NO SE SI ESTO ESTA SUCEDIENDO (CLI AL FINAL)




[app-daynight-toggle]
include => app-daynight-toggle-custom
exten => *280,1,Answer
exten => *280,n,Wait(1)
exten => *280,n,Set(INDEX=0)
exten => *280,n,Goto(app-daynight-toggle,s,1)
exten => *280,hint,Custom:DAYNIGHT0
exten => s,1,Set(DAYNIGHTMODE=${DB(DAYNIGHT/C${INDEX})})
exten => s,n,GotoIf($["${DAYNIGHTMODE}" = "NIGHT"]?day:night)
exten => s,n(day),Set(DB(DAYNIGHT/C${INDEX})=DAY)
exten => s,n,Set(DEVSTATE(Custom:DAYNIGHT${INDEX})=NOT_INUSE)
;exten => s,n,Playback(beep&silence/1&day&reception&digits/${INDEX}&enabled)
exten => s,n,Playback(beep&silence/1&day&enabled)
exten => s,n,Hangup
exten => s,n(night),Set(DB(DAYNIGHT/C${INDEX})=NIGHT)
exten => s,n,Set(DEVSTATE(Custom:DAYNIGHT${INDEX})=INUSE)
exten => s,n,Playback(beep&silence/1&beep&silence/1&day&disabled)
;-----------------------------------------------------
exten => s,n,Set(LOOPCOUNT=0)
exten => s,n,Set(PWDRETRY=0)
exten => s,n,Set(__DIR-CONTEXT=default)
exten => s,n,GotoIf($["${CDR(disposition)}" = "ANSWERED"]?begin)
;exten => s,n,Answer
exten => s,n,Wait(1)
exten => s,n(begin),Set(TIMEOUT(digit)=3)
exten => s,n,Set(TIMEOUT(response)=5)
exten => s,n,Background(press-1&or&press-2&or&press-3&or&press-4)
--------------------------------------------------------------------------------------
El usuario es enviado al IVR y dentro de este se le dan diferentes valores a la variable DESTINATION:
(1) DESTINATION=606
(2) DESTINATION=607
(3) DESTINATION=608
(4) DESTINATION=609
--------------------------------------------------------------------------------------
exten => s,n,WaitExten(,)
exten => 1,1,Set(DESTINATION=606)
exten => 1,n,SayDigits("${DESTINATION}")
exten => 1,n,Playback(goodbye)
exten => 1,n,Hangup
exten => 2,1,Set(DESTINATION=607)
exten => 2,n,SayDigits("${DESTINATION}")
exten => 2,n,Playback(goodbye)
exten => 2,n,Hangup
exten => 3,1,Set(DESTINATION=608)
exten => 3,n,SayDigits("${DESTINATION}")
exten => 3,n,Playback(goodbye)
exten => 3,n,Hangup
exten => 4,1,Set(DESTINATION=609)
exten => 4,n,SayDigits("${DESTINATION}")
exten => 4,n,Playback(goodbye)
exten => 4,n,Hangup
exten => i,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => i,n,Playback(im-sorry&option-is-invalid)
exten => i,n,GotoIf($[${LOOPCOUNT} <= 2]?s,begin)
exten => i,n,Playback(goodbye)
exten => i,n,Hangup
exten => t,1,Set(LOOPCOUNT=$[${LOOPCOUNT} + 1])
exten => t,n,GotoIf($[${LOOPCOUNT} <= 2]?s,begin)
exten => t,n,Playback(goodbye)
exten => t,n,Hangup

; end of [app-daynight-toggle]

--------------------------------------------------------------------------------------
Resultados del cli cuando activo el modo nocturno y seleccciono la opcion 2 en el ivr:
--------------------------------------------------------------------------------------
== Spawn extension (app-daynight-toggle, s, 6) exited non-zero on 'IAX2/260-8257'
-- Hungup 'IAX2/260-8257'
-- Accepting AUTHENTICATED call from xxx.xxx.xxx.xxx:
> requested format = alaw,
> requested prefs = (),
> actual format = ulaw,
> host prefs = (ulaw|alaw|gsm),
> priority = mine
-- Executing [*280@from-internal:1] Answer("IAX2/260-10697", "") in new stack
-- Executing [*280@from-internal:2] Wait("IAX2/260-10697", "1") in new stack
-- Executing [*280@from-internal:3] Set("IAX2/260-10697", "INDEX=0") in new stack
-- Executing [*280@from-internal:4] Goto("IAX2/260-10697", "app-daynight-toggle|s|1") in new stack
-- Goto (app-daynight-toggle,s,1)
-- Executing [s@app-daynight-toggle:1] Set("IAX2/260-10697", "DAYNIGHTMODE=DAY") in new stack
-- Executing [s@app-daynight-toggle:2] GotoIf("IAX2/260-10697", "0?day:night") in new stack
-- Goto (app-daynight-toggle,s,7)
-- Executing [s@app-daynight-toggle:7] Set("IAX2/260-10697", "DB(DAYNIGHT/C0)=NIGHT") in new stack
-- Executing [s@app-daynight-toggle:8] Set("IAX2/260-10697", "DEVSTATE(Custom:DAYNIGHT0)=INUSE") in new stack
-- Executing [s@app-daynight-toggle:9] Playback("IAX2/260-10697", "beep&silence/1&beep&silence/1&day&disabled") in new stack
-- Playing 'beep' (language 'au')
-- Playing 'silence/1' (language 'au')
-- Playing 'beep' (language 'au')
-- Playing 'silence/1' (language 'au')
-- Playing 'day' (language 'au')
-- Playing 'disabled' (language 'au')
-- Executing [s@app-daynight-toggle:10] Set("IAX2/260-10697", "LOOPCOUNT=0") in new stack
-- Executing [s@app-daynight-toggle:11] Set("IAX2/260-10697", "PWDRETRY=0") in new stack
-- Executing [s@app-daynight-toggle:12] Set("IAX2/260-10697", "__DIR-CONTEXT=default") in new stack
-- Executing [s@app-daynight-toggle:13] GotoIf("IAX2/260-10697", "1?begin") in new stack
-- Goto (app-daynight-toggle,s,15)
-- Executing [s@app-daynight-toggle:15] Set("IAX2/260-10697", "TIMEOUT(digit)=3") in new stack
-- Digit timeout set to 3
-- Executing [s@app-daynight-toggle:16] Set("IAX2/260-10697", "TIMEOUT(response)=5") in new stack
-- Response timeout set to 5
-- Executing [s@app-daynight-toggle:17] BackGround("IAX2/260-10697", "press-1&or&press-2&or&press-3&or&press-4") in new stack
-- Playing 'press-1' (language 'au')
-- Playing 'or' (language 'au')
-- Playing 'press-2' (language 'au')
-- Playing 'or' (language 'au')
-- Playing 'press-3' (language 'au')
-- Playing 'or' (language 'au')
-- Playing 'press-4' (language 'au')
-- Executing [s@app-daynight-toggle:18] WaitExten("IAX2/260-10697", "|") in new stack
== CDR updated on IAX2/260-10697
-- Executing [2@app-daynight-toggle:1] Set("IAX2/260-10697", "DESTINATION=607") in new stack
-- Executing [2@app-daynight-toggle:2] SayDigits("IAX2/260-10697", ""607"") in new stack
-- Playing 'digits/6' (language 'au')
-- Playing 'digits/0' (language 'au')
-- Playing 'digits/7' (language 'au')
-- Executing [2@app-daynight-toggle:3] Playback("IAX2/260-10697", "goodbye") in new stack
-- Playing 'goodbye' (language 'au')
-- Executing [2@app-daynight-toggle:4] Hangup("IAX2/260-10697", "") in new stack
== Spawn extension (app-daynight-toggle, 2, 4) exited non-zero on 'IAX2/260-10697'
-- Hungup 'IAX2/260-10697'

--------------------------------------------------------------------------------------
Resultados del cli cuando hago una llamada a ese pbx:
--------------------------------------------------------------------------------------
Remote UNIX connection
-- Remote UNIX connection disconnected
-- Accepting call from '04xxxxxxxx' to '07xxxxxxxx'on channel 0/1, span 1
-- Executing [0732779044@from-pstn:1] NoOp("DAHDI/1-1", "Catch-All DID Match - Found 0732779044 - You probably want a DID for this.") in new stack
-- Executing [0732779044@from-pstn:2] Goto("DAHDI/1-1", "ext-did|s|1") in new stack
-- Goto (ext-did,s,1)
-- Executing [s@ext-did:1] Set("DAHDI/1-1", "__FROM_DID=s") in new stack
-- Executing [s@ext-did:2] Gosub("DAHDI/1-1", "cidlookup|cidlookup_1|1") in new stack
-- Executing [cidlookup_1@cidlookup:1] MYSQL("DAHDI/1-1", "Connect connid 10.0.0.202 vmail izsak001 asteriskcdrdb") in new stack
-- Executing [cidlookup_1@cidlookup:2] MYSQL("DAHDI/1-1", "Query resultid 1 select contactname from contacts where phonenumber like right('04xxxxxxxx',8)") in new stack
-- Executing [cidlookup_1@cidlookup:3] MYSQL("DAHDI/1-1", "Fetch fetchid 2 CALLERID(name)") in new stack
-- Executing [cidlookup_1@cidlookup:4] MYSQL("DAHDI/1-1", "Clear 2") in new stack
-- Executing [cidlookup_1@cidlookup:5] MYSQL("DAHDI/1-1", "Disconnect 1") in new stack
-- Executing [cidlookup_1@cidlookup:6] Return("DAHDI/1-1", "") in new stack
-- Executing [s@ext-did:3] Gosub("DAHDI/1-1", "app-blacklist-check|s|1") in new stack
-- Executing [s@app-blacklist-check:1] LookupBlacklist("DAHDI/1-1", "") in new stack
-- Executing [s@app-blacklist-check:2] GotoIf("DAHDI/1-1", "0?blacklisted") in new stack
-- Executing [s@app-blacklist-check:3] Return("DAHDI/1-1", "") in new stack
-- Executing [s@ext-did:4] ExecIf("DAHDI/1-1", "1 |Set|CALLERID(name)=04xxxxxxxx") in new stack
-- Executing [s@ext-did:5] Set("DAHDI/1-1", "__CALLINGPRES_SV=allowed_passed_screen") in new stack
-- Executing [s@ext-did:6] SetCallerPres("DAHDI/1-1", "allowed_not_screened") in new stack
-- Executing [s@ext-did:7] Goto("DAHDI/1-1", "app-daynight|0|1") in new stack
-- Goto (app-daynight,0,1)
-- Executing [0@app-daynight:1] GotoIf("DAHDI/1-1", "1?ext-group||1:ext-group|600|1") in new stack
-- Goto (ext-group,0,1)
-- Hungup 'DAHDI/1-1'




Ayuda?
Gracias
Juan
User avatar
eNoisy
Junior Boarder
Junior Boarder
 
Posts: 58
Joined: Fri Jul 23, 2010 10:29 pm
Karma: 2

Re: DayNight mode --> IVR para seleccionar destino

Postby soborno » Thu Aug 02, 2012 11:12 am

Hola,
Estas al tanto que deberías haberlo puesto en el foro en Español, verdad?

Por otra parte, creo te estas complicando mucho, por que no lo haces solo con los Time Groups?
1) Creas un Time Group que identifique Día y Noche
2) Asignas una Time Condition para cada Caso (Dia/noche)
En el Dia colocas que vaya a tu cola, o en tu caso a RG 600 y para
la Noche, colocas un IVR con los 4 destinos que detallaste antes

Saludos,
Claudio
Keep the KARMA UP!
soborno.sr@gmail.com
User avatar
soborno
Gold Boarder
Gold Boarder
 
Posts: 1250
Joined: Mon Dec 19, 2011 12:38 pm
Location: Uruguay
Karma: 104

Re: DayNight mode --> IVR para seleccionar destino

Postby eNoisy » Thu Aug 02, 2012 7:39 pm

Gracias por tu respuesta!
No tenia ni 5 de idea que existia una parte especifica para posts en Español. Mil disculpas...
Hay alguna forma de moverlo yo mismo o un admin debe hacerlo?

Tu solucion es valida, incluso yo tambien la considere pues obviamente seria mucho mas facil.
Sin embargo lo que necesito, a peticion del usuario es lograr hacer funcionar el metodo que yo postee.
Con Time Conditions el sistema queda limitado a aplicar la configuracion en horas predeterminadas, mientras que usando el day/night mode desde el telefono, esto se podria habilitar en el momento deseado.
Ademas la parte del IVR es para el usuario interno que habilita el modo nocturno, esta parte debe ser transparente para el que llama sin tener que seleccionar a donde debe redireccionar su llamada ya que no conoce quien es la persona "en disponibilidad" durante esa noche en particular.

De nuevo gracias.
User avatar
eNoisy
Junior Boarder
Junior Boarder
 
Posts: 58
Joined: Fri Jul 23, 2010 10:29 pm
Karma: 2

[Resuelto] Night mode a IVR que selecciona destino

Postby eNoisy » Sat Aug 04, 2012 9:41 am

Que tal,

Si a alguien le interesa como logre hacerlo funcionar simplemente cambié las siguientes lineas:

exten => 1,1,Set(DESTINATION=606)
exten => 2,1,Set(DESTINATION=607)
exten => 3,1,Set(DESTINATION=608)
exten => 4,1,Set(DESTINATION=609)

Por:
exten => 1,1,SetGlobalVar(DESTINATION=606)
exten => 2,1,SetGlobalVar(DESTINATION=607)
exten => 3,1,SetGlobalVar(DESTINATION=608)
exten => 4,1,SetGlobalVar(DESTINATION=609)

Al parecer no funcionaba antes pues a la avariable DESTINATION solo se le estaba dando el valor durante la llamada interna que realiza el operador mientras asigna el destino de las llamadas durante el modo nocturno.

Al cambiar "Set" por "SetGlobalVar" se asegura que la variable este disponible cuando alguien realiza una llamada entrante al sistema y esta sea direccionada al destino establecido por el valor actual de DESTINATION.
User avatar
eNoisy
Junior Boarder
Junior Boarder
 
Posts: 58
Joined: Fri Jul 23, 2010 10:29 pm
Karma: 2


Return to Novatos

Who is online

Users browsing this forum: No registered users and 1 guest