[SR-Users] seturi analog for Kamailio 4.3

Daniel-Constantin Mierla miconda at gmail.com
Mon Mar 16 14:58:09 CET 2015


Are you calling t_relay() from branch_route?

Maybe you should load debugger module and enable cfgtrace to see what
actions from kamailio.cfg are executed.

Just changing the $ru and relaying should work when used in request_route.

Cheers,
Daniel

On 16/03/15 14:14, Yuriy Gorlichenko wrote:
> I mean that algorithm of creating new headers of creating INVOTE
> message is the same for branch_branch route and single client. Only
> one difference i that I use $ru="sip:"+$tU+"@"+$(du{s.select,1,:} vs
> append_branch("sip:$tU@$(du{s.select,1,:})")
>
> This is full algo of my reqest
> the first is I check at location table num of endpoints for this peer
> and then at the "while" do this
>
>                                                 sql_pvquery("ca",
> "select received from location where
> contact='$dbr(ra=>[$var(i),0])'","$var(recieved)");
> $du=$var(recieved);
> xlog("L_INFO","SQL query return recieved {$var(recieved)} for {$tU}.
> Destination is {$du}\n");
> # if only one client used it means that I use $ru
> if ($dbr(ra=>rows)==1)
> {
> xlog("L_INFO","Single ANGENT");
> xlog("L_INFO","WS Branch is {$du)} for {$tU}\n");
> rtpengine_manage("force trust-address replace-origin
> replace-session-connection ICE=force RTP/SAVPF");
> t_on_reply("REPLY_FROM_WS");
> $ru="sip:"+$tU+"@"+$(du{s.select,1,:});
> route("FINAL_RELAY");
> }
> else
> {
> append_branch("sip:$tU@$(du{s.select,1,:})","0.7");
> }
>
> #after while ended if more that one endpoint used 
>
> t_on_branch("1");
> return;
>
> branch_route[1]{
>
> if($du=~"transport=ws"){
> xlog("L_INFO","Websocket Branch is {$du} for {$tU}\n");
> rtpengine_manage("force trust-address replace-origin
> replace-session-connection ICE=force RTP/SAVPF");
> t_on_reply("REPLY_FROM_WS");
> }
> else{
> xlog("L_INFO","UDP Branch is {$du)} for {$tU}\n");
> rtpengine_manage("replace-origin replace-session-connection ICE=remove
> RTP/AVP");
> t_on_reply("MANAGE_CLASSIC_REPLY");
> }
> }
>
> route[FINAL_RELAY]
> {
>              
> if (!t_relay()) {
> sl_reply_error();
> }
> return;
> }
>
>
>
> 2015-03-16 15:46 GMT+03:00 Yuriy Gorlichenko <ovoshlook at gmail.com
> <mailto:ovoshlook at gmail.com>>:
>
>     request_route
>
>     2015-03-16 15:43 GMT+03:00 Daniel-Constantin Mierla
>     <miconda at gmail.com <mailto:miconda at gmail.com>>:
>
>         Is this used in request_route or in failure_route or other
>         routing block?
>
>         Cheers,
>         Daniel
>
>
>         On 16/03/15 12:44, Yuriy Gorlichenko wrote:
>>         If I use
>>
>>         $ru="sip:"+$tU+"@"+$(du{s.select,1,:});
>>
>>         if (!t_relay()) {
>>         sl_reply_error();
>>         }
>>
>>         I see 
>>
>>         t_forward_nonack(): ERROR: t_forward_nonack: no branches for
>>         forwarding
>>         Mar 16 11:36:04 Kamailio kamailio[4335]: ERROR: sl
>>         [sl_funcs.c:363]: sl_reply_error(): ERROR: sl_reply_error
>>         used: I'm terribly sorry, server error occurred (6/SL)
>>
>>          if I use append_branch()
>>         for single client - thats is ok but 2 invites going to client.
>>         So client may pickup call and it successfully established.  
>>
>>         2015-03-16 13:24 GMT+03:00 Daniel-Constantin Mierla
>>         <miconda at gmail.com <mailto:miconda at gmail.com>>:
>>
>>             Hello,
>>
>>             instead of seturi use:
>>
>>             $ru = "sip:" + $tU + "@" + $(du{s.select,1,:});
>>
>>             Cheers,
>>             Daniel
>>
>>
>>             On 16/03/15 05:44, Yuriy Gorlichenko wrote:
>>>             Now. when I use 
>>>
>>>             seturi("sip:$tU@$(du{s.select,1,:})");
>>>
>>>             I see error at my log
>>>
>>>              ERROR: tm [t_lookup.c:1264]: new_t(): ERROR: new_t: uri
>>>             invalid
>>>              ERROR: tm [t_lookup.c:1411]: t_newtran(): ERROR:
>>>             t_newtran: new_t failed
>>>              ERROR: tm [t_lookup.c:1264]: new_t(): ERROR: new_t: uri
>>>             invalid
>>>              ERROR: tm [t_lookup.c:1411]: t_newtran(): ERROR:
>>>             t_newtran: new_t failed
>>>              ERROR: sl [sl_funcs.c:363]: sl_reply_error(): ERROR:
>>>             sl_reply_error used: Regretfully, we were not able to
>>>             process the URI (479/SL)
>>>              ERROR: sl [sl_funcs.c:363]: sl_reply_error(): ERROR:
>>>             sl_reply_error used: Regretfully, we were not able to
>>>             process the URI (479/SL)
>>>
>>>             As i see error generate twice maby because I ure t_on
>>>             branch() route
>>>
>>>
>>>
>>>             2015-03-16 7:18 GMT+03:00 Yuriy Gorlichenko
>>>             <ovoshlook at gmail.com <mailto:ovoshlook at gmail.com>>:
>>>
>>>                 Hello. I try to call multi[ple endpoints from my
>>>                 server using append_branch. It works fine but when I
>>>                 have only one endpoint - kamailio generate 2 INVITE
>>>                 requests to it.
>>>                 As I understand it is original request and the next
>>>                 one is branch. 
>>>                 I used seturi() before for sending original reqest
>>>                 to destination, but I can not see this function at
>>>                 kamailio 4.3.
>>>                 Kamailio 4.3 uses send() dunnction? but it works at
>>>                 stateless mode. I need analog of it or seturi that
>>>                 works at statefull mode.
>>>
>>>
>>>
>>>
>>>
>>>             _______________________________________________
>>>             SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>>             sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
>>>             http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>             -- 
>>             Daniel-Constantin Mierla
>>             http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda
>>             Kamailio World Conference, May 27-29, 2015
>>             Berlin, Germany - http://www.kamailioworld.com
>>
>>
>>             _______________________________________________
>>             SIP Express Router (SER) and Kamailio (OpenSER) -
>>             sr-users mailing list
>>             sr-users at lists.sip-router.org
>>             <mailto:sr-users at lists.sip-router.org>
>>             http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>>
>>
>>
>>
>>         _______________________________________________
>>         SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
>>         sr-users at lists.sip-router.org <mailto:sr-users at lists.sip-router.org>
>>         http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>         -- 
>         Daniel-Constantin Mierla
>         http://twitter.com/#!/miconda <http://twitter.com/#%21/miconda> - http://www.linkedin.com/in/miconda
>         Kamailio World Conference, May 27-29, 2015
>         Berlin, Germany - http://www.kamailioworld.com
>
>
>         _______________________________________________
>         SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
>         mailing list
>         sr-users at lists.sip-router.org
>         <mailto:sr-users at lists.sip-router.org>
>         http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users
>
>
>

-- 
Daniel-Constantin Mierla
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda
Kamailio World Conference, May 27-29, 2015
Berlin, Germany - http://www.kamailioworld.com

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sip-router.org/pipermail/sr-users/attachments/20150316/95ccf7c6/attachment.html>


More information about the sr-users mailing list