Re: [SR-Users] How to access additional xavp's

2011-03-06 Thread Daniel-Constantin Mierla

Hi Alex,

it took me quite a while due to traveling, but now the issue should be 
fixed on git. Indeed there was an issue with the indexes when accessing 
the xavp as PV.


Thanks,
Daniel

On 12/24/10 12:27 PM, Alex Hermann wrote:

On Friday 24 December 2010, Daniel-Constantin Mierla wrote:

On 12/21/10 2:44 PM, Alex Hermann wrote:

I'm currently toying with xavp's and have some trouble accessing the
values. I want to have access to the xavp that isn't the last added
one. From the wiki page on http://sip-router.org/wiki/devel/xavp I got
the impression that indices are supported, but that doesn't seem to
work.

In the following fragment i want access to the values 1A   1B, how to
do that?

$xavp(test=a) = 1A;
$xavp(test[0]=b) = 1B;
$xavp(test=a) = 2A;
$xavp(test[0]=b) = 2B;

Yes, indexes are supported, functionality should be: when you do not use
an index, then you just stack a new value. When you use indexes, you
overwrite.

In this case you have to use indexes after a and be, like
$xavp(test=a[0]) a.s.o.

This also doesn't work, see below and the wiki page says the index should be on 
the avpname... Can you explain what the index on the avpname does and
what the index on the subfield does, because i thought i understood, but it 
doesn't seem to work.

What i want to accomplish is to set an xavp (test) multiple times with multiple 
subfields (a  b) so that when i do an pv_unset($xavp(test)) i get the
next set of subfields (to be used for a serial forking scenario later on). This 
already works. Now i want to have random access to the xavp, using an
index to get to the right set of subfields. ie if i query $xavp(test[0]=a) i get 
2A, $xavp(test[1]=b) should give 1B.

If i get this working i'll post an interesting patch to sqlops soon :)


I did some more testing and think there is a off-by-one bug somewhere:

$xavp(test=a) = 1A;
$xavp(test[0]=b) = 1B;
$xavp(test=a) = 2A;
$xavp(test[0]=b) = 2B;
$xavp(test[1]=a) = 3A;
$xavp(test[1]=b) = 3B;

xlog(Index on subavp);
xlog(0: $xavp(test));
xlog(0a: $xavp(test=a[0]));
xlog(0b: $xavp(test=b[0]));
xlog(1: $xavp(test));
xlog(1a: $xavp(test=a[1]));
xlog(1b: $xavp(test=b[1]));
xlog(2: $xavp(test));
xlog(2a: $xavp(test=a[2]));
xlog(2b: $xavp(test=b[2]));

xlog(Index on avpname);
xlog(0: $xavp(test[0]));
xlog(0a: $xavp(test[0]=a));
xlog(0b: $xavp(test[0]=b));
xlog(1: $xavp(test[1]));
xlog(1a: $xavp(test[1]=a));
xlog(1b: $xavp(test[1]=b));
xlog(2: $xavp(test[2]));
xlog(2a: $xavp(test[2]=a));
xlog(2b: $xavp(test[2]=b));


Results in:

Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: Index on subavp
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 0:xavp:0xb3a627c4
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 0a: 2A
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 0b: 2B
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 1:xavp:0xb3a627c4
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 1a:null
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 1b:null
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 2:xavp:0xb3a627c4
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 2a:null
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 2b:null
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: Index on avpname
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 0:xavp:0xb3a627c4
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 0a: 2A
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 0b: 2B
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 1:xavp:0xb3a6286c
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 1a: 1A
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 1b: 1B
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 2:null
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 2a:null
Dec 24 12:07:40 veyron wsproxy1[13032]: ERROR:script: 2b:null
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:470]: + XAVP 
list: 0xb3a62770
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:473]:  *** 
XAVP name: test
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:474]:  XAVP 
id: 2063405720
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:475]:  XAVP 
value type: 6
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:496]:  XAVP 
value:xavp:0xb3a627c4
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:470]: + XAVP 
list: 0xb3a627c4
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:473]:  *** 
XAVP name: b
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:474]:  XAVP 
id: 110
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:475]:  XAVP 
value type: 2
Dec 24 12:07:40 veyron wsproxy1[13032]: INFO:core  [xavp.c:484]:  XAVP 
value: 2B
Dec 24 12:07:40 veyron 

Re: [SR-Users] Kamailio auth_radius: duplicate User-Name attribute

2011-03-06 Thread Kosilov Fedor
Thank you for the tip, Ovidiu!
The problem was with my dictionary indeed. There were two attributes
with duplicate values of 1. I've fixed the dictionary, and now everything
works fine.
Thanks again!

Regards,
Fedor.


2011/3/5 Ovidiu Sas o...@voipembedded.com

 You need to check the dictionaries on your kamailio server.
 Mos likely something is miss configured there.
 Check what value do you have for User-Name and see if you have any
 duplicates for that value.


 Regards,
 Ovidiu Sas

 On Sat, Mar 5, 2011 at 2:32 AM, Kosilov Fedor dangerko...@gmail.com
 wrote:
  Again for testing, I pointed Kamailio directly to my billing radius,
  bypassing Freeradius. The situation is the same, so the problem is
  definitely not with the Freeradius server.
 
  2011/3/5 Kosilov Fedor dangerko...@gmail.com
 
  Hello, Daniel, thank you for your attention to my problem.
 
  I actually don't need accounting support, I just want to implement an
  authorization using radius.
  But for testing purposes, I loaded the acc module and set radius_extra
  param. Nothing has changed.
 
  Here is a part of my config:
 
 
  ...
  modparam(acc, radius_config,
 /etc/radiusclient-ng/radiusclient.conf)
  modparam(acc, radius_extra, User-Name=$Au)
  ...
  modparam(auth_radius, radius_config,
  /etc/radiusclient-ng/radiusclient.conf)
  modparam(auth_radius, auth_extra,  NAS-Identifier=$var(ident))
  ...
  route {
  #Definitions
  $var(ident) = kamserv.example.com;
  ...
  route(3); #Auth
  ...
  }
 
  ...
 
  route[3] {
  if (is_method(REGISTER))
  {
  if (is_from_local()) {
  if (!radius_www_authorize($td))
  {
  www_challenge($sel(to.uri.host), 1);
  exit;
  } else {
 
  avp_db_delete($sel(to.uri),$avp(s:ip));
 
  avp_db_delete($sel(to.uri),$avp(s:dpid));
 
  avp_db_delete($sel(to.uri),$avp(s:fr_timer));
 
  avp_db_delete($sel(to.uri),$avp(s:calls_limit));
 
  avp_db_store($sel(to.uri),$avp(s:ip));
 
  avp_db_store($sel(to.uri),$avp(s:dpid));
 
  avp_db_store($sel(to.uri),$avp(s:fr_timer));
 
  avp_db_store($sel(to.uri),$avp(s:calls_limit));
 
 if
  ($au!=$sel(to.uri.user))||($au!=$sel(from.uri.user)) {
  sl_send_reply(403,Forbidden
  auth ID);
  exit;
  } else {
  if ($avp(s:ip)!='any' 
  $sel(src.ip)!=$avp(s:ip)) {
 
  sl_send_reply(403,Forbidden);
  exit;
  }
  }
  }
 
  } else {
  sl_send_reply(403,Forbidden);
  exit;
  }
  } else {
  if ($sel(src.ip)==192.168.0.2) {
  return;
  } else if (is_from_local()) {
  if
  (!radius_proxy_authorize($sel(from.uri.host),$sel(from.uri.user))) {
  proxy_challenge($sel(from.uri.host),
  1);
  exit;
  }
  if ($avp(s:ip)!='any' 
 $sel(src.ip)!=$avp(s:ip))
  {
   sl_send_reply(403,Forbidden);
  exit;
  }
 
  if (is_method(PUBLISH))
  {
  if ($au!=$sel(to.uri.user)) {
  sl_send_reply(403,Forbidden
  auth ID);
  exit;
  }
  } else if ($au!=$sel(from.uri.user)) {
  sl_send_reply(403,Forbidden auth
 ID);
  exit;
  }
  consume_credentials();
  } else {
  sl_send_reply(403,Forbidden);
  exit;
  }
  }
  }
  ...
 
  And again a part of the freeradius log:
 
  rad_recv: Access-Request packet from host 127.0.0.1 port 58933, id=135,
  length=298
  User-Name = 2219...@example.com
  Digest-Attributes = 0x0a0932323139303031
  Digest-Attributes = 0x01106c696e6b2d726567696f6e2e7275
  Digest-Attributes =
  0x0222545848676630317833314f7076767759512b6b73674c63554d51784f6c347634
  Digest-Attributes = 0x04147369703a6c696e6b2d726567696f6e2e7275
  Digest-Attributes = 0x030a5245474953544552
  Digest-Attributes = 0x050661757468
  Digest-Attributes = 0x090a3030303030303031
  Digest-Attributes = 0x080c39636238383130616531
  Digest-Response = efdcf92b58f694b97928856614057436
  Service-Type = 

Re: [SR-Users] Newly acquired SIP fails authorization from softphone

2011-03-06 Thread Daniel-Constantin Mierla

Hello,

On 3/5/11 2:16 AM, Larry Baumbach wrote:

I am a newbie to the world of VIOP.  I am attempting to set up an ATA with SIP.

  I created a SIP at account iptel.com and received an email
confirmation stating We are reserving the following SIP address for
you: sip:larry.baumb...@iptel.org.

I tried to testing this address in Xlite but got messages saying:
Account failed to enable.  Account Iptel could not be enabled.
Verify your user ID, password and authorization name.

When I set up the SIP account in Xlite I used:
UserID: larry.baumb...@iptel.org  ( I also tried
larry.baumbach  sip:larry.baumb...@iptel.org)
Domain: sip.iptel.org
Password: my password
Authorization name:  (I left blank as I did not receive any)


the auth username is the same as user id. Try that and see if works.

Cheers,
Daniel


I can log into SERweb with the same UserID and Password and access my account.

What am I doing wrong?  Or is there some kind of wait time before my
SIP address is activated?
I have spent too much time trying to get this to work on my own.

Thanks very much for any help you can provide.





--
Daniel-Constantin Mierla
http://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] Balancing Asterisk

2011-03-06 Thread Andy Lippitt
Hello all,

 

I've read as many of the asterisk balancing threads as I can find.  Either
my situation is unusual or I simply haven't understood anything I've read.

 

In short, I'm building an web/phone mashup which uses Asterisk's AGI to get
its work done.  My only users are on the PSTN connected to Asterisk through
a SIP trunk provider.  So presently, in and out through the same trunk, apps
live on the single Asterisk box.

 

My goal is scaling and failover.  I don't have any need for cross talk or
transfers between the asterisk instances, and the algo's in dispatcher seem
fine.  It seems to me that I should be setting the sip-router up a
replacement for the existing peer in Asterisk.  What leaves me scratching my
head is how I then register the sip-router with the upstream provider.
Alternatively, if I use the sip-router as an outboundproxy from asterisk
(which seems like it's going to take some hacking to make this work in 1.4),
doesn't this now mean I have multiple UAC's trying to register for the same
name?

 

Can someone set me on the right track?

 

Thanks,

Andy Lippitt

 

 

___
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