Day / Night - my way

Discussion in 'General' started by vmiro, Mar 30, 2011.

  1. vmiro

    Joined:
    Nov 22, 2008
    Messages:
    11
    Likes Received:
    0
    Because Day/Night feature seams too confusing to me I tried do it my way. Actually, all I need is to dial an extension or a button (BLF) and switch between Day and Night mode, where Night mode means "redirect all incoming calls to some extension (doormen on duty) or IVR".

    I can't do this with Day/Night feature in Elastix, as far as I understood this feature if I have 50 extensions I'll need 50 features codes (which is impossible, because it is supported only 10), one for each extension...which is kinda silly. I got DID for every extensions, so, for every DID in Inbound Routes I'll have to set destination to Day/Night switch associated with that DID/Extension :)...a little bit confusing right :)

    Here is what I did:
    I created a new Day/Night code in Elastix: *280
    I set DAY and NIGHT destination to random extension because I won't need this, all I need is, when I press *280, Elastix to write in database DAY or NIGHT ("{DB(DAYNIGHT/C0)}" = "NIGHT"), because I need this record to know whether to redirect the call to doorman's extension or not.

    Add following lines in extensions_custom.conf:

    [app-daynight-custom]
    exten => _6XX,1,GotoIf($["${DB(DAYNIGHT/C0)}" = "NIGHT"]?from-did-direct,111,1:from-pstn,${EXTEN},1)

    Instead of 'from-pstn' as incoming context in /etc/asterisk/dahdi-channels.conf type 'app-daynight' for example:

    ; Span 1: B4/0/1 "B4XXP (PCI) Card 0 Span 1" RED
    group=1,11
    ;context=from-pstn
    context=app-daynight
    switchtype = euroisdn
    signalling = bri_cpe
    channel => 1-2
    context = default
    group = 63

    All incoming calls going through app-daynight (and app-daynight-custom) context to check is it a DAY or NIGHT. If the record in "DB(DAYNIGHT/C0)" is set to DAY, go to 'from-pstn' context, which is normal behaviour, if it's NIGHT then go to 111 extension.

    This works perfectly, if you know any other solution, please post here... ;)

    mIRO
     
  2. fmvillares

    Joined:
    Sep 8, 2007
    Messages:
    1,785
    Likes Received:
    0
    why is day and night confusing.... is quite simple.....inbound to day night mode...day and night mode to the respective rules (ie. ivr in day, at night a message) and voila....
     
  3. vmiro

    Joined:
    Nov 22, 2008
    Messages:
    11
    Likes Received:
    0
    fmvillares escribió:
    ...yeah, that's ok if you have one inbound route directed to IVR, but if you have 50 extensions and 50 DIDs for them it's useless! Here is an example:

    Every extension has it's own DID. It's possible to dial an extension 601 from outside dialing 333601, same for extension 602 dialing 333602, extension 620 dialing 333620...
    I have inbound route for every DID pointing to appropriate extensions:
    InboundRoute Destination
    1. 333601 Extension:601
    2. 333602 Extension:602
    ...
    20. 333620 Extension:620
    ...

    How to redirect all incoming calls to ONE extension on NIGHT ??

    Ok, I will set day/night as destination for every InboudRoute, all 50, when Night mode is active all calls goes to one extension, when I switch to DAY everthing goes...where?? IVR?? Yes but then I'm losing my DID functionality!


    mIRO
     

Share This Page