Develop an application in java-jain-sip language that uses the sip protocol to make a call

Hello to you, I hope you are well,
I am developing an application which to make a call using the SIP protocol using the jain-sip-api-1.2 library and the jain-sip-ri1.2 library.

I have implemented my stack (the stack) on my local ip address (localhost),using the path name gov.nist

after having created the sip uri address, of my own pc as well as the sipuri of the sipserver entity that I must contact.

and when I create a new client transaction and run the program for the register request, it shows me this error.

you will find attached my code for the implementation of the daughter and the creation of the register request

Exception in thread “main” javax.sip.SipException: IO Error sending request
at gov.nist.javax.sip.stack.SIPClientTransaction.sendRequest(
at softphoneSIP.UAC.register(
Caused by: Network is unreachable: connect
at Method)
at Source)
at Source)

	public  UAC(int Port,String transport,String ippile) throws TransportNotSupportedException, InvalidArgumentException, ObjectInUseException, TooManyListenersException, PeerUnavailableException {
	//dataport pour la reception des flux de données 
	//creation des fabrique 
	Properties stackprop=new Properties();
	//nom de la pile
	stackprop.setProperty("javax.sip.STACK_NAME", "UserAgentClient");
	stackprop.setProperty("javax.sip.IP_ADDRESS", ippile);
	stackprop.setProperty("javax.sip.RETRANSMISSION_FILTER", "true");
	stackprop.setProperty("gov.nist.javax.sip.TRACE_LEVEL", "16");
	//creation de la pile Sip
	listenningpoint=sipstack.createListeningPoint(sipstack.getIPAddress(), Port,transport);

public void register() throws ParseException, InvalidArgumentException, SipException {
	 Address adrproxy;
	 Address adrlogique;
	 Address adrphysique;
	 String nomdomaine=null;
	 String nomuser=null;		

	//la c'est le nom utilisateur
			String nomusersystem=System.getProperty("");

			//creation de l'adresse du proxy ou l'entite sip  sur la quelle on veut envoyé de message 
			javax.sip.address.URI requestURI = adrproxy.getURI();
			System.out.println("debuug9H  "+""+requestURI);

			String uriphy=listenningpoint.getIPAddress()+""+listenningpoint.getPort();
			//creation de SIPuri
			SipURI sipuri= addressFactory.createSipURI(nomusersystem, uriphy);
			System.out.println("debuug "+""+sipuri);
			adrphysique = addressFactory.createAddress(nomusersystem, sipuri);
			System.out.println("debuug   "+" "+adrphysique);
			//construire l'entete SIPFrom 
			//nom du domaine du proxy ou l'entite que on veut contatcer
			SipURI urilogique = addressFactory.createSipURI(nomuser, nomdomaine);
			adrlogique=addressFactory.createAddress("TestTahar2", urilogique);

			//creation du champs d'en-tete CallId
			CallIdHeader callidheader=sipprovider.getNewCallId();

			//creation Cseq n° de sequence  de transaction au sein d'une session ou dialogue
			CSeqHeader cseqHeader= headerfactory.createCSeqHeader(cSeq++,Request.REGISTER);

			//creation du champs MaxForward le nombre amximum de sauts
			MaxForwardsHeader maxforward=headerfactory.createMaxForwardsHeader(70);


			//creation de l'entet from et contacts ici math.random represente le tag du champs from ??
			FromHeader fromHeader= headerfactory.createFromHeader(adrphysique, ""+new Random().nextInt());

			ContactHeader contactheader=headerfactory.createContactHeader(adrphysique);
			int expires=6000;
			//creation de l'entete to
			ToHeader toheader=headerfactory.createToHeader(adrlogique, null);
			System.out.println("debuug "+""+toheader);

			//creation de l'entéte via ici on peut fixe le type de transport a udp/tls/smtp
			ArrayList<ViaHeader> via=new ArrayList<ViaHeader>();
			ViaHeader viaheader= headerfactory.createViaHeader(listenningpoint.getIPAddress(), listenningpoint.getPort(), listenningpoint.getTransport(), null);
			//creation du message grace a request
			//creation content type ici normalment sa sera en texte???
			contenttypeheader=headerfactory.createContentTypeHeader("text", "txt");
			System.out.println("debuug2 "+""+contactheader.getName());
			//adproxy @ de  l'entite ou on veut adresse le message
			Request register= messageFactory.createRequest(adrlogique.getURI(), Request.REGISTER, callidheader, cseqHeader, fromHeader, toheader, via, maxforward, contenttypeheader, contactheader);
			//Request register= messageFactory.createRequest(requestURI, Request.REGISTER, callidheader, cseqHeader, fromHeader, toheader, via, maxforward, contenttypeheader, contactheader);
			//Creation de la transaction "la requette register est base sur le type transaction pas dialogue " on peut les ajouetr une nouvelle declaration en cas ou des erreurs
			//envoi du message 


thank you in advance for your help, and logged so that I can correct this errors and register on the sipserver.

Asterisk is your “sipserver” ?

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.