No subject


Wed Jun 27 05:48:46 CEST 2012


=C2=A0
----authentication of INVITE:
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: NOTICE: : --------------=
-------- In route(AUTH), just before from_uri=3D=3Dmyself=C2=A0----------=
------------
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D9 && [domain.ch] =
=3D=3D [127.0.0.1]=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D15 && [domain.ch]=
 =3D=3D []=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D9 && [domain.ch] =
=3D=3D [127.0.0.1]=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D15 && [domain.ch]=
 =3D=3D []=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:44 server /usr/sbin/kamailio[8588]: NOTICE: : --------------=
-------- from_uri=3D=3Dmyself evaluated as TRUE!!=C2=A0------------------=
----
=C2=A0
=C2=A0
----same dialog, routing of ACK (response to 200 OK for invite):
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: INFO: : =3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D ACK MSG, NEXT function: LOOSE_ROUTE() =3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: rr [loose.c:85]: =
is_preloaded: No=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D9 && [domain.ch] =
=3D=3D [127.0.0.1]=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D15 && [domain.ch]=
 =3D=3D []=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D9 && [domain.ch] =
=3D=3D [127.0.0.1]=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
83]: grep_sock_info - checking if host=3D=3Dus: 10=3D=3D15 && [domain.ch]=
 =3D=3D []=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [socket_info.c:5=
87]: grep_sock_info - checking if port 5060 (advertise 0) matches port 50=
60=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: rr [loose.c:591]:=
 Next hop: 'sip:;lr=3Don' is loose router=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: rr [loose.c:641]:=
 The last route URI: 'sip:;lr=3Don'=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: NOTICE: : =3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3DLOOSE_ROUTE RETURNED TRUE =3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: tm [t_lookup.c:13=
79]: DEBUG: t_newtran: msg id=3D3 , global msg id=3D2 , T on entrance=3D(=
nil)=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: tm [t_lookup.c:52=
7]: t_lookup_request: start searching: hash=3D15611, isACK=3D1=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: tm [t_lookup.c:48=
5]: DEBUG: RFC3261 transaction matching failed=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: tm [t_lookup.c:70=
9]: DEBUG: t_lookup_request: no transaction found=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG: tm [t_funcs.c:315=
]: SER: forwarding ACK =C2=A0statelessly =C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [msg_translator.=
c:206]: check_via_address(, domain.ch, 0)=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [forward.c:609]:=
 Sending: ACK sip:;lr=3Don SIP/2.0^M Via: SIP/2.0/UDP ;branch=3Dz9hG4bKcy=
dzigwkX^M Via: SIP/2.0/UDP domain.ch;received=3D;branch=3Dz9hG4bKac144138=
9717^M Max-Forwards: 69^M From: "acc2" ;tag=3D1c254829012^M To: ;tag=3D1c=
423881657^M Call-ID: 2547879162482012122242@^M CSeq: 2 ACK^M Contact: ^M =
Supported: em,timer,replaces,path,resource-priority^M Allow: REGISTER,OPT=
IONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIBE,UPDATE^M Use=
r-Agent: SBCdevice Content-Length: 0^M ^M .=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8588]: DEBUG:  [forward.c:611]:=
 orig. len=3D590, new_len=3D636, proto=3D1=C2=A0
...
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/msg_pars=
er.c:626]: =C2=A0method: =C2=A0=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/msg_pars=
er.c:628]: =C2=A0uri: =C2=A0 =C2=A0 =C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/msg_pars=
er.c:630]: =C2=A0version: =C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/parse_vi=
a.c:1286]: Found param type 232,=20
 =3D ; state=3D16=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/parse_vi=
a.c:2561]: end of header reached, state=3D5=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/msg_pars=
er.c:511]: parse_headers: Via found, flags=3D2=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG:  [parser/msg_pars=
er.c:513]: parse_headers: this is the first via=C2=A0
...
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG: sl [sl_funcs.c:39=
6]: DEBUG : sl_filter_ACK: to late to be a local ACK!=C2=A0
...
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG: sanity [mod_sanit=
y.c:255]: sanity checks result: 1=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG: siputils [checks.=
c:106]: totag found=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: INFO: : =3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D ACK MSG, NEXT function: LOOSE_ROUTE() =3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG: rr [loose.c:108]:=
 No Route headers found=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: DEBUG: rr [loose.c:829]:=
 There is no Route HF=C2=A0
Aug 24 14:22:47 server /usr/sbin/kamailio[8589]: INFO: : =3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3DLOOSE_ROUTE RETURNED FALSE =3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D
=C2=A0
When I set alias=3Dserver.domain.ch:5060, from_uri=3D=3Dmyself returns fa=
lse (when determining if INVITE should be authenticated,resulting in repl=
ying 100 trying instead of 407 Proxy Auth Req) and loose_route() starts r=
eturning true and relays the ACK correctly.
I can post more debug from this case also, but I didn't want to spam so m=
uch in one message.
If you would like to see it, please let me know.
=C2=A0
So .. Shall I consider the loose_route() part fixed and assume that there=
 MUST be a full name (hostname.domain:port) in the alias, when Kamailio i=
s not used as a primary proxy for the domain?
What about the from_uri=3D=3Dmyself part?
=C2=A0
Martin
=C2=A0
=C2=A0
______________________________________________________________
> Od: "Klaus Darilion"=20
> Komu: "SIP Router - Kamailio (OpenSER) and SIP Express Router (SER) - U=
sers Mailing List"=20
> D=C3=A1tum: 23.08.2012 15:04
> Predmet: Re: [SR-Users] Possible bug in authentication
>
> CC: miconda at gmail.com
The Route URI (sent by SBC) must be identical to the Record-Route URI=20
(inserted by Kamailio).

To find out why loose_route returns FALSE increase log-level.=20
loose_route uses the "ismyself" function to evaluate if the Route header=20
addresses this Kamailio server. And the "ismyself" is very verbose when=20
doing this check.

regards
Klaus

On 23.08.2012 13:51, martian at centrum.sk wrote:
> Ok, so .. I have a session border controller device that is a contact
> point for my SIP domain (SRV record in DNS set to its IP). All the
> trafic goes through it and it does things like topology hiding etc.. Th=
e
> device forwards the INVITE messages to Kamailio, because of the routing=
.
>
> The loose_route was working strangely, because it did not behave as
> described in the documentation.
>
> Here is the sip message that it was suppose to pass:
>
> ACK sip:acc1 at domain.ch:5060 SIP/2.0
>
> Via: SIP/2.0/UDP domain.ch;branch=3Dz9hG4bKac386033013
>
> Max-Forwards: 70
>
> From: "acc2" ;tag=3D1c1749458918
>
> To: ;tag=3D1c1892801634
>
> Call-ID: 17494024742382012111116@
>
> CSeq: 2 ACK
>
> Contact:=20
>
> Route:=20
>
> Supported: em,timer,replaces,path,resource-priority
>
> Allow:
> REGISTER,OPTIONS,INVITE,ACK,CANCEL,BYE,NOTIFY,PRACK,REFER,INFO,SUBSCRIB=
E,UPDATE
>
> User-Agent: SBC_DEVICE
>
> Content-Length: 0
>
> As you can see, there is a Route header and a To_tag .. so the
> loose_route function should return true. But instead, it returned false=
,
> then t_check_trans() also returned false and the routing logic exited
> (exit;).
>
> This happens when the value of alias is not enclosed in double quotes.
>
> PS.: There is a "-" symbol in the domain name. Can't that be a problem
> causing the need for the double quotes?
>
> PS2: Should there be only a domain name in the alias? or also the
> hostname part? ... for example: =C2=A0 domain.ch:5060 or server.domain.=
ch:5060
>
> Martin
>
> ______________________________________________________________
> =C2=A0> Od: "Daniel-Constantin Mierla"=20
> =C2=A0> Komu: "SIP Router - Kamailio (OpenSER) and SIP Express Router (=
SER) -
> Users Mailing List"=20
> =C2=A0> D=C3=A1tum: 23.08.2012 12:21
> =C2=A0> Predmet: Re: [SR-Users] Possible bug in authentication
> =C2=A0>
>
> Hello,
>
> On 8/23/12 11:54 AM, martian at centrum.sk  wrote:
>
> =C2=A0 =C2=A0 Hello to everybody.
>
> =C2=A0 =C2=A0 I am currently working with Kamailio 3.3.1 on RedHat.
>
> =C2=A0 =C2=A0 The "loose_route" function was not working correctly and =
I observed
> =C2=A0 =C2=A0 some very strange behaviour (not as one described in the
> =C2=A0 =C2=A0 documentation of the function).
>
> =C2=A0 =C2=A0 I have found that there needs to be a port included in th=
e "alias"
> =C2=A0 =C2=A0 variable for the loose_route function to work correctly.
>
> =C2=A0 =C2=A0 However, upon adding the port to alias, the INVITE messag=
es were no
> =C2=A0 =C2=A0 longer authenticated (Kamailio just accepted them and did=
n't send
> =C2=A0 =C2=A0 proxy-auth header in 407 message).
>
> =C2=A0 =C2=A0 My alias:
>
> =C2=A0 =C2=A0 alias=3D"domain.ch:5060"
>
> =C2=A0 =C2=A0 Examining default routing logic, I found the problem here=
:
>
> =C2=A0 =C2=A0 if (is_method("REGISTER") || from_uri=3D=3Dmyself)
>
> =C2=A0 =C2=A0 {
>
> =C2=A0 =C2=A0 # authenticate requests
>
> =C2=A0 =C2=A0 ...
>
> =C2=A0 =C2=A0 }
>
> =C2=A0 =C2=A0 The "from_uri=3D=3Dmyself" was no longer evaluated as tru=
e, because
> =C2=A0 =C2=A0 there was a port at the end of the alias.
>
> =C2=A0 =C2=A0 The FROM Header of the INVITE messages looks like:
>
> =C2=A0 =C2=A0 From: "acc1" ;tag=3D12345
>
> =C2=A0 =C2=A0 ..so .. no port number there.
>
> =C2=A0 =C2=A0 Btw, I have fixed this with replacing the "myself" list w=
ith my own
> =C2=A0 =C2=A0 defined variable MY_DOMAIN.
>
> =C2=A0 =C2=A0 #!define MY_DOMAIN ".*@domain.ch"=20
>
> =C2=A0 =C2=A0 So now the condition looks like this:
>
> =C2=A0 =C2=A0 if (is_method("REGISTER") || from_uri=3D~MY_DOMAIN)
>
> =C2=A0 =C2=A0 {
>
> =C2=A0 =C2=A0 ...
>
> =C2=A0 =C2=A0 }
>
> =C2=A0 =C2=A0 I am not sure if this is a bug that needs to be fixed or =
not. I am
> =C2=A0 =C2=A0 just pointing my finger at it and I hope it will contribu=
te to the
> =C2=A0 =C2=A0 development.
>
> =C2=A0 =C2=A0 Also, a valid description of this behavior (when using po=
rt in
> =C2=A0 =C2=A0 alias) would be appreciated.
>
>
> if you enclose the value of the alias parameter in double quotes, then
> it is taken as string value. If you want to set it to a host:port, then
> remove the double quotes:
>
> alias=3Ddomain.ch:5060
>
>
> Why do you say the loose_route() was working strangely? Do you add the
> hostname as record-route, not the IP address? Detail more about what yo=
u
> think is wrong with record routing/loose routing.
>
>
> Cheers,
> Daniel
>
> -- Daniel-Constantin Mierla -http://www.asipto.comhttp://twitter.com/#!=
/miconda =C2=A0-http://www.linkedin.com/in/micondaKamailio Advanced Train=
ing, Berlin, Nov 5-8, 2012 -http://asipto.com/u/kat
>
>
>
> _______________________________________________
> SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
> sr-users at lists.sip-router.org
> http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>


--_d32c_-------5621277849dcde159c8157e3b4652a48
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;">The Route and Record-route =
headers are identical.</p>

<p style=3D"padding:0 0 0 0; margin:0 0 0 0;"><br />


More information about the sr-users mailing list