GotSpeech.NET

The online community for Microsoft Speech Server developers
Welcome to GotSpeech.NET Sign in | Join | Help
in Search
Gold Systems

Passing parameter to dynamic grammar aspx file

Last post 05-30-2006, 6:35 PM by Chris Jansen. 10 replies.
Sort Posts: Previous Next
  •  05-05-2006, 4:50 PM 513

    Passing parameter to dynamic grammar aspx file

    Hello,

    I am generating a dynamic name grammar aspx file depends on the user said phonenumber.

    I tried to pass the phonenumber parameter into grammar page by using query string and session value.

    But i could not able to retreive the values.

    Please provide your suggestions.

    Thanks in advance

    Bala


    Bala
  •  05-05-2006, 5:12 PM 515 in reply to 513

    Re: Passing parameter to dynamic grammar aspx file

    I've tried this before and could not get it to work. I could hard code something into the url but not set it dynamically.

    The problems lies in the fact that for telephony apps the SALT interpreter won't let you modify the DOM.

    You may be able to do something with a post back.

    Have you looked at the dynamic grammar sample in the files section of GS? It may give you some ideas.

     


    Marshall Harrison
    Microsoft MVP, Office Communications Server


    www.GoldSys.com
    W: 303.447.2774
    H: 904.342-6205

    the gotspeech guy
  •  05-05-2006, 8:05 PM 517 in reply to 515

    Re: Passing parameter to dynamic grammar aspx file

    Thanks Marshall. ya i have to try in post back. today i have got one other sample on this and uploaded in files section. I think this will also help.

    Bala


    Bala
  •  05-25-2006, 12:38 AM 700 in reply to 515

    Re: Passing parameter to dynamic grammar aspx file

    marshallharrison:

    The problems lies in the fact that for telephony apps the SALT interpreter won't let you modify the DOM.

    Marshall, I keep reading this from you but I am wondering what this means. In the sample DynamicGrammar there is an aspx page: CreateColorsGrammar.aspx that dynamically produces a grammar.  What is not allowed by what you are saying?  Thanks.


    Speech Served Here Blog  (RSS)
    GotSpeech.Net Podcast  (RSS)

  •  05-25-2006, 7:10 AM 709 in reply to 700

    Re: Passing parameter to dynamic grammar aspx file

    Basically (as I understand it) it means that you can not change the URL string for the grammar at run time. You can put a parameter on the URL but you could not change that parameter at run-time based of the users input.

    Also the dynamic grammar stuff is basically handled like an RPC call so I don't beliee the session variables or semanticitems are available.

    A post back is the only way I know of doing this. But I don't know everything......yet. :-)

     


    Marshall Harrison
    Microsoft MVP, Office Communications Server


    www.GoldSys.com
    W: 303.447.2774
    H: 904.342-6205

    the gotspeech guy
  •  05-25-2006, 11:50 PM 730 in reply to 709

    Re: Passing parameter to dynamic grammar aspx file

    marshallharrison:

    Basically (as I understand it) it means that you can not change the URL string for the grammar at run time.

    Really?

    So, you couldn't have a grammar like:

    http://localhost/StreetGrammar.aspx?Zipcode=<% zipcode %> where zipcode is a variable?

    I didn't know that.

    Makes it difficult to have dynamic grammars.


    Speech Served Here Blog  (RSS)
    GotSpeech.Net Podcast  (RSS)

  •  05-28-2006, 12:11 AM 746 in reply to 730

    Re: Passing parameter to dynamic grammar aspx file

    I've been following this thread, and I guess I don't understand why this is much of an issue. If I understand correctly, you basically can't use a dynamic grammar strictly in client code. But how often would you want to? It seems like for most dynamic grammars, you'd need to access a back-end data source, or some other piece of useful information on the server, to build the appropriate dynamic grammar.

     


    Design and Conquer Blog
  •  05-28-2006, 4:38 PM 748 in reply to 746

    Re: Passing parameter to dynamic grammar aspx file

    Chris Jansen:
    I guess I don't understand why this is much of an issue. If I understand correctly, you basically can't use a dynamic grammar strictly in client code. But how often would you want to? It seems like for most dynamic grammars, you'd need to access a back-end data source, or some other piece of useful information on the server, to build the appropriate dynamic grammar.

     

    Chris, 

    I agree all your dynamic grammars are going to access some sort of back-end data source.  I guess I was thinking of having a grammar for an auto attendant type application being able to accept differen parameters.

    For example: GetNamesGrammar.aspx?Type=Internal or Type=Contractors or Type=ConferenceRooms


    I realize that you could just have seperate .aspx pages for this (GetInternalNamesGrammar.aspx or GetContratorsNamesGrammar.aspx) but it is just nice to keep your code together in one page.  Also, you can cache by query string parameters as well (even though the Speech Server can do that for you.)

    Am I making any sense here or am I going about things the wrong way?



    Speech Served Here Blog  (RSS)
    GotSpeech.Net Podcast  (RSS)

  •  05-30-2006, 12:30 PM 755 in reply to 748

    Re: Passing parameter to dynamic grammar aspx file

    I'm probably just not understanding what you want to do.

    You can pass dynamic content to a grammar built from an aspx page. The distinction is that you have to use an inline grammar, rather than setting the grammar statically in the Property Builder. One source for examples on this is the Banking Alerts reference application. The BillsToPay application of the Dialogs solution builds grammars dymanically by passing dynamic parameters to an aspx page that then builds the grammar. The code-behind then sets the InlineGrammar of a grammar object for the QA.

    Here's a small excerpt of the code-behind, with a comment explaining what's being done:

    // If there is only one bill to pay, we need to generate the correct
    // dynamic grammar (so that saying 'yes' will return, e.g., SML indicating
    // that 'Gas' is to be paid.) In the actual .aspx page, there is a reference
    // to a static grammar that returns the correct SML for one particular case
    // of the single-bill-to-pay case. The dynamic grammar is generated by
    // a page with the same name (except .aspx, instead of .grxml) -- this .aspx page
    // returns a grammar (notice that we pass as query parameters the information
    // necessary to generate the correct grammar), and we then set that result
    // as the inline grammar and clear the 'src' attributed.

    PullDynamicGrammar(PayOneBillQA_DynamicGrammar, String.Format("?UserID={0}&BillsCollectionID={1}", Server.UrlEncode(userID), Server.UrlEncode(billsCollectionID)));

    Is this the sort of thing you're trying to do, or is it something else?


    Design and Conquer Blog
  •  05-30-2006, 1:04 PM 757 in reply to 755

    Re: Passing parameter to dynamic grammar aspx file

    Hi Chris,

    If I'm reading the code correctly (too busy/lazy run it in debugger) PullDynamicGrammar is called on Page_Load and builds the dynamic grammar URL based on parameters passed on the page's URL.

    I believe what the original poster is looking to do is have the grammar from QA2 be dynamic by passing the caller's response to QA1 to the .aspx page that builds the grammar. I don't think this is possible without posting the page for a telephony app. YOu can't change teh DOM after the SALYT interpretor loads it and that is the only way I know of to do someting like this. I'm not sure about multimodal as that is using IE and the DOM should be changeable. I read where someone was using AJAX for something like this.

    Did I understand correctly? Are any of us understanding the question correctly?

    If this is at all possible then we should be able to figure it out as we have some of the best MSS minds around weighing in on this subject.

     


    Marshall Harrison
    Microsoft MVP, Office Communications Server


    www.GoldSys.com
    W: 303.447.2774
    H: 904.342-6205

    the gotspeech guy
  •  05-30-2006, 6:35 PM 760 in reply to 757

    Re: Passing parameter to dynamic grammar aspx file

    Thanks Marshall, the question makes sense to me now. Based on your post, I would agree that it's not possible.

     


    Design and Conquer Blog
View as RSS news feed in XML