beautypg.com

Udp example, 4 udp example – Grandstream GXV3140 GMI Guide User Manual

Page 27

background image

Grandstream Networks, Inc.

GMI HTML SDK and API Guide

Page 27 of 43

www.grandstream.com

Last Updated: 09/2010

<

h4

>

    Or Hear

<

font

color

=

'yellow'

size

=

"5"

>

The

Music

font

>

they like

h4

>

<

div

>

<

input

id

=

"playsound"

type

=

"button"

value

=

"

"

onclick="mplay

(

'sounds/2.mp3;sounds/hey oh.mp3;sounds/lige.wma;'

)

;"

/>

//Multiple files can be separated by “;

div

>

6.4 UDP Example

This example is a part of the “Call” example. Please scroll down to the end of the

page to view this.

Figure: Send UDP packets to destination host

File: call-iframe.html

function

cb_udp

(

result

)

{

//Obtain the response message sent from the destination host

document

.getElementById

(

"udp_response"

)

.value = result

[

'Message'

]

//Process play result here

//alert(result['Response']);

}

function

udp

(

data

)

{

//Send some string to the specified port of the destination host via UDP. The timeout

time for the response from the server is 5 seconds.

GMIEngine.udp

(

"www.ipvideotalk.com"

,

1500

, data,

5

, cb_udp

)