[OpenSIPS-Users] b2bua core dump & db truncate

2010-10-25 Thread thrillerbee
I'm waiting for my b2bua box to core dump again so I can get the backtrace,
but is it expected behavior that OpenSIPS cannot restart w/o first
truncating the b2b_entities & b2b_logic tables?  That makes for a messy
recovery...

Thanks.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] dispatcher use_default

2010-10-25 Thread thrillerbee
I've run into an issue when trying to utilize the use_default modparam for
the dispatcher module.  My understanding is that it would reserve the last
entry in the setid as a "failover" gateway.  Otherwise, it would treat all
other gateways according to their weight.  In reality, it seems that, if
there are 3 gateways, the 2nd is used exclusively.  If the 2nd gw is moved
to an 'inactive' state, the 1st gateway is then used exclusively.  As
expected, if 1 & 2 go down the 3rd is finally used.

Why aren't gw 1 & 2 statelessly load balanced like they would be if
use_default was disabled?

Thanks.
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


[OpenSIPS-Users] trouble compiling latest svn head

2010-10-25 Thread Brett Nemeroff
Hello All,
Trying to compile head at rev 7323 and its erring out in the domain
and domain policy modules. I've done a make clean. There really isn't
much detail to the error.

Anyone else having this problem?

Thanks,
Brett

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Services management - question about proper module

2010-10-25 Thread Maciej Bylica
Hi Bogdan,

I've already installed Avpops, it works nice...
I fully agree, the scenario You've covered is in my wish list :)

Thanks for help,
Maciej


> Hi Maciej
>
> Maciej Bylica wrote:
>> Hi,
>>
>> Have anyone tried to use usr_preferences, AVPops to determine the
>> service to be fetched by the script?
>>
> That is the the proper module for handling generic attribute. Uisng
> AVPops module you can load from db, for a certain user, a certain
> attribute (via avp_db_load ). You may use different attributes (AVPs)
> for different services - like one attreibute to be "URI for permanent
> call fwd" other for being "URI for busy redirect".
>> Then i am planning to use switch statement to add different prefixes
>> before the called number and t_relay to asterisk server to do the
>> rest.
>>
> keep in mind that certain ops can be done on opensips (like call fwd),
> you do not need asterisk.
>
> Regards,
> Bogdan
>> Is this proper point of view?
>>
>> Thx,
>> Maciej.
>>
>>
>>
>>
>>> Hello.
>>>
>>> I am planning to provide opensips with a kind of mechanism to manage
>>> customer services/features like call-forward/VM/follow-me and so on.
>>> It should work in following way: If $rU is provided in subscriber
>>> table then user enabled service name is obtained from some db table.
>>> On the basis of that value opensips should do the magic :)
>>>
>>> The question is what kind of module is the best to follow. Is it
>>> AVPops or maybe there is another way to achieve my goal.
>>> What are pros and cons.
>>>
>>> Thx in advance,
>>> Maciej.
>>>
>>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS Bootcamp
> 15 - 19 November 2010, Edison, New Jersey, USA
> www.voice-system.ro
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] How much of the normal PBX Functions can be implemented using OpenSIPS, Mediaproxy and maybe SEMS

2010-10-25 Thread Duane Larson
So are you able to integrate FreeSwitch with OpenSIPS like Asterisk is
integrated(Usernames and Passwords link up)?

On Mon, Oct 25, 2010 at 8:44 AM, Fernando Gregianin Testa <
te...@voicetechnology.com.br> wrote:

> As a FreeSWITCH user for about 1yr for conferencing systems, I can
> assure it works very well as a virtualized PBX on KVM, Xen or OpenVZ
> virtualization platforms.
>
> Fernando Gregianin Testa
> Voice Technology Ltda
> ddr +55 11 21752166
> cel +55 11 88225531
>
> On 24-10-2010 16:25, Jeff Pyle wrote:
> > Mike,
> >
> > We've been asking much the same questions.  We have decided to take a
> > serious look at Freeswitch for the "Asterisk-style" functions, while
> > leaving the core routing functions to Opensips.
> >
> >
> > - Jeff
> >
> >
> > On Oct 24, 2010, at 1:16 AM, Mark Sayer wrote:
> >
> >> Those "virtual PBX" functions, like your present voicemail, cannot be
> >> provided by OpenSIPS. They are Asterisk-style functions.
> >>
> >> Mark
> >>
> >> On Sun, Oct 24, 2010 at 2:04 PM, Mike O'Connor  >> > wrote:
> >>
> >> Hi Guys
> >>
> >> I've been using OpenSIPS now for about 9 month (after upgrading from
> >> OpenSER 1.2 used that for about 2 years) for my core SIP routing and
> >> billing.
> >>
> >> I'm now getting questions from customers about Virtual PBX
> >> functionality
> >> and I would like the opinion of the group about how well this could
> be
> >> done using OpenSIPS, Mediaproxy and maybe SEMS.
> >>
> >> My current core system has voicemail, call forwarding and T38 fax
> >> using
> >> sip forwards to asterisk, but as normal with Asterisk I do get
> >> occasional calls issues, mostly related to codec negotiation.
> >>
> >> I want to be able to have all the normal PBX functions like Auto
> >> attendant, Call forwarding on busy or absence, Call Park, Call
> pickup,
> >> Call transfer, Call waiting, Conference Call, Custom Greeting, Voice
> >> Mall, Public Addressing, DND, Direct Inward Dial, Busy Lamp. ETC
> >>
> >> So your comments requested.
> >>
> >> Thanks
> >> Mike
> >>
> >>
> >>
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org 
> >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >>
> >>
> >> ___
> >> Users mailing list
> >> Users@lists.opensips.org 
>  >> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> >
> >
> >
> > ___
> > Users mailing list
> > Users@lists.opensips.org
> > http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>



-- 
--
*--*--*--*--*--*
Duane
*--*--*--*--*--*
--
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] load_balance debugging

2010-10-25 Thread Razvan Crainea
Hi,

I have just committed a patch that allows load_balance to receive a 
pseudo-variable resource argument. Please update from trunk and try this 
out.

Regards,
Razvan

On 10/25/2010 01:47 PM, Bogdan-Andrei Iancu wrote:
> See
> http://sourceforge.net/tracker/?func=detail&aid=2999345&group_id=232389&atid=1086413
>
> Regards,
> Bogdan
>
>
> Alexandr A. Alexandrov wrote:
>> Hi Bogdan!
>>
>> That sounds really great!
>> Does that request have any link/traking number so I could check its
>> state from time to time? :-)
>> I would use it immediately when it is available.
>> Too bad I'm not a C programmer and can't help here...
>>
>> Regards,
>> Alexandr A. Alexandrov
>>
>>
>> 25.10.2010 14:24, Bogdan-Andrei Iancu:
>>
>>> Hi Alexandr,
>>>
>>> We have a feature request for adding variable support there - it will be
>>> added in the next weeks.
>>>
>>> Regards,
>>> Bogdan
>>>
>>> Саша Александров wrote:
>>>
>>>
 Hi Anca,

 That sounds bad... :-(
 Is there any other way to achieve what I'm trying to do?
 Basically, as long as normal load balancing goes, I also need to
 select specific destinations for certain numbers.
 Moreover, the list is quite big. Moreover, the list is changing.
 Moreover, destinations for certain numbers are changing also. :-)
 Right now I have an ugly long if-elseif sheet... And the worst thing
 is that I have to restart opensips to chenge something. :-(

 Regards,
 Alexandr

 2010/10/22 Anca Vamanumailto:a...@opensips.org>>

   Hi Alexandr,

   The second parameter of load_balance() function can not be a
   pseudovariable, but only string.

   Regards,

   --
   Anca Vamanu
   www.voice-system.ro




   On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:
   >   Hi!
   >
   >   I have a strange problem with trying to use avps in load_balance
   function.
   >
   >   I'm trying to do balancing like this:
   >
   >   avp_db_query("select phone, resource from phone_resource where
   >   phone like '%$fU%'", "$avp(i:111);$avp(i:112)");
   >   avp_print();
   >   xlog("L_INFO","$fu = $avp(i:111)");
   >   if ($fu=~$avp(i:111)) {
   >   xlog("L_INFO", "AAA detected!\n");
   >   load_balance("1", "$avp(i:112)");
   >
   >   Here is what I get in logs:
   >
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   INFO:avpops:ops_print_avp: #011#011#011id=<112>
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   INFO:avpops:ops_print_avp: #011#011#011val_str=
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   INFO:avpops:ops_print_avp: #011#011#011id=<111>
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 / 10>
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   sip:1234565...@xx.xxx.xxx.xxx;user=phone = 1234565677
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA 
 detected!
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   ERROR:load_balancer:do_load_balance: unknown resource in input
   string
   >   Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
   >   DBG:core:comp_scriptvar: int 26 : -1 / 0
   >
   >   If I write the resource directly, like
   >   load_balance("1", "aaa");
   >   everything works fine.
   >   In the above log you can see that $avp(i:112) contains exactly
   the same
   >   resource string.
   >   What is the correct way to do this, or is there a way to debug
   how load
   >   balancer searches for resources defined in database?
   >
   >   Thanks in advance,
   >   Alexandr A. Alexandrov
   >

   ___
   Users mailing list
   Users@lists.opensips.org
   http://lists.opensips.org/cgi-bin/mailman/listinfo/users




 -- 
 С уважением, ААА.
 

 ___
 Users mailing list
 Users@lists.opensips.org
 http://lists.opensips.org/cgi-bin/mailman/listinfo/users



>>>
>>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>

-- 
Razvan 

[OpenSIPS-Users] MediaProxy Call setup

2010-10-25 Thread Deon Vermeulen

Hi

I've been anticipating to setup Mediaproxy for more then a week now 
without any success.
I've used the following resources as guidelines, but still can't figure 
out what I'm doing wrong or missing:

http://www.opensips.org/html/docs/modules/devel/mediaproxy.html
http://www.opensips.org/html/docs/modules/devel/nathelper.html
http://www.opensips.org/html/docs/modules/devel/usrloc.html
http://www.opensips.org/html/docs/modules/devel/mi_datagram.html
http://www.opensips.org/html/docs/modules/devel/dialog.html
http://voiprookie.blogspot.com/2009/04/blog-post.html
mailing-list: [OpenSIPS-Users] Mediaproxy broken

I use Counterpath softphone clients for my testing.
One on my MacBookPro and other within Windows XP VirtualBox Machine on 
same Mac.

I have the Mac Firewall turned off.

I can setup call from Windows Client to Mac Client, but when I answer 
call on Mac the call gets dropped immediately, but Windows client still 
says calling until it times out and 408 give error.


I can't setup call from Mac client to Windows Client. It tries calling 
but after a while the client returns with "Can't Connect" without 
ringing on Windows Client.


I've played around with the client Topology configurations on the and 
the only setting that gives some light is "use local IP", and this only 
on Mac Client.
The only result I get is Mac Client rings when I call from Windows 
Client, but then drops call immediately when answer.


What I am looking to achieve is as follows:
1. Media Proxy only be used when Devices are behind NAT.
2. Not use MediaProxy for media when devices are behind the same 
Firewall. i.e. 192.168@brancha calls 192.168.3...@branchb
3. I am very interested in the ICE feature and would really like to get 
that working. I guess this will resolve requirement 2?


Here is my configurations to show what I currently have:

opensips.cfg

loadmodule "dialog.so"
loadmodule "mediaproxy.so"
loadmodule "nathelper.so"
loadmodule "mi_datagram.so"


# - usrloc params -
#modparam("usrloc", "db_mode",   0)
/* uncomment the following lines if you want to enable DB persistency
   for location entries */
modparam("usrloc", "db_mode",   2)
modparam("usrloc", "db_url", 
"mysql://opensips:opensip...@localhost/opensips")

modparam("usrloc", "nat_bflag", 3)

# - dialog params - #
modparam("dialog", "dlg_flag", 13)
modparam("dialog", "db_mode", 3)


# - nethelper - #
modparam("nathelper", "natping_interval", 10)
modparam("nathelper", "ping_nated_only", 1)


# - mediaproxy params  #
modparam("mediaproxy", "mediaproxy_socket", 
"/var/run/mediaproxy-dispatcher.sock")

modparam("mediaproxy", "mediaproxy_timeout", 500)
modparam("mediaproxy", "signaling_ip_avp", "$avp(s:nat_ip)")
modparam("mediaproxy", "media_relay_avp", "$avp(s:media_relay)")
modparam("mediaproxy", "ice_candidate", "low-priority")
modparam("mediaproxy", "ice_candidate_avp", "$avp(s:ice_candidate)")


# - mi_datagram params - #
modparam("mi_datagram", "socket_name", "/var/run/opensips/opensips.sock")
modparam("mi_datagram", "children_count", 4)


### Routing Logic 


# main request routing logic

route{

if (!mf_process_maxfwd_header("10")) {
sl_send_reply("483","Too Many Hops");
exit;
}

if (method==INVITE && !has_totag()) {
# We can also use a specific media relay if we need to
#$avp(s:media_relay) = "1.2.3.4";
use_media_proxy();
fix_nated_sdp("8","ip_of_this_server"); # topology hide the 
sdp o header.

}


if (has_totag()) {
# sequential request withing a dialog should
# take the path determined by record-routing
if (loose_route()) {
if (is_method("BYE")) {
setflag(1); # do accounting ...
setflag(3); # ... even if the 
transaction fails

} else if (is_method("INVITE")) {
# even if in most of the cases is 
useless, do RR for
# re-INVITEs alos, as some buggy 
clients do change route set

# during the dialog.
record_route();
}
# route it out to whatever destination was set 
by loose_route()

# in $du (destination URI).
route(1);
} else {
/* uncomment the following lines if you want to 
enable presence */

##if (is_method("SUBSCRIBE") && $rd == "localhost)
##  # in-dialog subscribe requests
##  route(2);
##  exit;
##}
if ( is_method("ACK") ) {
if ( t_check_trans() ) {

Re: [OpenSIPS-Users] How much of the normal PBX Functions can be implemented using OpenSIPS, Mediaproxy and maybe SEMS

2010-10-25 Thread Fernando Gregianin Testa
As a FreeSWITCH user for about 1yr for conferencing systems, I can
assure it works very well as a virtualized PBX on KVM, Xen or OpenVZ
virtualization platforms.

Fernando Gregianin Testa
Voice Technology Ltda
ddr +55 11 21752166
cel +55 11 88225531

On 24-10-2010 16:25, Jeff Pyle wrote:
> Mike,
> 
> We've been asking much the same questions.  We have decided to take a
> serious look at Freeswitch for the "Asterisk-style" functions, while
> leaving the core routing functions to Opensips.
> 
> 
> - Jeff
> 
> 
> On Oct 24, 2010, at 1:16 AM, Mark Sayer wrote:
> 
>> Those "virtual PBX" functions, like your present voicemail, cannot be
>> provided by OpenSIPS. They are Asterisk-style functions.
>>
>> Mark
>>
>> On Sun, Oct 24, 2010 at 2:04 PM, Mike O'Connor > > wrote:
>>
>> Hi Guys
>>
>> I've been using OpenSIPS now for about 9 month (after upgrading from
>> OpenSER 1.2 used that for about 2 years) for my core SIP routing and
>> billing.
>>
>> I'm now getting questions from customers about Virtual PBX
>> functionality
>> and I would like the opinion of the group about how well this could be
>> done using OpenSIPS, Mediaproxy and maybe SEMS.
>>
>> My current core system has voicemail, call forwarding and T38 fax
>> using
>> sip forwards to asterisk, but as normal with Asterisk I do get
>> occasional calls issues, mostly related to codec negotiation.
>>
>> I want to be able to have all the normal PBX functions like Auto
>> attendant, Call forwarding on busy or absence, Call Park, Call pickup,
>> Call transfer, Call waiting, Conference Call, Custom Greeting, Voice
>> Mall, Public Addressing, DND, Direct Inward Dial, Busy Lamp. ETC
>>
>> So your comments requested.
>>
>> Thanks
>> Mike
>>
>>
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org 
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org 
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
> 
> 
> 
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users

___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] opensips tm timer core dump

2010-10-25 Thread Bogdan-Andrei Iancu
Done!

This bug is affecting trunk only.

Regards,
Bogdan

Bogdan-Andrei Iancu wrote:
> Hi Kennard,
>
> You are perfectly right - there was a change  in moving the setT(cell) 
> upper in the function (we needed it in the callbacks), and this bug 
> looks like a side effect.
>
> I will make the fix asap !
>
> Thanks and regards,
> Bogdan
>
> kennard_wh...@logitech.com wrote:
>   
>> Hi Bogdan,
>>
>> I believe I found the problem. When sip_msg_cloner() within 
>> build_cell() fails due to out-of-mem, and dangling pointer to the cell 
>> is left in the global transaction pointer. Later on the post_cb() code 
>> attempts to clean this up, and "resurrects" the now-free memory, and 
>> in particular puts it on a wait timer. My guess is that later on this 
>> memory is allocated into a new transaction which eventually uses the 
>> same wait timer link, and the two threads fight it out.
>>
>> Adding a set_t(0) fixes the problem. While looking, I believe I found 
>> a memory leak in uac creation code that is also triggered by out of 
>> memory conditions. Please see attached patch.
>>
>> The "problem" also manifest itself as a core dump with 
>> insert_timer_unsafe. Once I disabled optimization, I saw multiple 
>> variations within this function. The most common was that ptr==tl 
>> after the search. The sequence of events for this is: new cell 
>> created, stored into global T, free'd, added to wait-list by cleanup 
>> code from global T, memory re-allocated into new cell, timer link 
>> zero'd, and then added again to wait list. At least that is my best guess.
>>
>> Regards,
>> Kennard
>>
>> /(See attached file: opensips-tm-cell.patch)/
>>
>> Inactive hide details for Bogdan-Andrei Iancu ---10/22/2010 07:02:36 
>> AM---Hi Kennard, I suppose the bt is the same ? do you 
>> stiBogdan-Andrei Iancu ---10/22/2010 07:02:36 AM---Hi Kennard, I 
>> suppose the bt is the same ? do you still have the core file ?
>>
>> From: Bogdan-Andrei Iancu 
>> To: OpenSIPS users mailling list 
>> Date: 10/22/2010 07:02 AM
>> Subject: Re: [OpenSIPS-Users] opensips tm timer core dump
>> Sent by: users-boun...@lists.opensips.org
>>
>> 
>>
>>
>>
>> Hi Kennard,
>>
>> I suppose the bt is the same ? do you still have the core file ?
>>
>> Regards,
>> Bogdan
>>
>> kennard_wh...@logitech.com wrote:
>> 
>>> Hi Bodgen,
>>>
>>> I replicated the error. Unfortunately the entire insert_timer_unsafe
>>> and been in-lined and little is available:
>>>
>>> Program terminated with signal 11, Segmentation fault.
>>> #0 0x7f8b8356c2c2 in insert_timer_unsafe (new_tl=0x7f8b7a54e310,
>>> list_id=WT_TIMER_LIST, ext_timeout=) at timer.c:731
>>> 731 timer.c: No such file or directory.
>>> in timer.c
>>> (gdb) print tl
>>> $1 = 
>>> (gdb) print *tl
>>> Cannot access memory at address 0x0
>>> (gdb) print ptr
>>> $2 = 
>>> (gdb) print *ptr
>>> Cannot access memory at address 0x0
>>> (gdb) print *new_tl
>>> No symbol "new_tl" in current context.
>>> (gdb) up
>>> #1 set_1timer (new_tl=0x7f8b7a54e310, list_id=WT_TIMER_LIST,
>>> ext_timeout=) at timer.c:904
>>> 904 in timer.c
>>> (gdb) print *new_tl
>>> $3 = {next_tl = 0x0, prev_tl = 0x0, ld_tl = 0x0, time_out = 0,
>>> timer_list = 0x0, deleted = 0}
>>> (gdb) print list
>>> $4 = 
>>> (gdb) print timeout
>>> $5 = 32
>>> (gdb) print new_tl
>>> $6 = (struct timer_link *) 0x7f8b7a54e310
>>>
>>> I'll keep the core for a while -- please let me know if there is
>>> anything else I can try.
>>>
>>> Thanks,
>>> Kennard
>>>
>>> Inactive hide details for Bogdan-Andrei Iancu ---10/08/2010 04:40:47
>>> AM---Hi Kennard, Ok, keep the core next time :)Bogdan-Andrei Iancu
>>> ---10/08/2010 04:40:47 AM---Hi Kennard, Ok, keep the core next time :)
>>>
>>> From: Bogdan-Andrei Iancu 
>>> To: OpenSIPS users mailling list 
>>> Date: 10/08/2010 04:40 AM
>>> Subject: Re: [OpenSIPS-Users] opensips tm timer core dump
>>> Sent by: users-boun...@lists.opensips.org
>>>
>>> 
>>>
>>>
>>>
>>> Hi Kennard,
>>>
>>> Ok, keep the core next time :)
>>>
>>> Regards,
>>> Bogdan
>>>
>>> kennard_wh...@logitech.com wrote:
>>>   
 Hi Bogden,

 Thanks for explaining the child processes involved -- I misunderstood
 what was happening.

 Unfortunately, I don't have the core anymore. My recollection is that
 I couldn't print anything useful due to compiler optimization. That
 said, this should re-create pretty easily, and I'll get more dumps
 next time it happens.

 Regards,
 Kennard

 Inactive hide details for Bogdan-Andrei Iancu ---10/05/2010 01:41:38
 AM---Hi Kennard, The core was generated by process 22255:Bogdan-Andrei
 Iancu ---10/05/2010 01:41:38 AM---Hi Kennard, The core was generated
 by process 22255:

 From: Bogdan-Andrei Iancu 
 To: OpenSIPS users mailling list 
 Date: 10/05/2010 01:41 AM
 Subject: Re: [OpenSIPS-Users

Re: [OpenSIPS-Users] Problem creating tables for OpenSIPS with PostgreSQL

2010-10-25 Thread David Santiago
The user I'm the running the script with?  well, I'm executing the script
with my personal user on the server where opensips is installed, while the
database is on a different one...

I have modified the opensipsctlrc to specify different users (rw and ro),
and passwords than those provided by default, but the point is that I do not
have the password of the database server root user. It seems that the script
requires such kind of access to the database in order to create those rw and
ro users, ins't it?

On Mon, Oct 25, 2010 at 12:45 PM, Bogdan-Andrei Iancu <
bog...@voice-system.ro> wrote:

> Hi David,
>
> The error says that your current postgres user (you are running the
> opensips script with) has no permission / privilege  to create new access
> users (opensips and opensipsrw) for postgres.
>
> Regards,
> Bogdan
>
> David Santiago wrote:
>
>> The call to opensipsdbctl create is asking me for the password on
>> every single table created. But the real problem is that after several
>> tables have been created the following error happens:
>>
>> ...
>> ...
>> -e Creating core table: drouting
>> Password for user almira:
>> NOTICE:  CREATE TABLE will create implicit sequence
>> "dr_gateways_gwid_seq" for serial column "dr_gateways.gwid"
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>> "dr_gateways_pkey" for table "dr_gateways"
>> NOTICE:  CREATE TABLE will create implicit sequence
>> "dr_rules_ruleid_seq" for serial column "dr_rules.ruleid"
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>> "dr_rules_pkey" for table "dr_rules"
>> NOTICE:  CREATE TABLE will create implicit sequence
>> "dr_gw_lists_id_seq" for serial column "dr_gw_lists.id"
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>> "dr_gw_lists_pkey" for table "dr_gw_lists"
>> NOTICE:  CREATE TABLE will create implicit sequence "dr_groups_id_seq"
>> for serial column "dr_groups.id"
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>> "dr_groups_pkey" for table "dr_groups"
>> -e Creating core table: load_balancer
>> Password for user almira:
>> NOTICE:  CREATE TABLE will create implicit sequence
>> "load_balancer_id_seq" for serial column "load_balancer.id"
>> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
>> "load_balancer_pkey" for table "load_balancer"
>> Password for user almira:
>> ERROR:  permission denied to create role
>> -e \E[37;32mWARNING: Create user in database failed, perhaps they
>> already exist? Try to continue..
>> Password for user almira:
>> Password for user almira:
>> Password for user almira:
>> Password for user almira:
>> [: 300: acc: unexpected operator
>> [: 300: acc: unexpected operator
>>
>> Any hint about where to have a look in order to fix this?
>>
>>
>> Regards,
>> David
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>
>
> --
> Bogdan-Andrei Iancu
> OpenSIPS Bootcamp
> 15 - 19 November 2010, Edison, New Jersey, USA
> www.voice-system.ro
>
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] opensips tm timer core dump

2010-10-25 Thread Bogdan-Andrei Iancu
Hi Kennard,

You are perfectly right - there was a change  in moving the setT(cell) 
upper in the function (we needed it in the callbacks), and this bug 
looks like a side effect.

I will make the fix asap !

Thanks and regards,
Bogdan

kennard_wh...@logitech.com wrote:
>
> Hi Bogdan,
>
> I believe I found the problem. When sip_msg_cloner() within 
> build_cell() fails due to out-of-mem, and dangling pointer to the cell 
> is left in the global transaction pointer. Later on the post_cb() code 
> attempts to clean this up, and "resurrects" the now-free memory, and 
> in particular puts it on a wait timer. My guess is that later on this 
> memory is allocated into a new transaction which eventually uses the 
> same wait timer link, and the two threads fight it out.
>
> Adding a set_t(0) fixes the problem. While looking, I believe I found 
> a memory leak in uac creation code that is also triggered by out of 
> memory conditions. Please see attached patch.
>
> The "problem" also manifest itself as a core dump with 
> insert_timer_unsafe. Once I disabled optimization, I saw multiple 
> variations within this function. The most common was that ptr==tl 
> after the search. The sequence of events for this is: new cell 
> created, stored into global T, free'd, added to wait-list by cleanup 
> code from global T, memory re-allocated into new cell, timer link 
> zero'd, and then added again to wait list. At least that is my best guess.
>
> Regards,
> Kennard
>
> /(See attached file: opensips-tm-cell.patch)/
>
> Inactive hide details for Bogdan-Andrei Iancu ---10/22/2010 07:02:36 
> AM---Hi Kennard, I suppose the bt is the same ? do you 
> stiBogdan-Andrei Iancu ---10/22/2010 07:02:36 AM---Hi Kennard, I 
> suppose the bt is the same ? do you still have the core file ?
>
> From: Bogdan-Andrei Iancu 
> To: OpenSIPS users mailling list 
> Date: 10/22/2010 07:02 AM
> Subject: Re: [OpenSIPS-Users] opensips tm timer core dump
> Sent by: users-boun...@lists.opensips.org
>
> 
>
>
>
> Hi Kennard,
>
> I suppose the bt is the same ? do you still have the core file ?
>
> Regards,
> Bogdan
>
> kennard_wh...@logitech.com wrote:
> >
> > Hi Bodgen,
> >
> > I replicated the error. Unfortunately the entire insert_timer_unsafe
> > and been in-lined and little is available:
> >
> > Program terminated with signal 11, Segmentation fault.
> > #0 0x7f8b8356c2c2 in insert_timer_unsafe (new_tl=0x7f8b7a54e310,
> > list_id=WT_TIMER_LIST, ext_timeout=) at timer.c:731
> > 731 timer.c: No such file or directory.
> > in timer.c
> > (gdb) print tl
> > $1 = 
> > (gdb) print *tl
> > Cannot access memory at address 0x0
> > (gdb) print ptr
> > $2 = 
> > (gdb) print *ptr
> > Cannot access memory at address 0x0
> > (gdb) print *new_tl
> > No symbol "new_tl" in current context.
> > (gdb) up
> > #1 set_1timer (new_tl=0x7f8b7a54e310, list_id=WT_TIMER_LIST,
> > ext_timeout=) at timer.c:904
> > 904 in timer.c
> > (gdb) print *new_tl
> > $3 = {next_tl = 0x0, prev_tl = 0x0, ld_tl = 0x0, time_out = 0,
> > timer_list = 0x0, deleted = 0}
> > (gdb) print list
> > $4 = 
> > (gdb) print timeout
> > $5 = 32
> > (gdb) print new_tl
> > $6 = (struct timer_link *) 0x7f8b7a54e310
> >
> > I'll keep the core for a while -- please let me know if there is
> > anything else I can try.
> >
> > Thanks,
> > Kennard
> >
> > Inactive hide details for Bogdan-Andrei Iancu ---10/08/2010 04:40:47
> > AM---Hi Kennard, Ok, keep the core next time :)Bogdan-Andrei Iancu
> > ---10/08/2010 04:40:47 AM---Hi Kennard, Ok, keep the core next time :)
> >
> > From: Bogdan-Andrei Iancu 
> > To: OpenSIPS users mailling list 
> > Date: 10/08/2010 04:40 AM
> > Subject: Re: [OpenSIPS-Users] opensips tm timer core dump
> > Sent by: users-boun...@lists.opensips.org
> >
> > 
> >
> >
> >
> > Hi Kennard,
> >
> > Ok, keep the core next time :)
> >
> > Regards,
> > Bogdan
> >
> > kennard_wh...@logitech.com wrote:
> > >
> > > Hi Bogden,
> > >
> > > Thanks for explaining the child processes involved -- I misunderstood
> > > what was happening.
> > >
> > > Unfortunately, I don't have the core anymore. My recollection is that
> > > I couldn't print anything useful due to compiler optimization. That
> > > said, this should re-create pretty easily, and I'll get more dumps
> > > next time it happens.
> > >
> > > Regards,
> > > Kennard
> > >
> > > Inactive hide details for Bogdan-Andrei Iancu ---10/05/2010 01:41:38
> > > AM---Hi Kennard, The core was generated by process 22255:Bogdan-Andrei
> > > Iancu ---10/05/2010 01:41:38 AM---Hi Kennard, The core was generated
> > > by process 22255:
> > >
> > > From: Bogdan-Andrei Iancu 
> > > To: OpenSIPS users mailling list 
> > > Date: 10/05/2010 01:41 AM
> > > Subject: Re: [OpenSIPS-Users] opensips tm timer core dump
> > > Sent by: users-boun...@lists.opensips.org
> > >
> > > 
> -

Re: [OpenSIPS-Users] fr_timer fr_inv_timer

2010-10-25 Thread Bogdan-Andrei Iancu
Hi Jesse,

as fr_inv_timer is started only after the receive of the first reply, 
you can run such a check to see if fr_timer or fr_inv_timer triggered 
the timeout:

failure_route[xx]
{
if (t_check_status("408") {
  if ( t_local_replied("all") ) {
# local timeout with no reply received -> fr_timer
  } else if ( t_local_replied("last") ) {
# timeout with replies received -> fr_inv_timer
  } else {
# received timeout
  }
}
}

Regards,
Bogdan

Jesse Cloutier wrote:
> Hi all,
>
> I setup opensips with the tm module for call forward on timeout. It 
> works great but I would like to perform different actions depending on 
> if it is the "fr_timer" or the "fr_inv_timer", and I can find no way 
> of telling from the script which timer was hit.
>
> How could I gain access to this information?
>
> I am running 1.6.2
>
> Thanks!!!
> Jesse
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] load_balance debugging

2010-10-25 Thread Bogdan-Andrei Iancu
See
http://sourceforge.net/tracker/?func=detail&aid=2999345&group_id=232389&atid=1086413

Regards,
Bogdan


Alexandr A. Alexandrov wrote:
> Hi Bogdan!
>
> That sounds really great!
> Does that request have any link/traking number so I could check its 
> state from time to time? :-)
> I would use it immediately when it is available.
> Too bad I'm not a C programmer and can't help here...
>
> Regards,
> Alexandr A. Alexandrov
>
>
> 25.10.2010 14:24, Bogdan-Andrei Iancu:
>   
>> Hi Alexandr,
>>
>> We have a feature request for adding variable support there - it will be
>> added in the next weeks.
>>
>> Regards,
>> Bogdan
>>
>> Саша Александров wrote:
>>
>> 
>>> Hi Anca,
>>>
>>> That sounds bad... :-(
>>> Is there any other way to achieve what I'm trying to do?
>>> Basically, as long as normal load balancing goes, I also need to
>>> select specific destinations for certain numbers.
>>> Moreover, the list is quite big. Moreover, the list is changing.
>>> Moreover, destinations for certain numbers are changing also. :-)
>>> Right now I have an ugly long if-elseif sheet... And the worst thing
>>> is that I have to restart opensips to chenge something. :-(
>>>
>>> Regards,
>>> Alexandr
>>>
>>> 2010/10/22 Anca Vamanumailto:a...@opensips.org>>
>>>
>>>  Hi Alexandr,
>>>
>>>  The second parameter of load_balance() function can not be a
>>>  pseudovariable, but only string.
>>>
>>>  Regards,
>>>
>>>  --
>>>  Anca Vamanu
>>>  www.voice-system.ro
>>>
>>>
>>>
>>>
>>>  On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:
>>>  >  Hi!
>>>  >
>>>  >  I have a strange problem with trying to use avps in load_balance
>>>  function.
>>>  >
>>>  >  I'm trying to do balancing like this:
>>>  >
>>>  >  avp_db_query("select phone, resource from phone_resource where
>>>  >  phone like '%$fU%'", "$avp(i:111);$avp(i:112)");
>>>  >  avp_print();
>>>  >  xlog("L_INFO","$fu = $avp(i:111)");
>>>  >  if ($fu=~$avp(i:111)) {
>>>  >  xlog("L_INFO", "AAA detected!\n");
>>>  >  load_balance("1", "$avp(i:112)");
>>>  >
>>>  >  Here is what I get in logs:
>>>  >
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  INFO:avpops:ops_print_avp: #011#011#011id=<112>
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  INFO:avpops:ops_print_avp: #011#011#011val_str=
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  INFO:avpops:ops_print_avp: #011#011#011id=<111>
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 / 10>
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  sip:1234565...@xx.xxx.xxx.xxx;user=phone = 1234565677
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA detected!
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  ERROR:load_balancer:do_load_balance: unknown resource in input
>>>  string
>>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>>  >  DBG:core:comp_scriptvar: int 26 : -1 / 0
>>>  >
>>>  >  If I write the resource directly, like
>>>  >  load_balance("1", "aaa");
>>>  >  everything works fine.
>>>  >  In the above log you can see that $avp(i:112) contains exactly
>>>  the same
>>>  >  resource string.
>>>  >  What is the correct way to do this, or is there a way to debug
>>>  how load
>>>  >  balancer searches for resources defined in database?
>>>  >
>>>  >  Thanks in advance,
>>>  >  Alexandr A. Alexandrov
>>>  >
>>>
>>>  ___
>>>  Users mailing list
>>>  Users@lists.opensips.org
>>>  http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>
>>>
>>>
>>> -- 
>>> С уважением, ААА.
>>> 
>>>
>>> ___
>>> Users mailing list
>>> Users@lists.opensips.org
>>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>>
>>>  
>>>   
>>
>> 
>
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Problem creating tables for OpenSIPS with PostgreSQL

2010-10-25 Thread Bogdan-Andrei Iancu
Hi David,

The error says that your current postgres user (you are running the 
opensips script with) has no permission / privilege  to create new 
access users (opensips and opensipsrw) for postgres.

Regards,
Bogdan

David Santiago wrote:
> The call to opensipsdbctl create is asking me for the password on
> every single table created. But the real problem is that after several
> tables have been created the following error happens:
>
> ...
> ...
> -e Creating core table: drouting
> Password for user almira:
> NOTICE:  CREATE TABLE will create implicit sequence
> "dr_gateways_gwid_seq" for serial column "dr_gateways.gwid"
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "dr_gateways_pkey" for table "dr_gateways"
> NOTICE:  CREATE TABLE will create implicit sequence
> "dr_rules_ruleid_seq" for serial column "dr_rules.ruleid"
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "dr_rules_pkey" for table "dr_rules"
> NOTICE:  CREATE TABLE will create implicit sequence
> "dr_gw_lists_id_seq" for serial column "dr_gw_lists.id"
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "dr_gw_lists_pkey" for table "dr_gw_lists"
> NOTICE:  CREATE TABLE will create implicit sequence "dr_groups_id_seq"
> for serial column "dr_groups.id"
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "dr_groups_pkey" for table "dr_groups"
> -e Creating core table: load_balancer
> Password for user almira:
> NOTICE:  CREATE TABLE will create implicit sequence
> "load_balancer_id_seq" for serial column "load_balancer.id"
> NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index
> "load_balancer_pkey" for table "load_balancer"
> Password for user almira:
> ERROR:  permission denied to create role
> -e \E[37;32mWARNING: Create user in database failed, perhaps they
> already exist? Try to continue..
> Password for user almira:
> Password for user almira:
> Password for user almira:
> Password for user almira:
> [: 300: acc: unexpected operator
> [: 300: acc: unexpected operator
>
> Any hint about where to have a look in order to fix this?
>
>
> Regards,
> David
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] load_balance debugging

2010-10-25 Thread Alexandr A. Alexandrov
Hi Bogdan!

That sounds really great!
Does that request have any link/traking number so I could check its 
state from time to time? :-)
I would use it immediately when it is available.
Too bad I'm not a C programmer and can't help here...

Regards,
Alexandr A. Alexandrov


25.10.2010 14:24, Bogdan-Andrei Iancu:
> Hi Alexandr,
>
> We have a feature request for adding variable support there - it will be
> added in the next weeks.
>
> Regards,
> Bogdan
>
> Саша Александров wrote:
>
>> Hi Anca,
>>
>> That sounds bad... :-(
>> Is there any other way to achieve what I'm trying to do?
>> Basically, as long as normal load balancing goes, I also need to
>> select specific destinations for certain numbers.
>> Moreover, the list is quite big. Moreover, the list is changing.
>> Moreover, destinations for certain numbers are changing also. :-)
>> Right now I have an ugly long if-elseif sheet... And the worst thing
>> is that I have to restart opensips to chenge something. :-(
>>
>> Regards,
>> Alexandr
>>
>> 2010/10/22 Anca Vamanumailto:a...@opensips.org>>
>>
>>  Hi Alexandr,
>>
>>  The second parameter of load_balance() function can not be a
>>  pseudovariable, but only string.
>>
>>  Regards,
>>
>>  --
>>  Anca Vamanu
>>  www.voice-system.ro
>>
>>
>>
>>
>>  On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:
>>  >  Hi!
>>  >
>>  >  I have a strange problem with trying to use avps in load_balance
>>  function.
>>  >
>>  >  I'm trying to do balancing like this:
>>  >
>>  >  avp_db_query("select phone, resource from phone_resource where
>>  >  phone like '%$fU%'", "$avp(i:111);$avp(i:112)");
>>  >  avp_print();
>>  >  xlog("L_INFO","$fu = $avp(i:111)");
>>  >  if ($fu=~$avp(i:111)) {
>>  >  xlog("L_INFO", "AAA detected!\n");
>>  >  load_balance("1", "$avp(i:112)");
>>  >
>>  >  Here is what I get in logs:
>>  >
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  INFO:avpops:ops_print_avp: #011#011#011id=<112>
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  INFO:avpops:ops_print_avp: #011#011#011val_str=
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  INFO:avpops:ops_print_avp: #011#011#011id=<111>
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 / 10>
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  sip:1234565...@xx.xxx.xxx.xxx;user=phone = 1234565677
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA detected!
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  ERROR:load_balancer:do_load_balance: unknown resource in input
>>  string
>>  >  Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
>>  >  DBG:core:comp_scriptvar: int 26 : -1 / 0
>>  >
>>  >  If I write the resource directly, like
>>  >  load_balance("1", "aaa");
>>  >  everything works fine.
>>  >  In the above log you can see that $avp(i:112) contains exactly
>>  the same
>>  >  resource string.
>>  >  What is the correct way to do this, or is there a way to debug
>>  how load
>>  >  balancer searches for resources defined in database?
>>  >
>>  >  Thanks in advance,
>>  >  Alexandr A. Alexandrov
>>  >
>>
>>  ___
>>  Users mailing list
>>  Users@lists.opensips.org
>>  http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>
>>
>>
>> -- 
>> С уважением, ААА.
>> 
>>
>> ___
>> Users mailing list
>> Users@lists.opensips.org
>> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>>
>>  
>
>


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] load_balance debugging

2010-10-25 Thread Bogdan-Andrei Iancu
Hi Alexandr,

We have a feature request for adding variable support there - it will be 
added in the next weeks.

Regards,
Bogdan

Саша Александров wrote:
> Hi Anca,
>
> That sounds bad... :-(
> Is there any other way to achieve what I'm trying to do?
> Basically, as long as normal load balancing goes, I also need to 
> select specific destinations for certain numbers.
> Moreover, the list is quite big. Moreover, the list is changing. 
> Moreover, destinations for certain numbers are changing also. :-)
> Right now I have an ugly long if-elseif sheet... And the worst thing 
> is that I have to restart opensips to chenge something. :-(
>
> Regards,
> Alexandr
>
> 2010/10/22 Anca Vamanu mailto:a...@opensips.org>>
>
> Hi Alexandr,
>
> The second parameter of load_balance() function can not be a
> pseudovariable, but only string.
>
> Regards,
>
> --
> Anca Vamanu
> www.voice-system.ro 
>
>
>
>
> On 10/22/2010 03:53 PM, Alexandr A. Alexandrov wrote:
> > Hi!
> >
> > I have a strange problem with trying to use avps in load_balance
> function.
> >
> > I'm trying to do balancing like this:
> >
> > avp_db_query("select phone, resource from phone_resource where
> > phone like '%$fU%'", "$avp(i:111);$avp(i:112)");
> > avp_print();
> > xlog("L_INFO","$fu = $avp(i:111)");
> > if ($fu=~$avp(i:111)) {
> > xlog("L_INFO", "AAA detected!\n");
> > load_balance("1", "$avp(i:112)");
> >
> > Here is what I get in logs:
> >
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > INFO:avpops:ops_print_avp: #011#011#011id=<112>
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > INFO:avpops:ops_print_avp: #011#011#011val_str=
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > INFO:avpops:ops_print_avp: p=0x7f73f6b251e8, flags=0x0002
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > INFO:avpops:ops_print_avp: #011#011#011id=<111>
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > INFO:avpops:ops_print_avp: #011#011#011val_str=<1234565677 / 10>
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > sip:1234565...@xx.xxx.xxx.xxx;user=phone = 1234565677
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]: AAA detected!
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > ERROR:load_balancer:do_load_balance: unknown resource in input
> string
> > Oct 22 16:35:44 kzo2 /usr/local/sbin/opensips[8214]:
> > DBG:core:comp_scriptvar: int 26 : -1 / 0
> >
> > If I write the resource directly, like
> > load_balance("1", "aaa");
> > everything works fine.
> > In the above log you can see that $avp(i:112) contains exactly
> the same
> > resource string.
> > What is the correct way to do this, or is there a way to debug
> how load
> > balancer searches for resources defined in database?
> >
> > Thanks in advance,
> > Alexandr A. Alexandrov
> >
>
> ___
> Users mailing list
> Users@lists.opensips.org 
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>
>
>
> -- 
> С уважением, ААА.
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] openSips - Asterisk and Session Timers: ACK is sent to 192.168.1.10

2010-10-25 Thread Bogdan-Andrei Iancu
Hi,

haven't check your trace, but a fast guess is that you do not fix the 
contact of the 200 OK re-INVITE is no fixed and carries back to asterisk 
a private contact.

So, do fix_nated_contact() for the replies coming from behind a NAT too..

Regards,
Bogdan

wrote:
> Hi,
>
> My setup:
> - 11.22.33.44 : openSIPS 1.6.3
> - 11.22.33.45 : one of the Asterisk 1.6.2.13 servers
> - 88.77.66.55 : my public ip-address
> - 192.168.1.10 : my local ip-address (NAT)
>
> All is working well except Session Timers where the Re-Invite 
> originates from Asterisk.
>
> I have a SIP trace ( http://pastebin.com/raw.php?i=NRDdaktn ) of a 
> call initiated by a softphone on my pc (192.168.1.10).
> When Asterisk sends the Re-Invite (line 290) my softphone receives 
> this Re-Invite correctly.
> The 100 Trying and 200 OK are also handled as it should.
> But on line 455 you see openSIPS forwarding the ACK to 192.168.1.10 
> instead of 88.77.66.55.
>
> Does anyone know why this isn't working?
> Thanks in advance!
>
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Two questions

2010-10-25 Thread Bogdan-Andrei Iancu
Hello Jayesh,

Jayesh Nambiar wrote:
> Hello All,
> I got only two questions:
> 1) Is there a way to remove multiple headers by matching a pattern in 
> an incoming INVITE message?
>  For eg: remove_hf("X-*") #---This removes any header starting X-. 
> Is there a way to achieve this?
unfortunately the header manipulation functions do not use regexps as 
parameters.  So, solutions, both requiring some devel are:
1) add support for regexp in remove_hf
2) add a new type of var to get the hdr name by index - like return 
the name of the second, third, etc header -> you can can cycle and 
remove the ones you want.
> 2) Why does AVP does not support storing float values in it? I had a 
> requirement where I need to fetch values from DB which is of datatype 
> decimal and do some comparisons. I could have fetched it using the 
> cast function and converting it to char in the mysql but I need to use 
> the value to do some comparison in the script.
> Is there a reason why AVPs does not support it?
AVPs were historically built for strings and integers as float numbers 
are not so used in SIP and opensips..

A small trick you can do is to convert the float to integer when 
loadinglike "select my_float_column*1000 from table where ."  
Just an idea

Regards,
Bogdan
>
> Your inputs are highly appreciated.
> Thanks in advance,
>
> --- Jayesh
>
> 
>
> ___
> Users mailing list
> Users@lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>   


-- 
Bogdan-Andrei Iancu
OpenSIPS Bootcamp
15 - 19 November 2010, Edison, New Jersey, USA
www.voice-system.ro


___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users