| CCXML 1.0-W3C Development Guide | Home | Frameset Home |
| delay | Data Type: (ECMAScript Expression) | Default: none - attribute is optional |
The delayattribute is used to specify a length of time that the <send> action should be delayed. Control is immediately returned to the application, but the event indicated in the <send> tag itself will be delayed, hence, there is no noticable application delay as this processes. Also be aware that the strict time formatting in the Voxeo mimplementation allows only milliseconds to be specified, (example: '1000ms'). Be aware that the queue for sending events must be maintained locally and any events waiting to be sent must be purged when the session that issued this request terminates. | ||
| hints | Data Type: (ECMAScript Expression) | Default: Optional |
The hints attribute can be used to specify information used by the platform to configure the event processor. The value of this attribute should equate to an object that contains an array property of "headers"; for instance:Note that 'hints.headers' stores what headers to add to the sip request, and that only headers starting with an 'x-' prefix are sent. | ||
| name | Data Type: (ECMAScript Expression) | Default: none - attribute is required |
| The name attribute is used to specify and ECMAScript string expression evaluating to the event type to be thrown. Event names are case insensitive, and may be alphanumeric in format, but the first character event name cannot be a period ".". If name is left unspecified, and no inline content is denoted, then an error.fetch event will be thrown. Additionally, it is a requirement to use name or inline content exclusively, i.e., if boh are specified, then an error.fetch will be thrown. | ||
| namelist | Data Type: STRING | Default: none - attribute is optional |
| The namelist attribute denotes the space-separated list of variable names to be <sent>. The variables will then be available as a variable/value pair in the resultant URI querystring that is sent to the server. | ||
| sendid | Data Type: (ECMAScript Expression) | Default: Optional |
| The sendid attribute specifies an ECMAScript expression evaluating to a previously defined variable. The value of the attribute must receive an internally generated unique string identifier to be associated with the event being sent. If this attribute is not specified, the event identifier must be dropped. | ||
| target | Data Type: (ECMAScript Expression) | Default: none - attribute is required |
| The target attribute denotes the user-defined identifier for the target CCXML document. Do note that it is totally legal for a CCXML program to send an event to itself! | ||
| targettype | Data Type: (ccxml/dialog/basichttp) | Default: Optional (ccxml) |
The targettype attribute specifies and ECMAScript string expression that evaluates to the type of Event I/O Processor that the event is to be sent to. Allowable values are:
| ||
| (Assuming that our 'AnyCoolPage.php' was to write our <sent> values to a text file, this is what we would see) myEvent myReturnVar=foo myReturnVar2=foo2 myReturnVar3=foo3 |
| <?xml version="1.0" encoding="UTF-8"?> <ccxml version="1.0"> <eventprocessor> <transition event="connection.alerting"> <accept/> </transition> <transition event="connection.connected"> <log expr="'***** CALL WAS ANSWERED *****'"/> <dialogstart src="'sendDialog.vxml'" type="'application/voicexml+xml'" dialogid="myDialogID"/> <send name="'timeout'" target="myDialogID" delay="'10s'" targettype="'dialog'" /> </transition> <transition event="error.dialog.notstarted'"> <log expr="'****** ERROR.DIALOGNOTSTARTED.NAME = ' + event$.name"/> </transition> <transition event="send.successful"> <dialogterminate dialogid="myDialogID"/> </transition> <transition event="dialog.exit"> <log expr="'***** CALL EXITING *****'"/> <exit/> </transition> </eventprocessor> </ccxml> |
| <?xml version="1.0" encoding="UTF-8"?> <vxml version = "2.1" > <form> <block> <prompt> The wheels on the bus go round and round. Round and round. Round and round. The wheels on the bus go round and round. All through the town. </prompt> <goto next="SendDialog.vxml"/> </block> </form> </vxml> |
| ANNOTATIONS: EXISTING POSTS |
jbuehring
|
|
| On our test-bed installation of Prophecy 8.0.x, it appears to be the default behavior of the send element when using basichttp to transmit namelist data as base64-encoded HTTP POST. In this case, the target's server-side logic needs to process it accordingly before the data can be meaningful to it.
The way around this appears to be to specify 'http.get' as the name attribute, which transmits the namelist in plain-text via the HTTP GET method. Needless to say, this caveat should be documented, both in the send element's page, and in Appendix G! |
|
VoxeoBrian
|
|
| Hello,
You are correct, it is possible to specify the name attribute as http.get, which will transmit your parameters as plain text via GET. This however is not valid per the CCXMl specification and is a "hack", if you will that was created for our specific platform implementation. Allowing CCXML sends via GET is not something provided by the specification and as such was not included in the documentation. I will however make note of this, as I believe this should be documented for future use. Please let us know if you have any additional questions, we are always happy to help. Regards, Brian |
|
chaubkit
|
|
| Can you please give me an sample or further explanation on the "inline content". I don't know how to implement this.
Thanks, Chau - dhchau@tma.com.vn |
|
voxeojeff
|
|
| Hi Chau,
I'm a bit confused by your request here. Could you please clarify what you are looking for, or referencing here? I am happy to help, however more information will be needed here in order to do so. :-) Best regards, Jeff |
|
chaubkit
|
|
| Hi Jeff,
For the name attribute of <send> tag: "If name is left unspecified, and no inline content is denoted, then an error.fetch event will be thrown. Additionally, it is a requirement to use name or inline content exclusively, i.e., if boh are specified, then an error.fetch will be thrown." Could you please show me what is "inline content"? and how to implement this? illustrating by an example is very very clear for me... Big Thanks, Chau Duong |
|
voxeojeff
|
|
| Hi Chau,
Thanks for the clarification there. The inline content you refer to is shown (with a nice example and explanation) in the W3C CCXML specification. I'll attach a link for you below to review. http://www.w3.org/TR/ccxml/#Send Hope this helps, Jeff |
|
jbuehring
|
|
| Consider the following (very) abridged snippet of example CCXML, running on a Premise-based installation of Prophecy 8.0.177.0:
<eventprocessor statevariable="app_state"> ... <transition state="finishing" event="process" name="evt"> <assign name="status" expr="successful"/> <assign name="app_state" expr="'processing'"/> <send name="'http.get'" target="'processor.php'" namelist="status" targettype="'basichttp'" /> </transition> <transition state="processing" event="send.successful" name="evt"> <exit/> </transition> ... </eventprocessor> Regardless of whether or not there are things taking place prior to the <exit> element in that code, the resulting HTTP send never happens, and my PHP script remains untouched. However, if I do something along these lines: <eventprocessor statevariable="app_state"> ... <transition state="finishing" event="process" name="evt"> <assign name="status" expr="successful"/> <assign name="app_state" expr="'processing'"/> <send name="'http.get'" target="'processor.php'" namelist="status" targettype="'basichttp'" /> </transition> <transition state="processing" event="send.successful" name="evt"> <assign name="app_state" expr="'kill'" /> <send name="'killme'" target="ccxmlid" targettype="'ccxml'"/> </transition> <transition state="kill" event="killme" name="evt"> <exit/> </transition> ... </eventprocessor> This makes everything all right with the universe, and I see the request come into my PHP script as it should. Hence, I am unsure if this is a bug, or my inherent lack of understanding into how the HTTP I/O processor works in tandem with Prophecy -- thusly, that it is operating as it should. Though, I call into question the real difference of placing the <exit> element within the "send.successful" event itself, versus calling another transition that then executes the <exit> element. I personally wouldn't think the execution time between the two scenarios to be that much of a difference if, in fact, there is a race condition to fire off that HTTP GET prior to the CCXML thread being effectively cut off at the neck. Any thoughts? Insights? If anything, hopefully this helps anyone else running into a similar situation... I shall also post this as a forum topic. |
|
voxeojeff
|
|
| Hello,
This is actually working as intended, and is not a bug. Per the W3C spec, [color=blue]"This event is thrown when an event is successfully delivered to the specified receiver. Receipt of the event does not imply the event has been processed by the receiver but simply that it has been sent without error."[/color] http://www.w3.org/TR/ccxml/#s9.3.6 As it relates to our platform, a <send> will queue the request, but not perform it immediately. As CCXML is asynchronous, an <exit/> immediately after the <send> will more than likely cause the app to exit prior to the fetch. This is something that our engineers want to change, however as it stands now this is the intended behavior. The proper way of transitioning this and exiting *after* the fetch is done is to do what you did in your second example. I hope this helps clarify, please let me know if you have any further questions. Best regards, Jeff |
|
nirav.dave
|
|
| i would like to ask that, what if i want to pass numeric data using <send> tag.
i mean after dialing a number, i want to pass extension number after 5 second, than what can be a tag ? |
|
voxeojohnq
|
|
| Hello,
You can pass whatever data you would like with a <send> element via the "namelist" attribute. For example: <transition event="some_event"> <!-- assign your digits to a variable --> <var name="digits" expr="'1234'" /> <!-- send the digits var to the next transition with a send after 5 seconds --> <send name="'next_trans'" target="session.id" namelist="digits" delay="'5000ms'" /> </transition> <transition event="next_event"> <!-- retrieve the digits with event$ --> <log expr="'*** You sent ' + event$.digits" /> </transition> I hope this helps! Regards, John Quinn Voxeo Support |
|
mho
|
|
| Thanks voxeojohnq. that comment about
<send name="'next_trans'" target="session.id" namelist="digits" delay="'5000ms'" /> really helped. Here is something that may save someone some time: A <send> right before <exit/> does not get through (like if you are trying to tell your app server that you got disconnected) so here is a quick hack to get around it: <transition event="connection.disconnected"> <assign name="status" expr="'Got disconnected'"/> <send targettype="'basichttp'" target="'http://www.myappserver.com/mywatcher'" name="'http.get'" namelist=" status "/> <send name="'userexit'" target="session.id" delay="'2000ms'" /> </transition> <transition event="userexit"> <log expr="'***** We are exiting now ' "/> <exit/> </transition> |
|
voxeoJeffK
|
|
| Hi mho,
The failure condition of trying to <send> just before an <exit/> is actually a bug that is being addressed. Using the delayed <send> is a great workaround. Thanks, Jeff K. |
|
bpcamac
|
|
| Is there a way to specify that an HTTP request be sent via a POST instead of a GET? | |
voxeoJohn
|
|
| Hi!
We are aware that currently this feature is not clearly documented in the <send> elements documentation, the reasoning is that what I am about to tell you is not to W3C Spec. It is a proprietary Voxeo workaround to allow users to use [b]POST[/b] instead of [b]GET[/b]. Because this feature is not to w3c spec I want to make clear that it could removed at any time. However, I think we can safely assume that until the spec changes to include a method of accomplishing this we will most likely not be removing it. I just wanted to be clear on the point that it [b]could[/b] be removed some time in the future! Anyways, onto the hack, I mean 'work-around': To change from [b]POST[/b] to [b]GET[/b] we just make use of the name attribute and specify our type. Example: [code] <send target="'http://127.0.0.1:9990/214530.php'" targettype="'basichttp'" namelist="myId" name="'http.get'"/> [/code][code] <send target="'http://127.0.0.1:9990/214530.php'" targettype="'basichttp'" namelist="myId" name="'http.post'"/> [/code] I hope that helps, please let us know if there is anything else that we can do in the future! Regards, John Customer Engineer |
|
bpcamac
|
|
| Thanks, John. I'll keep that advisory in mind.
A simple question: if the HTTP GET request returns the line: someParam=5 How do you accept the result and access the parameter's value the CCXML environment (script)? |
|
voxeoJohn
|
|
| Hi,
You would make use of the [b]event$[/b] object to access the return data from the namelist's. A great place to check this out is in [url=http://docs.voxeo.com/ccxml/1.0-final/appendixg_ccxml10.htm]Appendix G[/url] of the CCXML Documentation. I will still include a small snipped of code illustrating this usage for you, but the link above with me much more detailed! [code] <transition state="init" event="ccxml.loaded"> <send target="'sendTarget.php'" name="what_i_sent" namelist="myVar" delay="'1s'" targettype="'basichttp'"/> <assign name="statevar" expr="'state1'"/> </transition> <transition event="myEvent" state="state1"> <var name="myObj" expr="JSON.parse(event$.myVar)"/> <log expr="'***** DATA RECIEVED FROM SERVER *****'"/> <log expr="'***** myObj = ' + myVar"/> </transition> [/code] Hope that clears this up for you, please let us know if there are any other questions!! Regards, John Customer Engineer |
|
shawnaslam1
|
|
| Hello,
I have just read the post from Voxeo side about using the post instead of Get.There are almost 20 to 25 IVR's running on our live production to secure our data we are really ant to use post instead of Get.My question is can we use Post in ccxml.But what thread i got is if you stop using the Post then what will we do as we have our live compaigns. What is your suggestion. Regards, Shawn |
|
VoxeoDustin
|
|
| Hey Shawn,
I'm not entirely certain I completely understand your question. Using name="'http.get'" is a workaround for enabling GET when using this element. However, CCXML <send> uses POST by default, so nothing extra is necessary to enable POST when using this element. Let me know if you have any further questions. Cheers, Dustin |
|
shawnaslam1
|
|
| So Dustin if you are not certain it's mean you are not recommending me to use it on live applications.Right?
Regards, Shawn |
|
VoxeoDustin
|
|
| Hey Shawm,
<send> is perfectly fine to use on live applications. I was not completely clear on what your question was. If my answer is not what you were looking for, let me know. Thanks, Dustin |
|
shawnaslam1
|
|
| Dustin,
you are saying if i am not wrong that in my send request if i am not using name='http.get' then its mean request will be post request. Below is my request which i am sending through CCXML <send data="'user.DBReturn'" target="'../firstHorizon_submitGet.do'" namelist="status success" targettype="'basichttp'" /> Is this a Post request? Regards, Shawn |
|
voxeojeremyr
|
|
| Hi Shawn,
You are absolutely correct. By default the <Send> element will use 'post' to send the parameters. You can of course specify it just like you can specify get by using 'basichttp.get' and 'basichttp.post' in your target type. Thanks, Jeremy Richmond Voxeo Support |
| login |