11.07.2015 Views

Mizu Webphone - Mizu Voip

Mizu Webphone - Mizu Voip

Mizu Webphone - Mizu Voip

SHOW MORE
SHOW LESS
  • No tags were found...

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

webphoneobj.API_SetParameter("password", "xxxx");webphoneobj.API_SetParameter("loglevel", "1");webphoneobj.API_Start();webphoneobj.API_Call( -1, "numbertocall");webphoneobj.API_Hangup( -1);sipnotifications.Stop();--------------------------------------SIPNotifications.java--------------------------------------package yourpackage;import java.net.DatagramSocket;import java.net.DatagramPacket;public class SIPNotifications extends Thread{boolean terminated = false;byte[] buf = null;DatagramSocket socket = null;DatagramPacket packet = null;public SIPNotifications(){}public boolean Start(){try{socket = new DatagramSocket(51100);buf = new byte[3600];packet = new DatagramPacket(buf, buf.length);this.start();return true;}catch (Exception e){e.printStackTrace();}return false;}public void Stop(){terminated = true;if(socket != null) socket.close();}public void run(){try{while (!terminated) {packet.setData(buf, 0, buf.length);packet.setLength(buf.length);//DatagramPacket packet = new DatagramPacket(buf, buf.length);socket.receive(packet);if (packet != null && packet.getLength() > 0) {String str = new String(packet.getData(), 0,packet.getLength());ProcessNotifications(str);}}}catch (Exception e){e.printStackTrace();}}public void ProcessNotifications(String msg)

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!