[SIPForum-discussion] Softphone with SIP

younes benkhadaj youness_benkhadaj at hotmail.com
Mon Mar 30 15:06:16 UTC 2009


Hi everybody,i'm working on a internship subject to build a softphone,I'm usinf the JSIP API,I'm having trouble into starting a sip call between two clients,in fact I need to call the asterisk server and then this server should transfer this call to the second client.I'll show you here the source code i wrote :

 

SipUri uri = new SipUri( "sip:taha at 155.132.215.237" ); 

SipUri uri2 = new SipUri( "sip:taha at 155.132.215.182" );
 

SipClient client = SipClient.getSipClient(); 
SipClient client2= SipClient.getSipClient();
 

SipUser user = null;
 

client.setDefaultUserMode( true );
client.setExplicitProxyMode( false );
 

client2.setDefaultUserMode( true );
client2.setExplicitProxyMode( false );
 

 

client.setCallForward( false );
client.setCallForwardUri( null );
client.setCallForwardMessage( null );
client.setMaxForwards( 0 );
client.setBusyMessage( null );
client.setHideViaMode( SipClient.HideHop );
 

client2.setCallForward( false );
client2.setCallForwardUri( null );
client2.setCallForwardMessage( null );
client2.setMaxForwards( 0 );
client2.setBusyMessage( null );
client2.setHideViaMode( SipClient.HideHop );
 

user = new SipUser( client, uri );

SipUser user2 = new SipUser( client2, uri2 );

if ( DEBUG ) System.out.println( "SipClient: initialization complete" );
 

// create a REGISTER message to a server 
String serveurl = "sip:@155.132.215.182"; 
 
 

SipRegister reg = user.addServer( serveurl ); 
SipRegister reg2 = user2.addServer( serveurl);
 

reg.requestRegister( "nopass" );
reg2.requestRegister( "nopass" );

_________________________________________________________________
Invite your mail contacts to join your friends list with Windows Live Spaces. It's easy!
http://spaces.live.com/spacesapi.aspx?wx_action=create&wx_url=/friends.aspx&mkt=en-us
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://sipforum.org/pipermail/discussion/attachments/20090330/814c2c2d/attachment-0002.html>


More information about the discussion mailing list