Custom Destination based on caller ID

Discussion in 'General' started by MST, Oct 20, 2010.

  1. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Dear Experts,

    I have been trying to figure it out how to access disa based on caller id. Lest say I call from my cell and as caller ID should be recognized and should be able call another number from my Elastix PBX.

    That's what I placed in custom-callout in extensions.custom.conf at the end:

    [custom-callout]
    exten => s,1,Answer
    exten => s,n,LookupCIDName
    exten => s,n,GotoIf($["${CALLERID(Name)}"=" CELL PHONE NUMBER IN FORMAT XXXXXXXXXX "]?s|1000)
    exten => s,n,Congestion
    exten => s,1000,goto(s,3000)
    exten => s,3000,Playback(pls-entr-num-uwish2-call)
    exten => s,3001,DISA(no-password|from-internal)

    I have :

    -- Executing [1@ivr-3:3] Goto("SIP/MYTRUNK SIP-0000004c", "custom-callout,s,1") in new stack
    -- Goto (custom-callout,s,1)
    -- Executing [s@custom-callout:1] Answer("SIP/MYTRUNK SIP-0000004c", "") in new stack
    == Spawn extension (custom-callout, s, 2) exited non-zero on 'SIP/MYTRUNK SIP-0000004c'

    And silence ..... Any help appreciate
     
  2. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    This is a recurring theme for me, but why are you editing the files manually? This should almost never be done.

    I would recommend that you start over and create an inbound route that matches your cellphone CID. Once you have that working, say by directing it to your desk phone, then direct it to the DISA and you should be good to go. No need for manual editing and all of its pitfalls.

    Tom
     
  3. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Thank you Tom.

    Editing files manually is challenge ;)

    Here is custom-callout in extensions_custom.conf:

    exten => s/MYCELL,1,Answer
    exten => s/MYCELL,2,Set(TIMEOUT(digit)=6)
    exten => s/MYCELL,3,Set(TIMEOUT(response)=6)
    #exten => s/MYCELL,4,Authenticate(12345)
    exten => s/MYCELL,4,DISA(no-password,from-internal)

    ...

    And this work with SIP provider, of course I added as many cell phones number as I want.

    IN IVR:

    1 => Custom Destination = custom-callout

    This works without problems. However;

    in IVR:

    2. => Callback and Callback is set up:

    delay before callback 10
    destination after callback: IVR Main

    So when I call from my cell and chose 2 from my IVR Callback calls my cell phone but when I pick it up I can hear the continous message in the middle from my IVR, so the IVR message is not playing from the beginning, it just continous playing from the place where I press 2 .... I would like it when call back calls my cell I should hear IVR message from the beginning not the middle ....

    And after I have call back I press 1 so I should be able to use DISA in custom-callout but this does not work:

    here what I have:

    == Using SIP RTP CoS mark 5
    -- Called MYSIPTRUNK/MYCELL
    -- SIP/MYSIPTRUNK-0000009b answered Local/MYCELL@from-internal-83bd;2
    -- Executing [s@ivr-3:1] Set("Local/MYCELL@from-internal-83bd;1", "MSG=custom/gereral_wav") in new stack
    == Manager 'admin' logged off from 127.0.0.1
    -- Executing [s@ivr-3:2] Set("Local/MYCELL@from-internal-83bd;1", "LOOPCOUNT=0") in new stack
    -- Executing [s@ivr-3:3] Set("Local/MYCELL@from-internal-83bd;1", "__DIR-CONTEXT=default") in new stack
    -- Executing [s@ivr-3:4] Set("Local/MYCELL@from-internal-83bd;1", "_IVR_CONTEXT_ivr-3=") in new stack
    -- Executing [s@ivr-3:5] Set("Local/MYCELL@from-internal-83bd;1", "_IVR_CONTEXT=ivr-3") in new stack
    -- Executing [s@ivr-3:6] GotoIf("Local/MYCELL@from-internal-83bd;1", "1?begin") in new stack
    -- Goto (ivr-3,s,9)
    -- Executing [s@ivr-3:9] Set("Local/MYCELL@from-internal-83bd;1", "TIMEOUT(digit)=3") in new stack
    -- Digit timeout set to 3.000
    -- Executing [s@ivr-3:10] Set("Local/MYCELL@from-internal-83bd;1", "TIMEOUT(response)=6") in new stack
    -- Response timeout set to 6.000
    -- Executing [s@ivr-3:11] Set("Local/MYCELL@from-internal-83bd;1", "__IVR_RETVM=") in new stack
    -- Executing [s@ivr-3:12] ExecIf("Local/MYCELL@from-internal-83bd;1", "1?Background(custom/gereral_wav)") in new stack
    -- <Local/MYCELL@from-internal-83bd;1> Playing 'custom/gereral_wav.slin' (language 'en')
    -- Executing [h@macro-dialout-trunk:1] Macro("Local/MYCELL@from-internal-83bd;2", "hangupcall,") in new stack
    -- Executing [s@macro-hangupcall:1] GotoIf("Local/MYCELL@from-internal-83bd;2", "1?noautomon") in new stack
    -- Goto (macro-hangupcall,s,3)
    -- Executing [s@macro-hangupcall:3] NoOp("Local/MYCELL@from-internal-83bd;2", "TOUCH_MONITOR_OUTPUT=") in new stack
    -- Executing [s@macro-hangupcall:4] GotoIf("Local/MYCELL@from-internal-83bd;2", "1?skiprg") in new stack
    -- Goto (macro-hangupcall,s,7)
    -- Executing [s@macro-hangupcall:7] GotoIf("Local/MYCELL@from-internal-83bd;2", "1?skipblkvm") in new stack
    -- Goto (macro-hangupcall,s,10)
    -- Executing [s@macro-hangupcall:10] GotoIf("Local/MYCELL@from-internal-83bd;2", "1?theend") in new stack
    -- Goto (macro-hangupcall,s,12)
    -- Executing [s@macro-hangupcall:12] Hangup("Local/MYCELL@from-internal-83bd;2", "") in new stack
    == Spawn extension (macro-hangupcall, s, 12) exited non-zero on 'Local/MYCELL@from-internal-83bd;2' in macro 'hangupcall'
    == Spawn extension (macro-dialout-trunk, s, 19) exited non-zero on 'Local/MYCELL@from-internal-83bd;2' in macro 'dialout-trunk'
    == Spawn extension (from-internal, MYCELL, 4) exited non-zero on 'Local/MYCELL@from-internal-83bd;2'
    -- Executing [s@ivr-3:13] WaitExten("SIP/MYSIPTRUNK-0000009b", ",") in new stack
    == CDR updated on SIP/MYSIPTRUNK-0000009b
    -- Executing [1@ivr-3:1] NoOp("SIP/MYSIPTRUNK-0000009b", "Deleting: ") in new stack
    -- Executing [1@ivr-3:2] Set("SIP/MYSIPTRUNK-0000009b", "__NODEST=") in new stack
    -- Executing [1@ivr-3:3] Goto("SIP/MYSIPTRUNK-0000009b", "custom-callout,s,1") in new stack
    -- Goto (custom-callout,s,1)

    after the last line -- Goto (custom-callout,s,1) i have hang up and silence ....
     
  4. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    whooo I have noticed that when I create callback in Elastix GUI not free pbx I have identical copy of callback just created so creating just one I have 2 the same callbacs!!!!!!!!

    It looks like some sort of bugs
     
  5. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    This is why I recommend that you use Unembedded FreePBX and only the Unembedded FreePBX.

    If you insist on using the embedded FreePBX, stick with that, don't use both.

    As for your problem, have you resolved it?

    Tom

    PS: If you can reproduce it, please file a bug in the bug tracker so the Developers can look into it!
     
  6. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    Thank You Tom for response.

    No, I am still trying to figure it out, but it might be CDR sending wrong caller ID and my code custom-callout is based on caller ID so I have to pass my oryginall caller id number to somewhere and assign it. So when Elastix call back to my cellfone it know what number called earlier.

    Regarding using only Elastix GUI or Unembedded FreePBX is kind of sad that Elastix released 2.0.1 stable with such problem. Don't know what to think .... :(

    MST
     
  7. trymes

    Joined:
    Aug 19, 2009
    Messages:
    228
    Likes Received:
    0
    I can't say much about problems in Embedded FreePBX. I personally consider it to be a Bad Idea® and NEVER use it.

    As for your other problems, I don't think I fully understand what you are trying to do. Can you spell it out like this:

    1.) I call a DID from my Cell Phone.
    2.) Elastix recognizes my CallerID and Routes me to the callback application.
    3.) Elastix Calls me back.
    4.) Some other step.

    If you spell it out like that I might be able to help. Otherwise, I have no idea what you are trying to accomplish. NOTE!!!! Please explain what you want to happen, not what you are doing to try to make it happen.

    Also, I can only suggest that, for the sake of troubleshooting, you should break everything down into steps.

    1.) Create the DID/Inbound Route and point it to an extension.
    2.) Verify that the Inbound route works properly before trying to direct it elsewhere.

    Keep all of the various moving parts isolated as much as possible so you know which one is not working right.

    Tom
     
  8. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    I was trying to atchieve:

    1. I call a DID from my cell phone
    2. DID is set to custom destination (custom-callout) in INBOUND ROUTE
    3. If my cell number is recognized I have dial tone from DISA and can make an outbound call from my cell through Elastix
    4. If my cell is not recognized I have 3 short beeps and hangup

    Regards,

    MST
     
  9. MST

    MST

    Joined:
    Sep 25, 2009
    Messages:
    317
    Likes Received:
    0
    I was trying to achieve:

    1. I call a DID from my cell phone
    2. DID is set to custom destination (custom-callout) in INBOUND ROUTE
    3. If my cell number is recognized I have dial tone from DISA and can make an outbound call from my cell through Elastix
    4. If my cell is not recognized I have 3 short beeps and hangup

    Regards,

    MST
     
  10. dicko

    Joined:
    Oct 24, 2008
    Messages:
    4,099
    Likes Received:
    0
    You can use both CID and (in the logical sense) DID as criteria for your inbound routes, perhaps you overcomplicate matters?
     

Share This Page