11.07.2015 Views

Mizu Webphone - Mizu Voip

Mizu Webphone - Mizu Voip

Mizu Webphone - Mizu Voip

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

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Get details about the last finished call.boolean API_ShowLog()Show a new window with logs.JavaScript NotificationsTo receive notifications and events from the webphone you have to create a java script function called webphonetojs that takes one string parameter. Thewebphonetojs function must be placed in the same html page and same DOM level. If you place it elsewhere, then you must use the jsfunctionpath appletparameter to specify.The webphone will call this functions when something happens –according to the “jsscripevent” applet parameter (status change, error message, call finished,etc) passing the messages as the function parameter. (If your webphonetojs function is embedded in other html elements, then you can give the path by using the jsfunctionpath appletparameter)From the java script code you usually will have to parse the received string. The parameters are separated by comma ‘,’. First you have to check the firstparameter (until the first comma) to determine the event type. Then you have to check for the other parameters according to the specification below.Please note that you can get more than one event at once, separated by newline (,EOL \r\n) so you should check for new lines first and then parse all events.The following messages are defined:STATUS,line,statustext,peername,localname,endpointtypeWhere line can be -1 for general status or a positive value for the different lines.General status means the status for the “best” endpoint.This means that you will usually see the same status twice (or more). Once for general webphone status and once for line status.For example you can receive the following two messages consecutively:STATUS,1,Connected,peername,localname,endpointtype,peerdisplaynameSTATUS,-1,ConnectedYou might decide to parse only general status messages (where the line is -1).The following statustext values are defined for general status (line set to -1):ReadyRegister…Registering…Register FailedRegisteredAcceptStarting CallCallCall InitiatedCalling…Ringing…Incoming…In Call (xxx sec)HangupCall FinishedChatThe following statustext values are defined for individual lines (line set to a positive value representing the channel number starting with 1):Unknown (you should not receive this)Init (webphone started)Ready (sip stack started)Outband (notify/options/etc. you should skip this)Register (from register endpoints)Subscribe (presence)Chat (IM)Setup (call init)InProgress (call init 2)Routed (call init 3)Ringing (SIP 180 received or similar)InCall (call is connected)Muted (connected call in muted status)Hold (connected call in hold status)Speaking (call is connected)Midcall (might be received for transfer, conference, etc. you should treat it like the Speaking status)Finishing (call is about to be finished. Disconnect message sent: BYE, CANCEL or 400-600 code)Finished (call is finished. ACK or 200 OK was received or timeout)Deletable (endpoint is about to be destroyed. You should skip this)Error (you should not receive this)

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

Saved successfully!

Ooh no, something went wrong!