Hello,

I tryied to add the missing Route header by values store in htable based on Call-Id as you mentionned Daniel but it seems that this Route header is not taking into account when kamailio performs record_route and loose_route.
I use the insert_hf function prior to routing function but it doesn't work, what did I missed ?

Example for an ACK:
Frame Received from my SIP provider:
ACK sip:0974711672@96.57.249.78:6010 SIP/2.0
Call-ID: 03342-SZ-333e9b30-449a64cb5@my.sip.provider
Contact: <sip:13.12.14.17:5060>
CSeq: 854802634 ACK
From: "0033403135382" <sip:0476230240@my.sip.provider;user=phone>;tag=03342-UJ-333e9b31-50487be93
Max-Forwards: 28
To: <sip:0974711672@13.12.14.17;user=phone>;tag=552107982
Via: SIP/2.0/UDP 13.12.14.20:5060;branch=z9hG4bK-XWOP-14930cec-40c2dda0
User-Agent: Cirpack/v4.42a (gw_sip)
Content-Length: 0


Frame transmit by Kamailio:
ACK sip:0974711672@96.57.249.78:6010 SIP/2.0
Route: <sip:130.120.140.131;r2=on;lr=on;ftag=03342-UJ-333e9b31-50487be93;mrt=yes;did=377.0f395d41>,<sip:130.120.140.131:6010;r2=on;lr=on;ftag=03342-UJ-333e9b31-50487be93;mrt=yes;did=377.0f395d41>
Record-Route: <sip:130.120.140.131;lr=on;ftag=03342-UJ-333e9b31-50487be93>
Call-ID: 03342-SZ-333e9b30-449a64cb5@my.sip.provider
Contact: <sip:13.12.14.20:5060>
CSeq: 854802634 ACK
From: "0033403135382" <sip:0476230240@my.sip.provider;user=phone>;tag=03342-UJ-333e9b31-50487be93
Max-Forwards: 27
To: <sip:0974711672@13.12.14.17;user=phone>;tag=552107982
Via: SIP/2.0/UDP 130.120.140.131;branch=0
Via: SIP/2.0/UDP 13.12.14.20:5060;rport=5060;branch=z9hG4bK-XWOP-14930cec-40c2dda0
User-Agent: Cirpack/v4.42a (gw_sip)
Content-Length: 0


I was expected an output frame with the Route header that I added removed by Kamailio and replaced by the correct Record-Route and Via header:
ACK sip:0974711672@96.57.249.78:6010 SIP/2.0
Record-Route: <sip:130.120.140.131:6010;lr=on;ftag=03342-UJ-333e9b31-50487be93>
Record-Route: <sip:130.120.140.131;lr=on;ftag=03342-UJ-333e9b31-50487be93>
Call-ID: 03342-SZ-333e9b30-449a64cb5@my.sip.provider
Contact: <sip:13.12.14.20:5060>
CSeq: 854802634 ACK
From: "0033403135382" <sip:0476230240@my.sip.provider;user=phone>;tag=03342-UJ-333e9b31-50487be93
Max-Forwards: 27
To: <sip:0974711672@13.12.14.17;user=phone>;tag=552107982
Via: SIP/2.0/UDP 130.120.140.131:6010;branch=0
Via: SIP/2.0/UDP 13.12.14.20:5060;rport=5060;branch=z9hG4bK-XWOP-14930cec-40c2dda0
User-Agent: Cirpack/v4.42a (gw_sip)
Content-Length: 0



Regards,

Hervé


On 03/29/2012 04:40 PM, Daniel-Constantin Mierla wrote:
Hello,

On 3/29/12 11:17 AM, Hervé Cochet wrote:
Hello,

I used kamailio to handle SIP line from a provider using uacreg table.
Everything was working fine till they add a proxy which do not set (or not propagate) route header in ACK or BYE request.

So my routing logic is broken in the "in-dialog" transaction mode, since the loose_route return FALSE.

If I try to force a t_relay after the loose_route, my message may not be routing properly if for example my UAC was not connected with the standard 5060 port or use a different protocol like TCP (It works if both are in UDP and use 5060 port).
Is there a way to retrieve the record-route previously sets for this session in order to route this message properly ?

is the Record-Route set mirrored in the 200ok?

If the device is not supporting record-routing, then ACK/BYE should not get to your proxy. Can you post a full sip trace for such a call (from invite to bye)? It will help to understand how the message flow is and maybe we can help more.

As a generic hint for storing/retrieving data, look at htable module, or if you prefer to use database storage, sqlops may be an alternative. You can keep the values based on callid.




Another problem is that the dialog module do not match the BYE transaction, the "did" variable is missing since the route is not there but it should match the request with SIP matching (dlg_match_mode is set to 1).

For example my dialog parameters are:

dialog::  hash=1214:1340198900
    state:: 3
    timestart:: 1333006717
    timeout:: 80537132
    callid:: 16260-CI-30dd2867-797784ae0@my.sip.provider
    from_uri:: sip:0367023024@my.sip.provider;user=phone
    from_tag:: 16260-GI-30dd2868-17bb342c3
    caller_contact:: sip:13.12.14.20:5060
    caller_cseq:: 815264875
    caller_route_set:: <sip:13.12.14.20:5060;lr>
    caller_bind_addr:: udp:130.120.140.131:5060
    to_uri:: sip:0974711672@13.12.14.17;user=phone
    to_tag:: 1878467993
    callee_contact:: sip:0974711672@96.57.249.78:1024
    callee_cseq:: 815264875
    callee_route_set::
    callee_bind_addr:: udp:130.120.140.131:5060


The BYE request:
BYE sip:0974711672@96.57.249.78:1024 SIP/2.0
Call-ID: 16260-CI-30dd2867-797784ae0@my.sip.provider
CSeq: 815264876 BYE
From: "0033403135382" <sip:0367023024@my.sip.provider;user=phone>;tag=16260-GI-30dd2868-17bb342c3
Max-Forwards: 28
Record-Route: <sip:13.12.14.20:5060;lr>
To: <sip:0974711672@13.12.14.17;user=phone>;tag=1878467993
Via: SIP/2.0/UDP 13.12.14.20:5060;branch=z9hG4bK-LNVP-1196a924-5f1f495a
Reason: q.850;cause=16
User-Agent: Cirpack/v4.42a (gw_sip)
Content-Length: 0


Why does this BYE request is not matched by the dialog modules using SIP parameters (Call-ID, uri, tag seems correct) ?

Can you try to execute dlg_manage()? If Route header is missing, then there is nothing that triggers automatically dialog matching.

Cheers,
Daniel


Hervé


_______________________________________________
SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
sr-users@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
    

-- 
Daniel-Constantin Mierla
Kamailio Advanced Training, April 23-26, 2012, Berlin, Germany
http://www.asipto.com/index.php/kamailio-advanced-training/

--


Hervé COCHET.


Ingénieur en développement logiciel.
Tel Direct:
+33(0)482 531 303

TECHNOSENS SAS
Donnons du sens à la Technologie

31, rue Gustave Eiffel
F-38000 Grenoble
+33(0)476 230 240
www.technosens.fr

--------------------------------------------------------------------------------

Ce message et les documents l'accompagnant sont confidentiels. Ils contiennent des informations qui sont destinées uniquement à la personne ou l'entité dont le nom est indiqué ci-dessus. Toute reproduction, divulgation ou autre utilisation de ces informations, même partiellement, par un autre destinataire est strictement interdite. Si ce message vous est parvenu par erreur, veuillez le détruire immédiatement et nous le faire savoir par téléphone, Fax ou e-mail.