• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Msg not received by SIP client

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,

I wrote a simple Midlet with eclipseMe on Debian, implementing a SIP client.
I used WTK2.5 as the SIP server.
I saw that the registration msg was received by the SIP server and the authentication request was also generated by the SIP server. Unfortunately, the msg was not received by notifyResponse() although it appeared in wireshark.

Any hint ?
Thanks in advance,
Fabien

public class TestSipClient implements SipClientConnectionListener
{

public void test(String msg)
{
try
{
// state->CREATED
SipClientConnection sc = (SipClientConnection) Connector.open("sip:fabien@localhost:5060");
sc.setListener(this);
// state->INTIALIZED
SipConnectionNotifier scn=null;
sc.initRequest("REGISTER", scn);
// Builds the URI for REGISTER
sc.setHeader("To", "sip:fabien@pc-debian");
sc.setHeader("From", "sip:fabien@pc-debian");
sc.setHeader("Contact", "sip:fabien@pc-debian:5060");
// state->PROCEEDING
sc.send();
}

catch (IllegalArgumentException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (SipException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}

}

/**
* @param arg0
*/
public void notifyResponse(SipClientConnection sc)
{
// TODO Auto-generated method stub
// wait maximum 15 seconds for response
try
{
System.out.println("Client:notifyResponse");
boolean ok = sc.receive(15000);

if(ok) { // response received
int l_rsp = sc.getStatusCode();
switch(l_rsp)
{
case 100: System.out.println("Client:Essai");
break;
case 180: System.out.println("Client:Sonnerie en cours");
break;
case 181: System.out.println("Client:Appel en cours de transmission");
break;
case 182: System.out.println("Client:En file d'attente");
break;
case 183: System.out.println("Client:Avancement de la session");
break;
case 200: System.out.println("Client:200 OK");
break;
default: System.out.println("Client:status non trait�"+Integer.toString(l_rsp));
}

}
//sc.close();
}
catch (SipException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
catch (IOException e)
{
// TODO Auto-generated catch block
e.printStackTrace();
}
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"Fabien Rta",
Please check your private messages regarding an important administrative matter.
-Ben
 
If a regular clown is funny, then a larger clown would be funnier. Math. Verified by this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic