IVR Go Back

Jul 31, 2013 at 4:16 PM
I have successfully used this code to add a option in my IVR (FreePBX 2.11) to lookup data in my database and respond it back to the caller. I cannot find how to return the caller back to previous IVR prompt.
Any help would be appreciated.
Coordinator
Jul 31, 2013 at 4:26 PM
Are you using the CustomIVR as a template? I assume you're wanting to move back up the tree, in which case, I would imagine you just need to set the submenu back to 0 to play the announcements, unless i am not understanding your problem.
Jul 31, 2013 at 6:33 PM
No I used your template as a starting point. I created the whole IVR through FreePBX and created an extention in extensions_custom.conf to have an extention point to my FastAGI code.
So in the IVR through the FreePBX system, I point option 1 to a MISC Destination to my extention in the CONF.
It works fine...now when my FastAGI code is finished it returns back to where it left off in the extensions_Custom.conf. I have for now put the code
exten => 202,2,Goto(ivr-45,s,1)

But I would like to make it more generic and do something like
exten => 202,2,Goto(Where You Came From,s,1)

so the AGI can be used anywhere as a breakout.

I don't know if it is possible either, I would guess the correct question is, in the DialPlan is there a way to know the previous location and just pass it back to the GoTo? I figure this has nothing directly to do with this project but figured it was a good place to ask.
Coordinator
Jul 31, 2013 at 8:44 PM
Take a look at the request object (AGIRequest) passed in the Service method of AGIScript. It has some properties, which include Priority and Extension. It also has the context. These are correct at the time the AGI Script was started. I think you should be able to use this to achieve your goal.
Jul 31, 2013 at 9:40 PM
I looked at that, you can see below I have only updated the callerId fields & Channel & Dnid:
  • AccountCode 'request.AccountCode' threw an exception of type 'System.Collections.Generic.KeyNotFoundException' string {System.Collections.Generic.KeyNotFoundException}
    CallerId    "19-44------7"  string
    callerIdCreated false   bool
    CallerIdName    "19-44-------7" string
    CallingAni2 0   int
    CallingPres 0   int
    CallingTns  0   int
    CallingTon  0   int
    Channel "SIP/Telecom ----- 1-000221a9"  string
    Context "from-internal" string
    Dnid    "1855----4-5"   string
    Enhanced    false   bool
    Extension   "201"   string
    Language    "Array" string
  • localAddress {10.10.21.9} System.Net.IPAddress
  • LocalAddress {10.10.21.9} System.Net.IPAddress
    localPort   4573    int
    LocalPort   4573    int
  • parameterMap null System.Collections.Generic.Dictionary<string,System.Collections.Generic.List<string>>
    parameters  null    string
    Priority    1   int
    rawCallerId null    string
    Rdnis   null    string
  • remoteAddress {10.10.21.25} System.Net.IPAddress
  • RemoteAddress {10.10.21.25} System.Net.IPAddress
    remotePort  4573    int
    RemotePort  4573    int
  • request Count = 21 System.Collections.Generic.Dictionary<string,string>
  • Request Count = 21 System.Collections.IDictionary {System.Collections.Generic.Dictionary<string,string>}
    RequestURL  "agi://10.10.21.9/GetMinutes"   string
    Script  "GetMinutes"    string
    script  "GetMinutes"    string
    Type    "SIP"   string
    UniqueId    "1375306485.177172" string
    
I could theoretically figure it out through the UniqueId but that seems like a lot more work than it should be.?.?
Jul 7, 2014 at 10:23 AM
To whom it may concern,

i have the following application to develop. A customer calls and the IVR system will ask the customer to enter a 4 digit number.
after that i have to redirect the call to an external number. From what i read in this thread i think the customIVR template can help me to develop
my application. My question is from where i can download the customIVR template?

thanks,
Eft
Coordinator
Jul 8, 2014 at 8:07 AM