[SR-Users] [sr-dev] SRV record in via header not resolving.

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 27 17:22:59 CEST 2012


Can you provide the patch taken with 'diff -u' or 'git diff' -- it is 
easier to understand what parts you refer to and were updated.

Cheers,
Daniel

On 9/27/12 12:31 AM, Jijo wrote:
> Hello,
>
> I'm observing  that Via Header domain name of type SRV is resolving as 
> DNS A.
>
> I looked at the code and it does support only A. It is 
> basically setting to default SIP port  check_via_address which is 
> causing DNS A query.
>
> Is there any specific reason to do so?
>
>
>
> I changed the code to support SRV as below and working fine.
>
> static int check_via_address(struct ip_addr* ip, str *name,
> unsigned short port, *short proto*, int resolver)
> {
> :
> :
> //if (port==0) port=SIP_PORT;
> if (resolver&DO_DNS){
> DBG("check_via_address: doing dns lookup\n");
> /* try all names ips */
> he=sip_resolvehost(name, &port,*(char *) &proto*); /* don't use naptr */
> if (he && ip->af==he->h_addrtype){
> for(i=0;he && he->h_addr_list[i];i++){
> if ( memcmp(&he->h_addr_list[i], ip->u.addr, ip->len)==0)
> return 0;
> }
> }
> }
> :
> :
> :
> }
>
>
> /* check if IP address in Via != source IP address of signaling */
> int received_test( struct sip_msg *msg )
> {
> int rcvd;
>
> rcvd=msg->via1->received
> || check_via_address(&msg->rcv.src_ip, &msg->via1->host,
> msg->via1->port,*msg->via1->proto*, received_dns);
> return rcvd;
> }
>
>
>
> Thanks
> Jijo
>
>
>
> _______________________________________________
> sr-dev mailing list
> sr-dev at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-dev

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio Advanced Training, Berlin, Nov 5-8, 2012 - http://asipto.com/u/kat
Kamailio Advanced Training, Miami, USA, Nov 12-14, 2012 - http://asipto.com/u/katu

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20120927/b29d1341/attachment.htm>


More information about the sr-users mailing list