[Serusers] Can I use realm name without DNS SRV

Greger V. Teigre greger at teigre.com
Tue Jun 7 11:35:00 CEST 2005


Sorry, Antonio. This is getting too much of a special case that I can devote 
any time to it.  I would suggest you clean up and concentrate on a pure IP 
setup (also in the user clients), which, BTW, I have done at several 
occations, even without an Internet connection.  Remember that SER does a 
reverse lookup (gethostbyname) to resolve it's own IP address.
g-)

Antonio Cano damas wrote:
> Dear Greger,
>
> I went to fast into this conclusion :(
>
> I've made rewritehostport("Public_IP:5070") because if I use the
> private_ip SER does nothing :?
>
> The problem now is in Asterisk or Maybe in the network config, I think
> is second.
>
> In my network scenario the Redstar servir is connected to the internet
> throught an ADSL Router, with all ports redirected to it:
>    Internet ----> Public_IP (Router ADSL) Private_IP <---- (Redstar)
>
> With Tethereal We can see this log:
>     11.055288  192.168.1.5 -> Public_IP SIP/SDP Request: INVITE
> sip:213 at Public_IP:5070, with session description
>     11.055982  192.168.1.1 -> 192.168.1.5  ICMP Destination
> unreachable (Port unreachable)
>
> The problem is that packet try to go throw the Internet and the Router
> doesn't know how to give it. Due to the Proxy and Asterisk are both
> into the same machine I doesn't need that travel :)
>
> In /etc/hosts I've got:
>    192.168.1.5     Public_IP   redstar.organization.org redstar
> 192.168.1.5redstar.organization.org
>
> For iptables I've added:
>    iptables -t nat -A PREROUTING -d Public_IP -p udp --dport 5060:5070
> -j DNAT --to 192.168.1.5
>
> After the changes of /etc/hosts I rebooted the server. Now I make some
> tests with traceroute:
>
> redstar:~# traceroute redstar
> traceroute to Public_IP (192.168.1.5), 30 hops max, 38 byte packets
> 1  80 (192.168.1.5)  0.268 ms  0.058 ms  0.750 ms
>
> redstar:~# traceroute Public_IP
> traceroute to Public_IP (Public_IP), 30 hops max, 38 byte packets
> 1  192.168.1.1 (192.168.1.1)  0.634 ms  0.451 ms  0.361 ms
>
>
> Do you have some idea about that?
>
> Kind regards,
>    Antonio F. Cano
>
>
>
> Greger V. Teigre wrote:
>
>> ;-)
>> Antonio Cano damas wrote:
>>
>>> wowwwww, a lot of thanks it goes :D
>>>
>>>
>>> Greger V. Teigre wrote:
>>>
>>>> SER will try to resolve using DNS SRV and A lookups unless you
>>>> specify IP addresses, so:
>>>> route[2]
>>>> {
>>>>      #Host and port where Asterisk is listening, sip.conf
>>>>       rewritehostport("192.168.1.5:5070");
>>>>       route(1);
>>>>       break;
>>>> }
>>>> g-)
>>>>
>>>> Antonio Cano damas wrote:
>>>>
>>>>> Hi,
>>>>>
>>>>> That seems to start working :). I've made the next changes:
>>>>> listen="redstar.organization.org"
>>>>> alias="192.168.1.5"
>>>>> alias="organization.org"
>>>>> alias="redstar.organization.org"
>>>>>
>>>>> check_via=no    # (cmd. line: -v)
>>>>> dns=no           # (cmd. line: -r)
>>>>> rev_dns=no      # (cmd. line: -R)
>>>>>
>>>>> And the proper updates into MySQL Database for domain like
>>>>> 'redstar.organization.org'.
>>>>>
>>>>> Now I've got happening something strange, my UAs x-lite and
>>>>> grandstream can register but Asterisk doesn't (at first look).
>>>>> Looking the URIS I've seen that X-lite generate
>>>>> @192.168.1.5redstar.organization.org while Asterisk generate
>>>>> @redstar.organization.org. Finally I've got registering the
>>>>> Asterisk using fromdomain= 192.168.1.5restar.organization.org :-/
>>>>>
>>>>> My next step is try to make a call from X-Lite to one extension of
>>>>> Asterisk. In the SER.cfg:
>>>>> A) Into the INVITE process section:
>>>>>    if (uri =~ "^sip:(2[0-9][0-9])@*" ) {
>>>>>                  log(1,"Al asterisk\n");
>>>>>                  route(2);
>>>>>                  break;
>>>>>    };
>>>>> B)
>>>>> route[2]
>>>>> {
>>>>>      #Host and port where Asterisk is listening, sip.conf
>>>>>       rewritehostport("192.168.1.5redstar.organization.org:5070");
>>>>>       route(1);
>>>>>       break;
>>>>> }
>>>>>
>>>>> route[1]
>>>>> {
>>>>>        # if client or server know to be behind a NAT, enable relay
>>>>>        if (isflagset(6)) {
>>>>>                #log(1, "Pasando por force_rtp_proxy\n");
>>>>>                append_hf("P-Hint: Pasando por RTP_PROXY\r\n");
>>>>>                force_rtp_proxy();
>>>>>        };
>>>>>
>>>>>        # labeled all transaction for accounting
>>>>>        #setflag(4);
>>>>>
>>>>>        # send it out now; use stateful forwarding as it works
>>>>>        reliably # even for UDP2TCP
>>>>>        if (!t_relay()) {
>>>>>                sl_reply_error();
>>>>>        };
>>>>> }
>>>>>
>>>>> With that the INVITE petition gets an Request Timeout response,
>>>>> making a little of ngrep:
>>>>>
>>>>> U IP_Client_UA:5060 -> 192.168.1.5:5060
>>>>>  INVITE sip:213 at 192.168.1.5redstar.organization.org SIP/2.0..Via:
>>>>> SIP/2.0/UDP
>>>>> 192.168.0.6:5060;rport;branch=z9hG4bK4F9444CAD6AD11D9B421000A95A55E26..From:
>>>>>
>>>>>
>>>>> Anto
>>>>>  nio F. Cano
>>>>> <sip:10101 at redstar.organization.org>;tag=1817289323..To:
>>>>> <sip:213 at redstar.organization.org>..Contact:
>>>>>  <sip:10101 at 192.168.0.6:5060>..Call-ID: 4F13C7CB-D
>>>>> 6AD-11D9-B421-000A95A55E26 at 192.168.0.6..CSeq: 3733
>>>>> INVITE..Max-Forwards: 70..Content-Type:
>>>>>  application/sdp..User-Agent: X-Lite release 1103m..Content-Len
>>>>> gth: 263....v=0..o=10101 5457996 5458244 IN IP4
>>>>> 192.168.0.6..s=X-Lite..c=IN IP4 192.168.0.6..t=0 0..m=audio 8000
>>>>> RTP/AVP 3 0 8 98 101..a=rtpmap:0 pcmu/80 00..a=rtpmap:8
>>>>> pcma/8000..a=rtpmap:3 gsm/8000..a=rtpmap:98
>>>>> iLBC/8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101
>>>>> 0-15..
>>>>> #
>>>>>
>>>>> U 192.168.1.5:5060 -> IP_DNS_SERVER:5070
>>>>>  INVITE sip:213 at 192.168.1.5redstar.organization.org:5070
>>>>> SIP/2.0..Record-Route:
>>>>> <sip:213 at 192.168.1.5;ftag=1817289323;lr=on>..Via: SIP/2.0/UDP
>>>>>  192.168.1.5;branc h=z9hG4bK151f.afc77ca4.0..Via: SIP/2.0/UDP
>>>>> 192.168.0.6:5060;received=IP_Client_UA;rport=5060;branch=z9hG4bK4F9444CAD6AD11D9B421000A95A55E26..From:
>>>>>
>>>>>
>>>>> Antonio
>>>>>  F. Cano <sip:10101 at redstar.organization.org>;tag=1817289323..To:
>>>>> <sip:213 at redstar.organization.org>..Contact:
>>>>> <sip:10101 at IP_Client_UA:5060>..Call-ID: 4F13C7CB-D6AD-1
>>>>>  1D9-B421-000A95A55E26 at 192.168.0.6..CSeq: 3733
>>>>> INVITE..Max-Forwards: 69..Content-Type: application/sdp..User-Agent: 
>>>>> X-Lite release
>>>>> 1103m..Content-Length:
>>>>>  283..P-Hint: Nat uac_test=3 ..P-Hint: Metodo INVITE corrigiendo
>>>>> SDP..P-Hint: Pasando por RTP_PROXY....v=0..o=10101 5457996 5458244
>>>>> IN IP4 192.168.0.6..s=
>>>>>  X-Lite..c=IN IP4 192.168.0.6..t=0 0..m=audio 8000 RTP/AVP 3 0 8
>>>>> 98 101..a=rtpmap:0 pcmu/8000..a=rtpmap:8 pcma/8000..a=rtpmap:3
>>>>> gsm/8000..a=rtpmap:98 iLBC
>>>>>  /8000..a=rtpmap:101 telephone-event/8000..a=fmtp:101
>>>>> 0-15..a=direction:active..
>>>>>
>>>>> Why SER sends the message to IP_DNS_SERVER in place of
>>>>> 192.168.1.5redstar.organization.org?
>>>>>
>>>>> What's happen here? I don't understand nothing. What I make wrong?
>>>>> The @192.168.1.5redstar.organization.org doesn't seem to be so
>>>>> elegant is there any way to make it like redstar.organization.org
>>>>>
>>>>> Kind regards and thanks for your time,
>>>>>    Antonio F. Cano
>>>>>
>>>>> Greger V. Teigre wrote:
>>>>>
>>>>>> You can turn off SRV in X-Lite and Grandstream (Use DNS SRV
>>>>>> option) And use SIP proxy: fully qualified domain name (same as
>>>>>> outbound) g-)
>>>>>> Antonio Cano damas wrote:
>>>>>>
>>>>>>> Hello all,
>>>>>>>
>>>>>>> First of all excuses for my bad english. I was looking into the
>>>>>>> list and doesn't find nothing similar to my problem maybe I
>>>>>>> didn't use the correct keywords.
>>>>>>>
>>>>>>> I've got a Proxy that is behaind and Public IP and I've got a
>>>>>>> subdomain name pointing to this machine. But the DNS server
>>>>>>> isn't mine and I can't add a SRV record, I've redirected all
>>>>>>> petitions to this server and in that way if I make a petition
>>>>>>> of anykind service (ssh, web, ...)  to the subdomain.name.com it 
>>>>>>> comes into the machine. The problem is that all de UA i try
>>>>>>> (X-Lite, Grandstream and Asterisk) makes DNS SRV queries and i
>>>>>>> don't know how to avoid this. For example:
>>>>>>>
>>>>>>> My subdomain is redstar.organization.org and I'd like to use the
>>>>>>> realm organization.org
>>>>>>>
>>>>>>> + File /etc/hosts
>>>>>>>    192.168.1.5     Public_IP_Of_RedStar  redstar.organization.org 
>>>>>>> redstar
>>>>>>>
>>>>>>> + In /etc/init.d/ser I've got this params line:
>>>>>>>        PARAMS="-P $PIDFILE -u root -g root -l
>>>>>>>            redstar.organization.org" --->I try using -l
>>>>>>>                 organization.org, but the server said to me:
>>>>>>> 0(0) ERROR: udp_init: bind(5, 0x80c8cc0, 16) on
>>>>>>> IP_Organization.org: Cannot assign requested address
>>>>>>>
>>>>>>> + In /etc/ser/ser.cfg added this:
>>>>>>>    alias="organization.org"
>>>>>>>    alias="redstar.organization.org"
>>>>>>>
>>>>>>> + MySQL tables the domain field value is 'organization.org'
>>>>>>>
>>>>>>> When I start the SER it tells me:
>>>>>>>    Restarting ser: serListening on
>>>>>>>              Public_IP_Of_Redstar [192.168.1.5]:5060
>>>>>>>    Aliases: redstar:5060 redstar.organization.org:*
>>>>>>> organization.org:* The UA Grandstream config is:
>>>>>>>    SIP Server: organization.org
>>>>>>>    Outbound Proxy: redstar.organization.org
>>>>>>>
>>>>>>> And the received answer is a 478 Unresolveable destination. Can
>>>>>>> anyone help me? What can I do? I'm a little desesperated :(
>>>>>>>
>>>>>>> Thanks in advance,
>>>>>>>    Antonio F. Cano
>>>>>>>
>>>>>>> Ngrep log result into redstar.organization.org machine:
>>>>>>>
>>>>>>> U UA_Public_IP:62303 -> 192.168.1.5:5060
>>>>>>>  REGISTER sip:192.168.1.5organization.org SIP/2.0..Via:
>>>>>>> SIP/2.0/UDP 192.168.0.9:62303;branch=z9hG4bK083fbe
>>>>>>>  2c60e48e32..From: "Antonio F. Cano (iGT)"
>>>>>>> <sip:10101 at organization.org;user=phone>;tag=b511698681c5146b..T
>>>>>>>  o: <sip:10101 at organization.org;user=phone>..Contact:
>>>>>>> <sip:10101 at 192.168.0.9:62303;user=phone>..Call-ID: 3
>>>>>>>  4ee28e5dad286d9 at 192.168.0.9..CSeq: 100 REGISTER..Expires:
>>>>>>> 3600..User-Agent: Grandstream HT487 1.0.5.
>>>>>>>  18..Max-Forwards: 70..Allow:
>>>>>>> INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Leng
>>>>>>>
>>>>>>>
>>>>>>>  th:
>>>>>>> 0....
>>>>>>>
>>>>>>> #
>>>>>>>
>>>>>>> Why this 'sip:192.168.1.5organization.org'?
>>>>>>>
>>>>>>> U 192.168.1.5:32863 -> 195.235.113.3:53
>>>>>>>
>>>>>>> Z............_sip._udp.192.168.1.5organization.org..!..
>>>>>>>
>>>>>>>
>>>>>>> ######################################################################
>>>>>>>
>>>>>>> U UA_Public_IP:62303 -> 192.168.1.5:5060
>>>>>>>  REGISTER sip:192.168.1.5organization.org SIP/2.0..Via:
>>>>>>> SIP/2.0/UDP 192.168.0.9:62303;branch=z9hG4bK083fbe
>>>>>>>  2c60e48e32..From: "Antonio F. Cano (iGT)"
>>>>>>> <sip:10101 at organization.org;user=phone>;tag=b511698681c5146b..T
>>>>>>>  o: <sip:10101 at organization.org;user=phone>..Contact:
>>>>>>> <sip:10101 at 192.168.0.9:62303;user=phone>..Call-ID: 3
>>>>>>>  4ee28e5dad286d9 at 192.168.0.9..CSeq: 100 REGISTER..Expires:
>>>>>>> 3600..User-Agent: Grandstream HT487 1.0.5.
>>>>>>>  18..Max-Forwards: 70..Allow:
>>>>>>> INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Leng
>>>>>>>
>>>>>>>
>>>>>>>  th:
>>>>>>> 0....
>>>>>>>
>>>>>>> #########################################################
>>>>>>> U 195.235.113.3:53 -> 192.168.1.5:32863
>>>>>>>
>>>>>>> Z............_sip._udp.192.168.1.5organization.org..!...)......*0.=.a.gtld-servers.).nstld.verisign-grs.c
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> om.B.. at ..........:.....
>>>>>>>
>>>>>>> #
>>>>>>> U 192.168.1.5:32863 -> 195.235.113.3:53
>>>>>>>
>>>>>>> Z............_sip._udp.192.168.1.5organization.org..!..
>>>>>>>
>>>>>>> ##########
>>>>>>> U 195.235.113.3:53 -> 192.168.1.5:32863
>>>>>>>
>>>>>>> Z............_sip._udp.192.168.1.5organization.org..!...)......*0.=.a.gtld-servers.).nstld.verisign-grs.c
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> om.B.. at ..........:.....
>>>>>>>
>>>>>>> ##################################################################################################################
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> U UA_Public_IP:62303 -> 192.168.1.5:5060
>>>>>>>  REGISTER sip:192.168.1.5organization.org SIP/2.0..Via:
>>>>>>> SIP/2.0/UDP 192.168.0.9:62303;branch=z9hG4bK083fbe
>>>>>>>  2c60e48e32..From: "Antonio F. Cano (iGT)"
>>>>>>> <sip:10101 at organization.org;user=phone>;tag=b511698681c5146b..T
>>>>>>>  o: <sip:10101 at organization.org;user=phone>..Contact:
>>>>>>> <sip:10101 at 192.168.0.9:62303;user=phone>..Call-ID: 3
>>>>>>>  4ee28e5dad286d9 at 192.168.0.9..CSeq: 100 REGISTER..Expires:
>>>>>>> 3600..User-Agent: Grandstream HT487 1.0.5.
>>>>>>>  18..Max-Forwards: 70..Allow:
>>>>>>> INVITE,ACK,CANCEL,BYE,NOTIFY,REFER,OPTIONS,INFO,SUBSCRIBE..Content-Leng
>>>>>>>
>>>>>>>
>>>>>>>  th:
>>>>>>> 0....
>>>>>>>
>>>>>>> ###########################################################################################################################
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> U 192.168.1.5:5060 -> UA_Public_IP:62303
>>>>>>>  SIP/2.0 478 Unresolveable destination (478/TM)..Via:
>>>>>>> SIP/2.0/UDP 192.168.0.9:62303;branch=z9hG4bK083
>>>>>>>  fbe2c60e48e32;rport=62303;received=IP_Client_UA..From: "Antonio
>>>>>>> F. Cano (iGT)" <sip:10101 at organization.org;
>>>>>>>  user=phone>;tag=b511698681c5146b..To:
>>>>>>> <sip:10101 at organization.org;user=phone>;tag=1b908f8c725dfd3e50cbc74
>>>>>>>  f548dfb0d-588b..Call-ID: 34ee28e5dad286d9 at 192.168.0.9..CSeq:
>>>>>>> 100 REGISTER..Server: Sip EXpress route
>>>>>>>  r (0.8.14 (i386/linux))..Content-Length: 0..Warning: 392
>>>>>>> 80.38.244.122:5060 "Noisy feedback tells:
>>>>>>>  pid=8023 req_src_ip=IP_Client_UA req_src_port=62303
>>>>>>> in_uri=sip:192.168.1.5organization.org out_uri=sip:192.
>>>>>>>  168.1.5organization.org
>>>>>>> via_cnt==1"....
>>>>>>>
>>>>>>>
>>>>>>> _______________________________________________
>>>>>>> Serusers mailing list
>>>>>>> serusers at lists.iptel.org
>>>>>>> http://lists.iptel.org/mailman/listinfo/serusers 




More information about the sr-users mailing list