[SR-Users] Dialplan question

2011-07-07 Thread alex pappas
Dear all,

I have these 3 entries in the dialplan:

dpid   pr   match_exp  attr

2   50   ^38.+  porvider_A
2   50   ^3802.+  porvider_B
2   50   ^3806.+  porvider_C

with the fifo command :

*kamctl fifo dp_translate 2 3806328881*
Output::
ATTRIBUTES::* porvider_A*

I would expect that the dialplan module would choose the third choice which
is the correct one for this call.

From the dialplan documentation i understand that the priority is needed
when the prefixes are overlaping in terms of they are the same but with
different attrs like :
2   50   ^38.+  porvider_A
2   50   ^3802.+  porvider_B
*2   50   ^3806.+  porvider_C*
*2   50   ^3806.+  porvider_D*
*
*
here i understand that I should use priorities.

Does anyone knnows how this works ??

Thank you in advance
Alex
*
*
___
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


Re: [SR-Users] Manipulate From header

2011-05-25 Thread alex pappas
Henning hi,

I did looked the trace and the headers were the same.
In Kamailio-1.5.3 it worked. In Kamailio 3.x.x it seems to not behave
properly and I dont understand why since it does not require any special
configuration.

Any other ideas ?

Cheers
Alex



2011/5/23 Henning Westerholt henning.westerh...@1und1.de

 On Friday 20 May 2011, alex pappas wrote:
  I'm trying to change the From uri and Dsplay but without sucess.
 
  My config is as follow:
 
  if(dp_translate(,
  $avp(s:frm_user_name)/$avp(s:test_frm_user_name)))  -- i'm sending
  2112202701 and I get back corectly 701 {
  $avp(s:display) = $avp(s:test_frm_user_name);
  $avp(s:fu_uri) = sip: +
  $avp(s:test_frm_user_name) + @ + $fd;
 
  xlog(alx --- The avp(s:display):
  $avp(s:display)  avp(s:fu_uri)=$avp(s:fu_uri)  --\n);  -- I
  see values  701 and sip:701@my_IP_address
 
 
  uac_replace_from($avp(s:display),$avp(s:fu_uri)); Here I log the fu
  and I see that nothing has changed..
 
   }

 Hi Alex,

 i guess your changes to the from header are not visible because they are
 not
 applied yet. They should be visible on the message that is send out to the
 network, have you looked to a trace? Otherwise you could use the
 apply_msg_change method, then it should be also visible:

 http://www.kamailio.org/docs/modules/3.1.x/modules/textopsx.html#msg_apply_changes

 Cheers,

 Henning

___
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


[SR-Users] Manipulate From header

2011-05-20 Thread alex pappas
Dear all,

I'm trying to change the From uri and Dsplay but without sucess.

My config is as follow:

if(dp_translate(, $avp(s:frm_user_name)/$avp(s:test_frm_user_name)))
 -- i'm sending 2112202701 and I get back corectly 701
{
$avp(s:display) = $avp(s:test_frm_user_name);
$avp(s:fu_uri) = sip:
+ $avp(s:test_frm_user_name) + @ + $fd;

xlog(alx --- The avp(s:display):
$avp(s:display)  avp(s:fu_uri)=$avp(s:fu_uri)  --\n);  -- I
see values  701 and sip:701@my_IP_address


uac_replace_from($avp(s:display),$avp(s:fu_uri));
Here I log the fu and I see that nothing has
changed..

 }


Do you have any ideas on that ?

I use Kamailio 3.1.3

Thank you in advance
Alex
___
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


[SR-Users] redirect implementation with dispatcher

2011-05-11 Thread alex pappas
Dear all,

I'm trying to create a service which when a call reach Kamailio, this call
get's a number of gateways in round robin mode and from them I create uri
and append_branches.

The all scenario works fine except that I don't get from Dispatcher the
round robin mode. Is is the way I ask Dispatcher and i don't get the results
I need.
In other scenarios Dispatcher works fine. The other thing is that I tried
the random alg of Dispatcher and that works.
I'm trying to understand what I'm doing wrong and why random alg works but
round robin not.

I'm attaching my code if anyone has an idea of what I'm doing wrong.

Thank you
Alex

*Scenario description:*
*
Call enter
-- Dialplan (Here if has a match get the attributes
which is a list of dispatcher gw group in the form of 100.101.#)

   -- Dispatcher (For every dispatcher gw group
appnd the branch)

-- Redirect the call*


route[TEST]
{

  if(dp_translate($avp(s:lcr_id), $rU/$rU))
{
$var(i) = 0;
while($(var(dpattrs){s.select,$var(i),.})!=#) *#attr example
is gw group of disptcher in order 100.101.# or in my scenario is 200.# which
in Dispatcher is 2 gw* *10.0.0.2 and 10.0.0.3*
{
$avp(s:disp_dstgrp) = $(var(dpattrs){s.select,$var(i),.}{
s.int});
if(ds_select_domain($avp(s:disp_dstgrp), 4))
{

append_branch();
revert_uri();
$avp(s:disp_dstgrp) = null;
}
$var(i) = $var(i) + 1; # for the while loop
   }
### REDIRECTION
#
sl_send_reply(300, Multiple Choice);

#
exit;
} else {
xlog( - No routing found for this call -);
}
}
___
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


Re: [SR-Users] rewriteuri and append_branch with variables

2011-05-07 Thread alex pappas
Hi,
Thanks for the replay.
I already tried the $ru with $var and it works fine but the main problem is
the append_branch.

I'm trying to create a redirect function with the append_branch dynamically
filled in.

Any suggestion on that?

Thanks

Alex


On Fri, May 6, 2011 at 6:31 PM, Iñaki Baz Castillo i...@aliax.net wrote:

 2011/5/6 alex pappas rebel.pap...@gmail.com:
  I'm trying the following and i get error:
 
  $var(new_uri) = sip: +$avp(s:term_prefix) +$rU +@
 +$avp(s:gw_address);
 
  rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));
 
  But it seems that it does not like the variable. The documentation says
 that
  rewriteuri get a string so i don't understand why does not work

 You are not passing a string to erwriteuri() function, but a
 pseudo-variable containing a string as value. It's not the same (not
 at least in kamailio/sip-router configuration DSL language).

 However you can use:

  $ru = $var(new_uri);

 as $ru pseudo-variable (request URI) does allow dynamic assignement.

 --
 Iñaki Baz Castillo
 i...@aliax.net

 ___
 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

___
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


Re: [SR-Users] rewriteuri and append_branch with variables

2011-05-07 Thread alex pappas
Many thanks Ovidiu,

I will try that and get back to the community.

Regards
Alex



On Sat, May 7, 2011 at 11:16 PM, Ovidiu Sas o...@voipembedded.com wrote:

 Just set the RURI to the value that you want and then call append_brach().
 Everything that's in RURI will be appended as a new branch.

 After that, reset the RURI to it's original value: revert_uri().

 Regards,
 Ovidiu Sas

 On Sat, May 7, 2011 at 12:37 PM, alex pappas rebel.pap...@gmail.com
 wrote:
  Hi,
  Thanks for the replay.
  I already tried the $ru with $var and it works fine but the main problem
 is
  the append_branch.
 
  I'm trying to create a redirect function with the append_branch
 dynamically
  filled in.
 
  Any suggestion on that?
 
  Thanks
 
  Alex
 
 
  On Fri, May 6, 2011 at 6:31 PM, Iñaki Baz Castillo i...@aliax.net
 wrote:
 
  2011/5/6 alex pappas rebel.pap...@gmail.com:
   I'm trying the following and i get error:
  
   $var(new_uri) = sip: +$avp(s:term_prefix) +$rU +@
   +$avp(s:gw_address);
  
   rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));
  
   But it seems that it does not like the variable. The documentation
 says
   that
   rewriteuri get a string so i don't understand why does not work
 
  You are not passing a string to erwriteuri() function, but a
  pseudo-variable containing a string as value. It's not the same (not
  at least in kamailio/sip-router configuration DSL language).
 
  However you can use:
 
   $ru = $var(new_uri);
 
  as $ru pseudo-variable (request URI) does allow dynamic assignement.
 
  --
  Iñaki Baz Castillo
  i...@aliax.net
 
  ___
  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
 
 
  ___
  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
 
 

 ___
 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

___
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


[SR-Users] rewriteuri and append_branch with variables

2011-05-06 Thread alex pappas
Dear All,

I'm trying the following and i get error:

$var(new_uri) = sip: +$avp(s:term_prefix) +$rU +@ +$avp(s:gw_address);

rewriteuri=($var(new_uri));  OR append_branch($var(new_uri));

But it seems that it does not like the variable. The documentation says that
rewriteuri get a string so i don't understand why does not work.

Do you have any ideas on  this ?

Cheers
Alex
___
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


Re: [SR-Users] Kamailio with RTPoxy

2011-04-29 Thread alex pappas
Thank you Klaus!
It  works perfect.

regards
Alex

On Thu, Apr 28, 2011 at 8:49 PM, Klaus Darilion 
klaus.mailingli...@pernau.at wrote:

 8 - SDP is searched for occurrence of RFC1918 addresses

 So I gues you call nat_uac_test(8) for a request which does not have a
 body at all. You could use has_body from textops module to extend the
 check, e.g:

 if (has_body(application/sdp)  nat_uac_test(8)) {
  ...


 regards
 klaus



 Am 28.04.2011 18:25, schrieb alex pappas:
  Dear all,
 
  I see in my logs that when the call enters the route :
 
  # Caller NAT detection route
  route[NAT] {
  #!ifdef WITH_NAT
  xlog(alx --- ROUTE NAT , we have nat ---);
  force_rport();
 *if (nat_uac_test(8)) {*
  if (method==REGISTER) {
  fix_nated_register();
  } else {
  fix_nated_contact();
  }
  setflag(FLT_NATS);
  xlog(alx --- ROUTE NAT , set flag FLT_NATS ---);
  }
  #!endif
  return;
  }
 
  I get the following error:
 
  nathelper [nhelpr_funcs.c:195]: *message body has length zero*
  nathelper [nathelper.c:1184]: *cannot extract body from msg!*
 
  From traces i see that only in the SDP I have an IP which is not public
  but even with that I cannot engage the RTPPROXY.
 
  My Kamailio version is 3.1.3 and the config file is plain , from
  installation.
 
  Any ideas?
 
  Thank you Alex
 
 
 
 
 
 
  On Sun, Apr 17, 2011 at 2:20 PM, alex pappas rebel.pap...@gmail.com
  mailto:rebel.pap...@gmail.com wrote:
 
  Dear Alex,
 
  The configuration is the default with WITH_NAT defined.
  I have some extra logs (xlog(RTPPROXY started..)) enabled in the
  RTPPROXY route in order to understand if it is engaged or not.
 
  When I make calls behind NAT the RTPPROXY is engaged but I don't see
  any RTP in traces.
 
  Do you have any idea on how can I keep the RTP?
 
  Thanks
  Alex Pappas
 
 
 
 
  On Fri, Apr 15, 2011 at 6:43 PM, Alex Balashov
  abalas...@evaristesys.com mailto:abalas...@evaristesys.com
 wrote:
 
  On 04/15/2011 09:58 AM, alex pappas wrote:
 
  I have a Kamailio with  RTPoxy configured. The purpose is to
  pass the
  RTP from this server.
  When I make calls behind NAT the RTProxy seems to be engaged
  but in
  traces I don't see  any RTP.
 
  Is there anything wrong with the idea or I'm missing
  something in the
  configuration ?
 
 
  That would be difficult to know without seeing your
 configuration.
 
  --
  Alex Balashov - Principal
  Evariste Systems LLC
  260 Peachtree Street NW
  Suite 2200
  Atlanta, GA 30303
  Tel: +1-678-954-0670
  Fax: +1-404-961-1892
  Web: http://www.evaristesys.com/
 
  ___
  SIP Express Router (SER) and Kamailio (OpenSER) - sr-users
  mailing list
  sr-users@lists.sip-router.org mailto:
 sr-users@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@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@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@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


Re: [SR-Users] Kamailio with RTPoxy

2011-04-28 Thread alex pappas
Dear all,

I see in my logs that when the call enters the route :

# Caller NAT detection route
route[NAT] {
#!ifdef WITH_NAT
xlog(alx --- ROUTE NAT , we have nat ---);
force_rport();
   *if (nat_uac_test(8)) {*
if (method==REGISTER) {
fix_nated_register();
} else {
fix_nated_contact();
}
setflag(FLT_NATS);
xlog(alx --- ROUTE NAT , set flag FLT_NATS ---);
}
#!endif
return;
}

I get the following error:

nathelper [nhelpr_funcs.c:195]: *message body has length zero*
nathelper [nathelper.c:1184]: *cannot extract body from msg!*

From traces i see that only in the SDP I have an IP which is not public but
even with that I cannot engage the RTPPROXY.

My Kamailio version is 3.1.3 and the config file is plain , from
installation.

Any ideas?

Thank you Alex






On Sun, Apr 17, 2011 at 2:20 PM, alex pappas rebel.pap...@gmail.com wrote:

 Dear Alex,

 The configuration is the default with WITH_NAT defined.
 I have some extra logs (xlog(RTPPROXY started..)) enabled in the RTPPROXY
 route in order to understand if it is engaged or not.

 When I make calls behind NAT the RTPPROXY is engaged but I don't see any
 RTP in traces.

 Do you have any idea on how can I keep the RTP?

 Thanks
 Alex Pappas




 On Fri, Apr 15, 2011 at 6:43 PM, Alex Balashov 
 abalas...@evaristesys.comwrote:

 On 04/15/2011 09:58 AM, alex pappas wrote:

  I have a Kamailio with  RTPoxy configured. The purpose is to pass the
 RTP from this server.
 When I make calls behind NAT the RTProxy seems to be engaged but in
 traces I don't see  any RTP.

 Is there anything wrong with the idea or I'm missing something in the
 configuration ?


 That would be difficult to know without seeing your configuration.

 --
 Alex Balashov - Principal
 Evariste Systems LLC
 260 Peachtree Street NW
 Suite 2200
 Atlanta, GA 30303
 Tel: +1-678-954-0670
 Fax: +1-404-961-1892
 Web: http://www.evaristesys.com/

 ___
 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



___
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


Re: [SR-Users] Kamailio with RTPoxy

2011-04-17 Thread alex pappas
Dear Alex,

The configuration is the default with WITH_NAT defined.
I have some extra logs (xlog(RTPPROXY started..)) enabled in the RTPPROXY
route in order to understand if it is engaged or not.

When I make calls behind NAT the RTPPROXY is engaged but I don't see any RTP
in traces.

Do you have any idea on how can I keep the RTP?

Thanks
Alex Pappas



On Fri, Apr 15, 2011 at 6:43 PM, Alex Balashov abalas...@evaristesys.comwrote:

 On 04/15/2011 09:58 AM, alex pappas wrote:

  I have a Kamailio with  RTPoxy configured. The purpose is to pass the
 RTP from this server.
 When I make calls behind NAT the RTProxy seems to be engaged but in
 traces I don't see  any RTP.

 Is there anything wrong with the idea or I'm missing something in the
 configuration ?


 That would be difficult to know without seeing your configuration.

 --
 Alex Balashov - Principal
 Evariste Systems LLC
 260 Peachtree Street NW
 Suite 2200
 Atlanta, GA 30303
 Tel: +1-678-954-0670
 Fax: +1-404-961-1892
 Web: http://www.evaristesys.com/

 ___
 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

___
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


[SR-Users] ACC error | failed to insert into database

2011-01-27 Thread alex pappas
Hi all,

Hve anyone seen before the following error?

*Kamailio acc [acc.c:398]: failed to insert into database*

After a Kamailio restart it is ok but it start again afetr x time.



Thank you Alex
___
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


Re: [SR-Users] Dispatcher Attributes field

2011-01-07 Thread alex pappas
Daniel hi,

The attribute field I use to add an extra prefix to the destination GW. This
is the reason why I'm asking if is possible to get also the description
field. I need to add in my CDRs an extra field which will be the description
of the GW that the call will be terminated.
I can possibly add the description with the prefix in the attribute field as
you told me in the past and grabbed from there in the form of
XXX.GW_Description where XXX=gw_prefix.

Thank you for the answer

Alex




On Fri, Jan 7, 2011 at 11:31 AM, Daniel-Constantin Mierla mico...@gmail.com
 wrote:

  Hello,


 On 1/4/11 5:13 PM, alex pappas wrote:

 Hi all,

 The $avp(dsattrs) it works fine. It was a misconfiguration.

 thanks for reporting back.


 Does anyone knows if is possible to retrieve from Dispatcher the
 description field from each GW and add that to an avp pair?


 Isn't the attribute field enough for such needs? The description field in
 db was intended to map on comments from the text file, just to help admins
 understand what is about that address.

 Cheers,
 Daniel


 Thanks

 Alex





 On Mon, Jan 3, 2011 at 6:13 PM, alex pappas rebel.pap...@gmail.comwrote:

 Dear all,

 I'm trying with the Dispatcher module to terminate a call to three
 different gateways serially.  For each gw I use the attribute field to get
 the attribute and add it as a prefix to the RU.
 The problem is that the $avp(dsattrs) is returning always the first value
 of the first gw that is using.

 example:

 destination sip:100.12.12.12:5060 attrs 111
 destination sip:100.12.12.11:5060 attrs 222
 destination sip:100.12.12.10:5060 attrs 333


 In this example the rU will always be 111+number. I tried also to initiate
 the avp in the Failure route by giving null value but still does not change
 the result.


 In Request route:

  if(ds_select_domain($avp(s:disp_dstgrp), 4))
 {
 $avp(s:term_prefix) = $avp(dsattrs); # avp for CDR
 purpose

 $rU = $avp(dsattrs) + $rU;
 t_on_failure(FAIL_NATIONAL);
 t_relay();
 exit;

 }

 In Failure route:


  if(!ds_next_domain())
 {
 t_reply(503, Service Unavailable);
 exit;
 } else {

$rU = $avp(dsattrs) + $rU;


 t_on_failure(FAIL_THIS);
 append_branch();
 if(!t_relay()) {
 t_reply(503,Service Unavailable);
 exit;
 }



 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
 listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com


___
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


Re: [SR-Users] Dispatcher Attributes field

2011-01-07 Thread alex pappas
thank you Daniel,

That it will be perfect!


Cheers
Alex



On Fri, Jan 7, 2011 at 3:17 PM, Daniel-Constantin Mierla
mico...@gmail.comwrote:

  Hi Alex,


 On 1/7/11 11:18 AM, alex pappas wrote:

 Daniel hi,

 The attribute field I use to add an extra prefix to the destination GW.
 This is the reason why I'm asking if is possible to get also the description
 field. I need to add in my CDRs an extra field which will be the description
 of the GW that the call will be terminated.
 I can possibly add the description with the prefix in the attribute field
 as you told me in the past and grabbed from there in the form of
 XXX.GW_Description where XXX=gw_prefix.

 yes, you can keep in attrs field various format of data, one example will
 be:

 prefix=123;desc=gwX

 Then in config you can use param transformation to get each of them:

 $(avp(dsattrs){param.value,prefix}

 $(avp(dsattrs){param.value,desc}

 Cheers,
 Daniel



 Thank you for the answer

 Alex




 On Fri, Jan 7, 2011 at 11:31 AM, Daniel-Constantin Mierla 
 mico...@gmail.com wrote:

  Hello,


 On 1/4/11 5:13 PM, alex pappas wrote:

 Hi all,

 The $avp(dsattrs) it works fine. It was a misconfiguration.

  thanks for reporting back.


 Does anyone knows if is possible to retrieve from Dispatcher the
 description field from each GW and add that to an avp pair?


  Isn't the attribute field enough for such needs? The description field in
 db was intended to map on comments from the text file, just to help admins
 understand what is about that address.

 Cheers,
 Daniel


 Thanks

 Alex





 On Mon, Jan 3, 2011 at 6:13 PM, alex pappas rebel.pap...@gmail.comwrote:

 Dear all,

 I'm trying with the Dispatcher module to terminate a call to three
 different gateways serially.  For each gw I use the attribute field to get
 the attribute and add it as a prefix to the RU.
 The problem is that the $avp(dsattrs) is returning always the first value
 of the first gw that is using.

 example:

 destination sip:100.12.12.12:5060 attrs 111
 destination sip:100.12.12.11:5060 attrs 222
 destination sip:100.12.12.10:5060 attrs 333


 In this example the rU will always be 111+number. I tried also to
 initiate the avp in the Failure route by giving null value but still does
 not change the result.


 In Request route:

  if(ds_select_domain($avp(s:disp_dstgrp), 4))
 {
 $avp(s:term_prefix) = $avp(dsattrs); # avp for
 CDR purpose

 $rU = $avp(dsattrs) + $rU;
 t_on_failure(FAIL_NATIONAL);
 t_relay();
 exit;

 }

 In Failure route:


  if(!ds_next_domain())
 {
 t_reply(503, Service Unavailable);
 exit;
 } else {

$rU = $avp(dsattrs) + $rU;


 t_on_failure(FAIL_THIS);
 append_branch();
 if(!t_relay()) {
 t_reply(503,Service Unavailable);
 exit;
 }



 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
 listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com



 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing 
 listsr-us...@lists.sip-router.orghttp://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com


___
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


[SR-Users] Dispatcher Attributes field

2011-01-03 Thread alex pappas
Dear all,

I'm trying with the Dispatcher module to terminate a call to three different
gateways serially.  For each gw I use the attribute field to get the
attribute and add it as a prefix to the RU.
The problem is that the $avp(dsattrs) is returning always the first value of
the first gw that is using.

example:

destination sip:100.12.12.12:5060 attrs 111
destination sip:100.12.12.11:5060 attrs 222
destination sip:100.12.12.10:5060 attrs 333


In this example the rU will always be 111+number. I tried also to initiate
the avp in the Failure route by giving null value but still does not change
the result.


In Request route:

 if(ds_select_domain($avp(s:disp_dstgrp), 4))
{
$avp(s:term_prefix) = $avp(dsattrs); # avp for CDR
purpose

$rU = $avp(dsattrs) + $rU;
t_on_failure(FAIL_NATIONAL);
t_relay();
exit;

}

In Failure route:


 if(!ds_next_domain())
{
t_reply(503, Service Unavailable);
exit;
} else {

   $rU = $avp(dsattrs) + $rU;


t_on_failure(FAIL_THIS);
append_branch();
if(!t_relay()) {
t_reply(503,Service Unavailable);
exit;
}
___
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


Re: [SR-Users] VIA header x-route-tag

2010-12-01 Thread alex pappas
Daniel hi,

When I'm trying the bellow I get the following error:

Dec  1 10:06:17 opensips1 kamailio: ERROR: core [select.c:149]:
parse_select: invalid index, no closing ]
Dec  1 10:06:17 opensips1 kamailio: ERROR: pv [pv_select.c:45]: invalid
select name [...@via.params[x-route-tag]]
Dec  1 10:06:17 opensips1 kamailio: ERROR: core [pvapi.c:550]: pvar sel
has an invalid name param [...@via.params[x-route-tag]]
Dec  1 10:06:17 opensips1 kamailio: ERROR: core [pvapi.c:705]: wrong char
[)/41] in [$sel(@via.params[x-route-tag])] at [29 (5)]
Dec  1 10:06:17 opensips1 kamailio: : core [cfg.y:3328]: parse error in
config file /usr/local/etc/kamailio/kamailio.cfg, line 705, column 23-52:
unknown script pseudo variable $sel(@via.params[x-route-tag])

I also added an @ before the via

if (search(x-route-tag))
{
$avp(s:xroutetag) = $sel(*...@*via.params[x-route-tag]);
xlog(- We have a x-route-tag in the SIP msg avp:
$avp(s:xroutetag) -);
};


Thank you
Alex


On Tue, Nov 30, 2010 at 10:47 PM, Daniel-Constantin Mierla 
mico...@gmail.com wrote:



 On 11/30/10 4:07 PM, marius zbihlei wrote:

 On 11/30/2010 01:58 PM, alex pappas wrote:

 Dear All,

 We have some cisco gw that they send to the Kamailio in the first invite
 and inside the VIA header an x-route-tag=The Gateway that the call
 entered.

 I'm trying to add this to the acc module in order to have it recorded but
 without sucess.
 My config is this:

 if (search(x-route-tag))
 {
 avp(s:xroutetag) = $sel(@via);
 xlog(- We have a x-route-tag in the SIP msg avp:
 $avp(s:xroutetag) -);
 };

 I'm trying to add the VIA header to an avp so I could manipulate the string
 but i cannot implement this.

 Does anyone can suggest a way to add the *x-route-tag* value to an AVP?

 Thank you in advance

 Alex

 sample VIA header:  Via: SIP/2.0/UDP  10.0.0.15:5060;*
 x-route-tag=tgrp:TANDEM-KOR*

  Hello,

 You can use transformations
 http://kamailio.org/dokuwiki/doku.php/transformations:3.1.x . This should
 to the trick: (careful on needed modules)

 $var(s:xroutetag) = $(hdr(Via){re.subst,/x-route-tag=(.*)/\1/});



  just as alternative, in this case it should works also with selects
 variables, you can try:

 $sel(via.params[x-route-tag])

 Cheers,
 Daniel

 --
 Daniel-Constantin Mierla
 Kamailio (OpenSER) Advanced Training
 Jan 24-26, 2011, Irvine, CA, USAhttp://www.asipto.com


 ___
 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


___
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


Re: [SR-Users] VIA header x-route-tag

2010-12-01 Thread alex pappas
Marius hi,

Thank you for your replay.
With the regular expression you provided me I get *SIP/2.0/UDP
172.16.0.13:5060;tgrp:TNDEM-ACR*

Can I isolate only *tgrp:TNDEM-ACR ?

*Thank you
Alex
*
*
On Tue, Nov 30, 2010 at 5:07 PM, marius zbihlei marius.zbih...@1and1.rowrote:

  On 11/30/2010 01:58 PM, alex pappas wrote:

 Dear All,

 We have some cisco gw that they send to the Kamailio in the first invite
 and inside the VIA header an x-route-tag=The Gateway that the call
 entered.

 I'm trying to add this to the acc module in order to have it recorded but
 without sucess.
 My config is this:

 if (search(x-route-tag))
 {
 avp(s:xroutetag) = $sel(@via);
 xlog(- We have a x-route-tag in the SIP msg avp:
 $avp(s:xroutetag) -);
 };

 I'm trying to add the VIA header to an avp so I could manipulate the string
 but i cannot implement this.

 Does anyone can suggest a way to add the *x-route-tag* value to an AVP?

 Thank you in advance

 Alex

 sample VIA header:  Via: SIP/2.0/UDP  10.0.0.15:5060;*
 x-route-tag=tgrp:TANDEM-KOR*

  Hello,

 You can use transformations
 http://kamailio.org/dokuwiki/doku.php/transformations:3.1.x . This should
 to the trick: (careful on needed modules)

 $var(s:xroutetag) = $(hdr(Via){re.subst,/x-route-tag=(.*)/\1/});



 Cheers,
 Marius




 ___
 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


___
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


Re: [SR-Users] VIA header x-route-tag

2010-12-01 Thread alex pappas
Marius hi,

I got the value I needed with:

$avp(s:xroutetag) =
$(hdr(Via){re.subst,/^SIP(.*)x-route-tag=tgrp:(.*)()/\2/});

You are right about Daniels way so I will continue trying in that.

Thanks for your time

Alex




On Wed, Dec 1, 2010 at 10:26 AM, Marius Zbihlei marius.zbih...@1and1.rowrote:

 Hello Alex,

 Can't test it right now, but it should work better with this :

 $var(s:xroutetag) = $(hdr(Via){re.subst,/^.*;x-route-tag=(.*)/\1/})

 You want to substitute (only affects $var) the whole via header with the
 regex found between () and referenced by \1. Keep in mind that Daniel's
 solution is more elegant and should work for you.

 Marius

 
 From: alex pappas [rebel.pap...@gmail.com]
 Sent: Wednesday, December 01, 2010 9:15 AM
 To: Marius Zbihlei
 Cc: sr-users@lists.sip-router.org
 Subject: Re: [SR-Users] VIA header x-route-tag

 Marius hi,

 Thank you for your replay.
 With the regular expression you provided me I get SIP/2.0/UDP
  172.16.0.13:5060;tgrp:TNDEM-ACR

 Can I isolate only tgrp:TNDEM-ACR ?

 Thank you
 Alex


 On Tue, Nov 30, 2010 at 5:07 PM, marius zbihlei marius.zbih...@1and1.ro
 mailto:marius.zbih...@1and1.ro wrote:
 On 11/30/2010 01:58 PM, alex pappas wrote:
 Dear All,

 We have some cisco gw that they send to the Kamailio in the first invite
 and inside the VIA header an x-route-tag=The Gateway that the call
 entered.

 I'm trying to add this to the acc module in order to have it recorded but
 without sucess.
 My config is this:

 if (search(x-route-tag))
{
avp(s:xroutetag) = $sel(@via);
xlog(- We have a x-route-tag in the SIP msg avp:
 $avp(s:xroutetag) -);
};

 I'm trying to add the VIA header to an avp so I could manipulate the string
 but i cannot implement this.

 Does anyone can suggest a way to add the x-route-tag value to an AVP?

 Thank you in advance

 Alex

 sample VIA header:  Via: SIP/2.0/UDP  10.0.0.15:5060http://10.0.0.15:5060
 ;x-route-tag=tgrp:TANDEM-KOR

 Hello,

 You can use transformations
 http://kamailio.org/dokuwiki/doku.php/transformations:3.1.x . This should
 to the trick: (careful on needed modules)


 $var(s:xroutetag) = $(hdr(Via){re.subst,/x-route-tag=(.*)/\1/});




 Cheers,
 Marius






 ___
 SIP Express Router (SER) and Kamailio (OpenSER) - sr-users mailing list
 sr-users@lists.sip-router.orgmailto:sr-users@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@lists.sip-router.org
http://lists.sip-router.org/cgi-bin/mailman/listinfo/sr-users


[SR-Users] VIA header x-route-tag

2010-11-30 Thread alex pappas
Dear All,

We have some cisco gw that they send to the Kamailio in the first invite and
inside the VIA header an x-route-tag=The Gateway that the call entered.

I'm trying to add this to the acc module in order to have it recorded but
without sucess.
My config is this:

if (search(x-route-tag))
{
avp(s:xroutetag) = $sel(@via);
xlog(- We have a x-route-tag in the SIP msg avp:
$avp(s:xroutetag) -);
};

I'm trying to add the VIA header to an avp so I could manipulate the string
but i cannot implement this.

Does anyone can suggest a way to add the *x-route-tag* value to an AVP?

Thank you in advance

Alex

sample VIA header:  Via: SIP/2.0/UDP  10.0.0.15:5060;*
x-route-tag=tgrp:TANDEM-KOR*
___
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


Re: [SR-Users] Dispatcher is using gateways in Probing mode

2010-11-17 Thread alex pappas
Ηι Carsten,

I added in my failure route the following :

if (t_check_status(408)) {
  ds_mark_dst(i);
}

and everything works fine.

Thank you very much for your help

Alex



On Tue, Nov 16, 2010 at 6:03 PM, Carsten Bock li...@bock.info wrote:

 Hi Alex,

 you must have set this to ds_mark_dst(i) instead of p, only i
 will set the gateway to inactive.
 Also you should add a t_check_status() before calling ds_mark_dst()
 in order to define the codes, which should lead to the required state,
 e.g.:

 if (t_check_status(408|503)) {
   ds_mark_dst(p);
 }

 So only in case the ds_mark_dst would only be called, if the status of
 the transaction was 408 (Request timeout) or 503 (Service
 unavailable).

 Please be aware, that the new setting to probing does only apply to
 new requests (retransmits to the disabled destination will still occur
 until the transaction does timeout).

 We have been using this functionality for several years now and we
 never had problems

 Carsten

 2010/11/16 alex pappas rebel.pap...@gmail.com:
  Hi Carsten,
 
  I tried that before but it's not what I really need. By saying that ,
 when I
  added this function to my failure route then every call failure that
  happened (routing problem let's say) then immediately this GW was set to
  Inactive mode and I was not able to use it.
 
  What I'm asking is to understand why Dispatcher module is sending calls
 to a
  GW in P state?
 
  Thanks
 
  Alex
 
 
 
  On Tue, Nov 16, 2010 at 3:54 PM, Carsten Bock li...@bock.info wrote:
 
  Hi Alex,
 
  do you have a ds_mark_dst(p) in your failure route? This needs to
  be called threshhold times in order to set the gateway to probing...
  And please be aware of timeouts: If you have a Transaction-timeout of
  e.g. 60 seconds, then the failure-route would be executed after 60
  seconds and for this time the gateway would stay active.
 
  Carsten
 
 
  2010/11/16 alex pappas rebel.pap...@gmail.com:
   Hi Daniel,
  
   I have configured that option before i send it the email.
   modparam(dispatcher, ds_probing_threshhold, 2)
  
   I have gateways A,A,B,C. (A and A is the same gw. I want to send more
   calls
   that's why is added twice)
  
   C is the dead gateway. It never responds back to the options because
 is
   not
   a real IP.
  
   When Dispatcher is sending the Invites it always includes the dead gw
 C
   which by the way is in probing mode.
  
   Doing some test calls i have the following results in send it Invites:
  
   A, B, A, C
   B, A, C, A
   A, C, A, B
   A, B , A ,C
   B, A, C, A
   A, C, A, B
   A, B , A ,C
   B, A, C, A
   A, C, A, B
   A, B, A, C
   B, A, C, A
  
   As you can see the C dead gw is always included to the Invites send.
  
   Am i missing something in the configuration?
   I also tried to use “9” - use weight based load distribution but with
 no
   success. i got in the logs that this algorithm is not implemented. I'm
   doing
   something wrong here or is not implemented in this version of
 Kamailio.
   (
   3.0.1)
  
   Thank you in advance for your help.
  
   Regards
   Alex
  
  
  
  
   On Fri, Nov 12, 2010 at 10:14 PM, Daniel-Constantin Mierla
   mico...@gmail.com wrote:
  
   Hi Alex,
  
   dispatcher module does not send new invites to inactive gateways. But
   in
   case a destination became inactive while some INVITEs were already
   through
   dispatcher, these recent inactive gateways may still be used for
 them.
  
   Regarding the probing mode, dispatcher will never select a probing
   gateway
   as first option to route the call, but they are kept as alternative.
   This is
   the current implementation, we may add a module parameter to skip
   gateways
   in probing mode even for secondary alternatives.
  
   Non-responsive gateways change the state after a while, see:
  
  
  
 http://kamailio.org/docs/modules/stable/modules_k/dispatcher.html#id2567110
  
   Cheers,
   Daniel
  
   On 11/12/10 12:58 PM, alex pappas wrote:
  
   Dear all,
  
   Does anyone can explain how Dispatcher module is sending calls to the
   gateways in the different states?
  
   I mean if I have 3 gateways and the one of them is in Probing mode
 why
   Dispatcher is continuing sending there calls? Why this gateway is not
   changing from Probing to Inactive since is not replaying to OPTIONS
   messages
   send by Kamailio?
  
   Configuration:
  
   modparam(dispatcher, flags, 2)
   modparam(dispatcher, ds_ping_interval, 5)
   modparam(dispatcher, ds_probing_mode, 1)
   modparam(dispatcher, ds_probing_threshhold, 2)
   modparam(dispatcher, dst_avp, $avp(s:dst_avp))
   modparam(dispatcher, grp_avp, $avp(dsgrp))
   modparam(dispatcher, cnt_avp, $avp(i:202))
   modparam(dispatcher, ds_append_branch, 0)
  
   using db for gw:
  
   setid 123,destination sip:xxx..xxx, flag 0 ...
  
   in ROUTE:
   if(ds_select_domain($avp(s:disp_dstgrp), 4))
  
   in Failure Route
  
   if(!ds_next_domain())
  
   I want Dispatcher when it sees a node gateway that is dead

[SR-Users] Dispatcher is using gateways in Probing mode

2010-11-12 Thread alex pappas
Dear all,

Does anyone can explain how Dispatcher module is sending calls to the
gateways in the different states?

I mean if I have 3 gateways and the one of them is in Probing mode why
Dispatcher is continuing sending there calls? Why this gateway is not
changing from Probing to Inactive since is not replaying to OPTIONS messages
send by Kamailio?

Configuration:

modparam(dispatcher, flags, 2)
modparam(dispatcher, ds_ping_interval, 5)
modparam(dispatcher, ds_probing_mode, 1)
modparam(dispatcher, ds_probing_threshhold, 2)
modparam(dispatcher, dst_avp, $avp(s:dst_avp))
modparam(dispatcher, grp_avp, $avp(dsgrp))
modparam(dispatcher, cnt_avp, $avp(i:202))
modparam(dispatcher, ds_append_branch, 0)

using db for gw:

setid 123,destination sip:xxx..xxx, flag 0 ...

in ROUTE:
if(ds_select_domain($avp(s:disp_dstgrp), 4))

in Failure Route

if(!ds_next_domain())

I want Dispatcher when it sees a node gateway that is dead , to Not send any
other calls.

Thank you in advance

Alex
___
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


[SR-Users] sip trace not logging the first invite

2010-08-03 Thread alex pappas
Dear friends,

I'm using the sip_trace module in order to log into a mysql DB all the SIP
messages that are passing from my kamailio. I have the setflag(4) on the top
of the route[0] and I have all the sip messages logged in the mysql Db.
The problem is that I don't see the first INVITE of the call.

Scenario:

gateway1 -- kamailio  gateway2

The INVITE from gateway1 to kamailio is not logged. The trace is starting
from the first 100 trying message.

Is anyone aware on where the problem is ?

P.S. By using the sip_trace() method I get the first INVITE but not the rest
of the trace in the way that setflag(4) is logging.


Thank you in advance

Alex
___
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