< Previous by Date Date Index Next by Date >
< Previous in Thread Thread Index Next in Thread >

Re: [reSIProcate-users] Content-type header + Register with Domainname


In brief I need to sent  similar packet as follows to SIP server 192.168.0.51 to port 5060 where domainame is sv7000.com
 
      REGISTER sip:sv7000.com SIP/2.0
      Via: SIP/2.0/UDP 192.168.0.100:5060;branch=z9hG4bK333C03FB89130654F27E84972BEE6FB3;rport
      From: "163" <sip:163@xxxxxxxxxx>;tag=11E027407CF238F3A3811163B39B99B9
      To: "163" <sip:163@xxxxxxxxxx>
      Contact: <sip:163@xxxxxxxxxxxxx:5060;transport=udp>
      Call-ID: [call_id]
      User-Agent: Kapanga Softphone Desktop Windows 1.00/2178+1248290330_0013025E3F8F_005056C00001_005056C00008
      Supported: timer, replaces
      CSeq: 1 REGISTER
      Expires: 3600
      Event: registration
      Max-Forwards: 70
      Allow-Events: message-summary, registration
      Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
      Content-Length: 0


From: Rajan, Nihar
Sent: Thu 3/4/2010 4:08 PM
To: Scott Godin
Cc: resiprocate-users@xxxxxxxxxxxxxxx
Subject: RE: [reSIProcate-users] Content-type header + Register with Domainname

Hi Scott,
 Thanks for your help. Now I managed to set the IP address properly of the DNS server. But  can not see resiprocate send any SIP Register message to server.
It sends one DNS packet and when SIP server replies with some ICMP packet it shows destination unreachable. I attached wireshark trace and Appl screen log
for your reference. Please help I think I am very near and making some small mistake.
 
I put following codes for passing address in stack:
 

DnsStub::NameserverList DnsServer;

sockaddr_in SockIPV4;

SockIPV4.sin_family = AF_INET;

SockIPV4.sin_port = htons(5060);

SockIPV4.sin_addr.S_un.S_addr = inet_addr("192.168.0.51");

DnsServer.push_back(SockIPV4);

const DnsStub::NameserverList &DnsServer1 = DnsServer;

SipStack stack(NULL,DnsServer1);

I also tried setting NIC address properly but got same reply .

I also used SIPp tool for testing and found if I sent following packet to 192.168.0.51 I am able to register with same NIC setting .

       REGISTER sip:sv7000.com SIP/2.0
      Via: SIP/2.0/UDP 192.168.0.100:5060;branch=z9hG4bK333C03FB89130654F27E84972BEE6FB3;rport
      From: "163" <sip:163@xxxxxxxxxx>;tag=11E027407CF238F3A3811163B39B99B9
      To: "163" <sip:163@xxxxxxxxxx>
      Contact: <sip:163@xxxxxxxxxxxxx:5060;transport=udp>
      Call-ID: [call_id]
      User-Agent: Kapanga Softphone Desktop Windows 1.00/2178+1248290330_0013025E3F8F_005056C00001_005056C00008
      Supported: timer, replaces
      CSeq: 1 REGISTER
      Expires: 3600
      Event: registration
      Max-Forwards: 70
      Allow-Events: message-summary, registration
      Allow: INVITE, INFO, PRACK, ACK, BYE, CANCEL, OPTIONS, NOTIFY, REGISTER, SUBSCRIBE, REFER, PUBLISH, UPDATE, MESSAGE
      Content-Length: 0

Regards,

  ND



From: slgodin@xxxxxxxxx on behalf of Scott Godin
Sent: Wed 3/3/2010 9:59 PM
To: Rajan, Nihar
Cc: resiprocate-users@xxxxxxxxxxxxxxx
Subject: Re: [reSIProcate-users] Content-type header + Register with Domainname

From the logs you can see that it is trying to resolve sv7000 from a DNS server at 127.0.0.1.  Is there a DNS server running locally?  Assuming you didn't pass a DNS server address into the Stack when you created it, resip will query the default NIC for the configured address of the DNS server - perhaps you have that configured wrong.
INFO | 20100303-114530.953 | basicRegister.exe | RESIP:DNS | 2452 | aresdns.cxx:
114 | DNS initialization: found  1 name servers
INFO | 20100303-114530.968 | basicRegister.exe | RESIP:DNS | 2452 | aresdns.cxx:
117 |  name server: 127.0.0.1
ERR | 20100303-114536.078 | basicRegister.exe | RESIP:DNS | 2452 | dnsstub.cxx:4
50 | Unknown error Timeout while contacting DNS servers for sv7000
Scott

On Tue, Mar 2, 2010 at 10:55 PM, Rajan, Nihar <nihar.rajan@xxxxxxxxxxxxxxxx> wrote:
Hi Scott,
 
I tried removing port from the AOR but still failed to send register message to the destination SIP server.
I put the screen logs in attachment. Found that DNS lookup failed.
Please help. why it can happen?
 
Thanks

Regards,
  ND

From: slgodin@xxxxxxxxx on behalf of Scott Godin
Sent: Wed 3/3/2010 9:42 AM Subject: Re: [reSIProcate-users] Content-type header + Register with Domainname

You don't need to do anything special to enable DNS resolution.  One potential problem I see with your AOR is that you are including the port number on it.  This is not good practice.  In fact it will have the effect of directing the resip stack to not do the NAPTR or SRV record DNS lookups, since the SRV DNS records are intended to specify the destination host and port.  I suspect the domain name sv7000.com is expecting a client to do an SRV lookup successfully.  Try removing the :5060 from the registration AOR.
 
Scott

On Mon, Mar 1, 2010 at 5:21 AM, Rajan, Nihar <nihar.rajan@xxxxxxxxxxxxxxxx> wrote:
Hi Scott,
 
  Thanks for ur help. Now i manged to resolve this issue but i have another problem while registering. I want to register client with the SIP server
using Domain Name instead of Ip address.
I followed the sample basicRegister provided with open source. I found if I pass

NameAddr userAor(

" 163 <sip:163@xxxxxxxxx:5060>") it sends register message to 10.8.2.40. But I want to pass domainname  like " 163 <sip:163@xxxxxxxxxx:5060>" 

instead of IP address. So I changed IP address with domain name. But failed to set destionanion IP address

can you please help me how to set dest IP address with domain name in this stack.

 

Regards,

  ND



From: slgodin@xxxxxxxxx on behalf of Scott Godin
Sent: Wed 2/24/2010 1:17 AM
To: Rajan, Nihar
Cc: resiprocate-users@xxxxxxxxxxxxxxx
Subject: Re: [reSIProcate-users] Content-type header

The code to add the parameter to the header looks correct, I'm guessing you are just adding it in the wrong spot.  There should be a way to do what you need without modifying the core resip code.  Judging from your code below you are interested in modifying the outbound MESSAGE request - are you using ClientPagerMessage to send MESSAGE requests, or are you sending within the context of an InviteSession (ie. InviteSession::message )? 

Scott

On Mon, Feb 22, 2010 at 9:42 PM, Rajan, Nihar <nihar.rajan@xxxxxxxxxxxxxxxx> wrote:
Hi All,
 
I hope it is the right forum to ask this question.
 I am using resiprocate basicmessage application to send one message to remote SIP phone.
I need to set "Content-Type: text/plain ;charset=iso-8859-1" otherwise I get unsupported MediaType error.
By adding following line of code I can get "Content-Type: text/plain "
 
clientDum.getMasterProfile()->addSupportedMimeType(MESSAGE, Mime("text", "plain"))
 
I want to add charset = UTF-8 in content-type header. So what extra work I need to do?
 
I tried by adding following codes in resip\dum\BaseCreator.cxx  makeInitialRequest()

SharedPtr<SipMessage> mLastRequest;

mLastRequest->header(h_ContentType).param(p_charset) = "UTF-8";
 
but failed to get desired result still "Content-Type: text/plain "
 
Please help.
 
Regards,
  ND

_______________________________________________
resiprocate-users mailing list
resiprocate-users@xxxxxxxxxxxxxxx
List Archive: http://list.resiprocate.org/archive/resiprocate-users/