<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
i added a new function that helps to pass $avp values to t_relay functions. it solves my problem. if it is ok , i can send a PR .</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span> $avp(pp)=5060;<br>
</span>
<div> $avp(add)="192.168.1.199";</div>
<span> $avp(t)="tcp";</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span> if(!t_relay_avp( "$avp(add)","$avp(pp)","$avp(t)")){<br>
</span>
<div>    xlog("L_ERR","Relay Problem UDP \n");<br>
</div>
<div>    sl_send_reply("503","Relay Problemed");<br>
</div>
<div>    exit;<br>
</div>
<div>   }<br>
</div>
<span>   exit;</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of YAS0 CANER <caner_yaso@hotmail.com><br>
<b>Sent:</b> Tuesday, December 18, 2018 2:15 PM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> Re: [SR-Users] passing $avp to t_relay functions.</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello Daniel;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
here cfg and results . i tested all of them one by one . i added some log to understand what is log. Extra note; t_relay_to_avp is not documented and fixup function cannot fix_param because it find FPARAM_STR.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span>$avp(pp)="5061";<br>
</span>
<div> $avp(add)="192.168.1.17";<br>
</div>
<div> $avp(addr)="192.168.1.17:5061";<br>
</div>
<div> $avp(dd)="udp:192.168.1.17:5061";<br>
</div>
<div> $avp(flags)="0x04";<br>
</div>
<div><br>
</div>
<div> #xlog("L_INF0","$C(xy) [SIPP] [extra_id_pv : $avp(reng_extraid) ]   [setid_avp : $avp(setid) ]  [rtp_inst_pvar : $avp(rtp_instance) ]  $C(xx) \n");<br>
</div>
<div><br>
</div>
<div> if(t_relay_to_udp("$avp(add)", "$avp(pp)")){<br>
</div>
<div>  xlog("L_ERR","Relay Problem UDP \n");<br>
</div>
<div>  sl_send_reply("503","Relay Problemed");<br>
</div>
<div>  exit;<br>
</div>
<div> }<br>
</div>
<div>/*<br>
</div>
<div> if(t_relay_to( "$avp(dd)","$avp(flags)")){<br>
</div>
<div>  xlog("L_ERR","Relay Problem UDP \n");<br>
</div>
<div>  sl_send_reply("503","Relay Problemed");<br>
</div>
<div>  exit;<br>
</div>
<div> }<br>
</div>
<div><br>
</div>
<div> if(t_relay_to_avp( "$avp(pp)","$avp(add)")){<br>
</div>
<div>  xlog("L_ERR","Relay Problem UDP \n");<br>
</div>
<div>  sl_send_reply("503","Relay Problemed");<br>
</div>
<div>  exit;<br>
</div>
<div> }<br>
</div>
<div><br>
</div>
<div> if(t_relay( "$avp(add)","$avp(pp)")){<br>
</div>
<div>  xlog("L_ERR","Relay Problem UDP \n");<br>
</div>
<div>  sl_send_reply("503","Relay Problemed");<br>
</div>
<div>  exit;<br>
</div>
<div> }<br>
</div>
<div>*/<br>
</div>
<span>}</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span>t_relay_to_udp result on compile<br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span><span>0(93337) INFO: <core> [core/tcp_main.c:4722]: init_tcp(): using epoll_lt as the io watch method (auto detected)<br>
</span>
<div> 0(93339) WARNING: tm [tm.c:765]: mod_init(): reparse_on_dns_failover is enabled on a multihomed host -- check the readme of tm module!<br>
</div>
<div> 0(93339) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded<br>
</div>
<div> 0(93339) INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available<br>
</div>
<div> 0(93339) INFO: <core> [main.c:2619]: main(): processes (at least): 33 - shm size: 67108864 - pkg size: 8388608<br>
</div>
<div> 0(93339) ERROR: tm [tm.c:621]: fixup_hostport2proxy(): TM module: fixup_hostport2proxy($avp(add), 1)<br>
</div>
<div> 0(93339) ERROR: tm [tm.c:621]: fixup_hostport2proxy(): TM module: fixup_hostport2proxy($avp(pp), 2)<br>
</div>
<div> 0(93339) ERROR: tm [tm.c:632]: fixup_hostport2proxy(): bad port number <$avp(pp)><br>
</div>
<div> 0(93339) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:492<br>
</div>
<div> 0(93339) ERROR: <core> [core/rvalue.c:3860]: fix_rval_expr(): failure in cfg at line: 492 col: 44<br>
</div>
<div> 0(93339) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:516<br>
</div>
<div> 0(93339) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:517<br>
</div>
<div>error -1 while trying to fix configuration<br>
</div>
<div> 0(93339) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized<br>
</div>
<span></span><br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span>t_relay_to result;<br>
</span></div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span> 0(93592) INFO: <core> [core/tcp_main.c:4722]: init_tcp(): using epoll_lt as the io watch method (auto detected)<br>
</span>
<div> 0(93594) WARNING: tm [tm.c:765]: mod_init(): reparse_on_dns_failover is enabled on a multihomed host -- check the readme of tm module!<br>
</div>
<div> 0(93594) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded<br>
</div>
<div> 0(93594) INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available<br>
</div>
<div> 0(93594) INFO: <core> [main.c:2619]: main(): processes (at least): 33 - shm size: 67108864 - pkg size: 8388608<br>
</div>
<div> 0(93594) ERROR: tm [tm.c:2441]: fixup_t_relay_to(): fixing austring  0(93594) ERROR: tm [tm.c:2444]: fixup_t_relay_to(): fixing austring Not null  0(93594) ERROR: tm [tm.c:2449]: fixup_t_relay_to(): host port proto ($avp(dd), 0, 0)<br>
</div>
<div> 0(93594) CRITICAL: <core> [core/proxy.c:264]: mk_proxy(): could not resolve hostname: "$avp(dd)"<br>
</div>
<div> 0(93594) ERROR: tm [tm.c:2453]: fixup_t_relay_to(): failed to build proxy structure for <$avp(dd)><br>
</div>
<div> 0(93594) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:498<br>
</div>
<div> 0(93594) ERROR: <core> [core/rvalue.c:3860]: fix_rval_expr(): failure in cfg at line: 498 col: 42<br>
</div>
<div> 0(93594) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:516<br>
</div>
<div> 0(93594) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:517<br>
</div>
<div>error -1 while trying to fix configuration<br>
</div>
<div> 0(93594) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized<br>
</div>
<span></span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
t_relay_to_avp result ; <br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span>0(93807) INFO: <core> [core/tcp_main.c:4722]: init_tcp(): using epoll_lt as the io watch method (auto detected)<br>
</span>
<div> 0(93809) WARNING: tm [tm.c:765]: mod_init(): reparse_on_dns_failover is enabled on a multihomed host -- check the readme of tm module!<br>
</div>
<div> 0(93809) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded<br>
</div>
<div> 0(93809) INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available<br>
</div>
<div> 0(93809) INFO: <core> [main.c:2619]: main(): processes (at least): 33 - shm size: 67108864 - pkg size: 8388608<br>
</div>
<div> 0(93809) ERROR: tm [tm.c:660]: fixup_proto_hostport2proxy(): Could fix AVP  0<br>
</div>
<div> 0(93809) ERROR: tm [tm.c:660]: fixup_proto_hostport2proxy(): Could fix AVP  0<br>
</div>
<div> 0(93809) INFO: <core> [core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992<br>
</div>
<div> 0(93809) INFO: <core> [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984<br>
</div>
<div> 0(93809) INFO: <core> [core/udp_server.c:153]: probe_max_receive_buffer(): SO_RCVBUF is initially 212992<br>
</div>
<div> 0(93809) INFO: <core> [core/udp_server.c:205]: probe_max_receive_buffer(): SO_RCVBUF is finally 425984<br>
</div>
<div>21(93830) INFO: jsonrpcs [jsonrpcs_sock.c:443]: jsonrpc_dgram_process(): a new child 0/93830<br>
</div>
<div>22(93831) INFO: ctl [io_listener.c:214]: io_listen_loop(): io_listen_loop:  using epoll_lt io watch method (config)<br>
</div>
<div><span> 10(94948) INFO: {1 017b733724424d0dfacf197ca78fb74a@0:0:0:0:0:0:0:0} <script>:  [INVITE]  <br>
</span>
<div><br>
</div>
<div>10(94948) ERROR: {1 017b733724424d0dfacf197ca78fb74a@0:0:0:0:0:0:0:0} tm [tm.c:1234]:
<u>t_protoaddr2proxy(): Invalid proto parameter value in t_protoaddr2proxy</u><br>
</div>
<div>11(94949) INFO: {1 017b733724424d0dfacf197ca78fb74a@0:0:0:0:0:0:0:0} <script>:  [ACK] <br>
</div>
<div>11(94949) INFO: {1 017b733724424d0dfacf197ca78fb74a@0:0:0:0:0:0:0:0} <script>: Message received over IPv6 link<br>
</div>
<span></span><br>
</div>
<span></span>t_relay result on compile ;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span>0(95154) INFO: <core> [core/tcp_main.c:4722]: init_tcp(): using epoll_lt as the io watch method (auto detected)<br>
</span>
<div> 0(95156) WARNING: tm [tm.c:807]: mod_init(): reparse_on_dns_failover is enabled on a multihomed host -- check the readme of tm module!<br>
</div>
<div> 0(95156) INFO: rr [../outbound/api.h:52]: ob_load_api(): unable to import bind_ob - maybe module is not loaded<br>
</div>
<div> 0(95156) INFO: rr [rr_mod.c:177]: mod_init(): outbound module not available<br>
</div>
<div> 0(95156) INFO: <core> [main.c:2619]: main(): processes (at least): 33 - shm size: 67108864 - pkg size: 8388608<br>
</div>
<div> 0(95156) ERROR: tm [tm.c:663]: fixup_hostport2proxy(): TM module: fixup_hostport2proxy($avp(add), 1)<br>
</div>
<div> 0(95156) ERROR: tm [tm.c:663]: fixup_hostport2proxy(): TM module: fixup_hostport2proxy($avp(pp), 2)<br>
</div>
<div> 0(95156) ERROR: tm [tm.c:674]: fixup_hostport2proxy(): bad port number <$avp(pp)><br>
</div>
<div> 0(95156) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:510<br>
</div>
<div> 0(95156) ERROR: <core> [core/rvalue.c:3860]: fix_rval_expr(): failure in cfg at line: 510 col: 37<br>
</div>
<div> 0(95156) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:516<br>
</div>
<div> 0(95156) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:517<br>
</div>
<div>error -1 while trying to fix configuration<br>
</div>
<div> 0(95156) INFO: <core> [core/sctp_core.c:53]: sctp_core_destroy(): SCTP API not initialized<br>
</div>
<span></span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
</div>
<hr tabindex="-1" style="display:inline-block; width:98%">
<div id="x_divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" color="#000000" style="font-size:11pt"><b>From:</b> sr-users <sr-users-bounces@lists.kamailio.org> on behalf of YAS0 CANER <caner_yaso@hotmail.com><br>
<b>Sent:</b> Tuesday, December 18, 2018 11:30 AM<br>
<b>To:</b> Kamailio (SER) - Users Mailing List<br>
<b>Subject:</b> [SR-Users] passing $avp to t_relay functions.</font>
<div> </div>
</div>
<div dir="ltr">
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Hello ,</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
is there a way to pass $avp values to t_relay function. i tried ;</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
t_relay</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
t_relay_udp/tcp</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
t_relay_to</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
t_relay_avp functions</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
log</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<span> 0(75155) ERROR: tm [tm.c:2456]: fixup_t_relay_to(): fixing ($avp(dd), 1)<br>
</span>
<div> 0(75155) ERROR: tm [tm.c:2459]: fixup_t_relay_to():  param  type 8<br>
</div>
<div> 0(75155) ERROR: tm [tm.c:2456]: fixup_t_relay_to(): fixing ($avp(flags), 2)<br>
</div>
<div> 0(75155) ERROR: tm [tm.c:2459]: fixup_t_relay_to():  param  type 11<br>
</div>
<div> 0(75155) CRITICAL: tm [tm.c:2549]: fixup_t_relay_to(): invalid flags <$avp(flags)><br>
</div>
<div> 0(75155) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:489<br>
</div>
<div> 0(75155) ERROR: <core> [core/rvalue.c:3860]: fix_rval_expr(): failure in cfg at line: 489 col: 42<br>
</div>
<div> 0(75155) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:494<br>
</div>
<span> 0(75155) ERROR: <core> [core/route.c:1154]: fix_actions(): fixing failed (code=-1) at cfg:/usr/local/etc/kamailio/kamailio.cfg:495</span><br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
in addition i have a look code , in fixup functions try to resolve host values so parameteres cannot find $avp . </div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
in conclusion , does kamailio need new function to pass $avp value? Can i try to code?</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
Thanks.</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
<div style="font-family:Calibri,Helvetica,sans-serif; font-size:12pt; color:rgb(0,0,0)">
<br>
</div>
</div>
</div>
</body>
</html>