Calling All Geeks,
SIP has been quite a stir now but i am doubtful that it is very flexible with other opensource. Well for the time being i was trying to send a SIP register request to a Registrar present in another system through WTK 2.5 emulator .I am able to send my request but i am not able to get a 200 OK response , i keep gettng '401 UNAUTHORIZED'. After analyzing my REGISTER packet that is sent via Network Monitor tool i was able to find out that the port number in the contact field is different than the source port number from where my message is being sent, according to SIP experts this is the problem.
i am using the folliwing code to get the random port number..
scn = (SipConnectionNotifier)Connector.open("sip:*;type=\"application/octet-stream\"");
//----
ctaddr = new String("sip:100@"+scn.getLocalAddress()+ ":" + scn.getLocalPort());
the "scn.getLocalPort()" <<-- gives the port number that have been opened automatically and since i have used the shared mode to open the connection the port nuber is supposed to be taken care by the system not by the application.
but the WTK 2.5 open a different port and the system which is running this app is opening a different port for the coonection to the SIP registrar. Now the SIP packet is coming back to port specified by the system which is further not letting a possible binding and the Authorization fails.
i am using the following SIP packet.
SipClientConnection scc = null;
// Open a SipClientConnection for REGISTER targeting the
// registrar address
scc = (SipClientConnection) Connector.open("sip:172.16.xx.xx:5060");
scc.initRequest("REGISTER", scnn);
// Set necessary headers
scc.setHeader("From", "-my ipaaddress-");
scc.setHeader("To", "-my ipaddress-");
scc.setHeader("Contact", "Registrar IP address");
scc.send();
--------
Since i need only one port to which i have to register (and unlike the System port and emulator port confusion). I tried the whole application on NOKIA E65 but now this application is giving me an error saying. --> RuntimeException: Initialization of the request failed. Error code :-6
If after going thru the whole scenario you are not able to understand something or u want details in something.please send a replyi'll elaborate the question..
Many Thanks

Reply With Quote
arams:xml:ns

