Re: [OpenSIPS-Users] overwriting AVPs at certain index

2010-11-07 Thread Jayesh Nambiar
Thank you Bogdan, actually this does a proper job. What I was doing was
slightly different which I realized later, I was trying to initialize the
AVP like this directly in my script:
$avp(i:999) = 0;
$(avp(variable)[$avp(i:999]) = $avp(value);

This results an error in syslog saying:
ERROR:core:pv_set_avp: Failed to replace avp
ERROR:core:do_assign: setting PV failed

I guess initializing an AVP is important with some value before assigning a
value to certain index, something like this:
$avp(variable) = $avp(default_value);
$avp(i:999) = 0;
$(avp(variable)[$avp(i:999]) = $avp(value);

This works properly !!! So is it good to conclude that initializing an AVP
is important before trying to assign a value at any particular index.

--- Jayesh


> Hi Jayesh,
>
> Just tried the following script and it did the right job:
>
> 
>$avp(s:value1) = "abc";
>$avp(s:value2) = "ABC";
>
>$avp(s:variable) = $avp(s:value1);
>$avp(i:999) = 0;
>$(avp(s:variable)[$avp(i:999)]) = $avp(s:value2);
>
>avp_print();
> 
>
> and the result (from avp_print()) :
>
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp: p=0xb5ab5e48,
> flags=0x
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> id=<999>
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> val_int=<0>
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp: p=0xb5ab5e70,
> flags=0x0003
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> name=
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> val_str=
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp: p=0xb5ab5dc8,
> flags=0x0003
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> name=
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> val_str=
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp: p=0xb5ab5d88,
> flags=0x0003
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> name=
> Nov  4 11:32:49 [12046] INFO:avpops:ops_print_avp:
> val_str=
>
>
> Can you post the error/log you get?
>
> Regards,
> Bogdan
>
> Jayesh Nambiar wrote:
> > Hi All,
> > I am trying to overwrite certain values at specific index of AVP and
> > it doesn't work as expected. How I do it is:
> >
> > $avp(variable) = $avp(value1);
> > $avp(i:999) = 0;
> > $(avp(variable)[$avp(i:999)]) = $avp(value2);
> >
> > While executing this, opensips logs an error saying unable to replace
> > AVPs. Is the syntax wrong somewhere? I do this as I don't want to add
> > multiple values into single AVP and also I dont want to call
> > avp_delete function before assigning a new value to the AVP. Moreover
> > the value at $avp(i:999) can change and thus it is assigned to another
> > AVP.
> >
> > Any help related to AVP overwriting function would be very helpful.
> >
> > --- Jayesh
>
___
Users mailing list
Users@lists.opensips.org
http://lists.opensips.org/cgi-bin/mailman/listinfo/users


Re: [OpenSIPS-Users] Load balancer probe _mode=1 bug?

2010-11-07 Thread Bill W.
Hello Bogdan,

This is how I mark the destination down:

failure_route[1] {
if (t_check_status("(408)|(5[0-9][0-9])")) {
lb_disable();
if (load_balance("1","sip","1")) {
t_on_failure("1");
t_relay();
} else {
t_reply("503", "Service Unavailable");
}
}
}


opensipsctl fifo lb_list shows:  enabled=no auto-re=on

I do not see any probes from opensips when  probe_mode in the database
is set to "1" which should probe the destination when it's marked down.
 When probe_mode is set to "2", and opensips probes continuously,
it works fine.

The docs say: "(1) - probing only when the destination is in disabled
mode (disabling via MI command will competely stop the probing also).
The destination will be automatically re-enabled when the probing will
succeed next time;"

So when I disable via lb_disable(), it is acting like I did it from the
MI, and disabling the probing too.

Thoughts?

Thanks,
Bill

On 8/1/10 1:14 PM, Bogdan-Andrei Iancu wrote:
> Hi Bill,
> 
> How do you mark down the destination (MI ?) and what state are you setting ?
> 
> Also, after marking it down, do you see any new pings being sent to that 
> destination?
> 
> Something was changed during rev 6653:
> http://opensips.svn.sourceforge.net/opensips/?rev=6653&view=rev
> 
> But the new code seams ok for me - the LB_DST_STAT_NOEN_FLAG flag is set 
> when disabling the destination via MI and with this flag set, no more 
> pings are sent.
> 
> Regards,
> Bogdan
> 
> Bill W wrote:
>> Hello Bogdan,
>>
>> I'm experiencing the same problem as I did before, with the load 
>> balancer not re-enabling a device marked down.
>>
>> If I go into the database and set probe_mode = 2, it re-enables the device.
>>
>> I'm currently running opensips 1.6.2-tls (x86_64/linux)
>>
>> Did the patch get reverted?
>>
>> Thanks!
>> Bill
>>
>> Bogdan-Andrei Iancu wrote:
>>   
>>> Super! I uploaded the fix on SVN.
>>>
>>> Thanks and regards,
>>> Bogdan
>>>
>>> Bill W wrote:
>>> 
 Hey Bogdan,

 It looks like that fixed it.  Thanks so much!

 Bill


 Bogdan-Andrei Iancu wrote:
   
   
> Hi Bill,
>
> Could you please try the attached patch? It seams that there was an 
> issue with the the probing values in the code. Let me know if the patch 
> does solves your problem and I will upload it on SVN.
>
> Regards,
> Bogdan
>
> 
> 
 ___
 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 balancer probing from incorrect interface

2010-11-07 Thread Bill W.
As an update, the load balancer probe appears to use the ip address
specified by the first listen= directive.

If I list the public IP first, then the probe tries to talk to the
internal IP from the external interface IP.


On 11/7/10 6:18 PM, Bill W. wrote:
> Hello everyone,
> 
> I've got an opensips-1.6.3-tls installation using multiple interfaces
> and load balancing.
> 
> My internal interface  is rfc1918 space and my external interface has
> public IPs.
> listen=udp:10.0.10.3:5060
> listen=udp:66.180.205.3:5060
> 
> 
> I have the following load_balancer configuration:
>  id | group_id |  dst_uri  | probe_mode
> +--+---+
>   1 |1 | sip:66.180.205.11 |  2
>   2 |1 | sip:66.180.205.12 |  2
>   3 |2 | sip:10.0.10.1 |  2
>   4 |2 | sip:10.0.10.2 |  2
> 
> 
> What's happening is that the load balancer is trying to probe the public
> IPs from the private interface IP (and failing of course).
> 
> tcpdump output on internal interface:
> 18:13:26.471734 IP 10.0.10.3.5060 > 66.180.205.11.5060: SIP, length:
> 18:13:28.473802 IP 10.0.10.3.5060 > 66.180.205.11.5060: SIP, length:
> 
> 
> Thoughts?
> 
> Thanks,
> Bill
> 
> ___
> 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


[OpenSIPS-Users] Load balancer probing from incorrect interface

2010-11-07 Thread Bill W.
Hello everyone,

I've got an opensips-1.6.3-tls installation using multiple interfaces
and load balancing.

My internal interface  is rfc1918 space and my external interface has
public IPs.
listen=udp:10.0.10.3:5060
listen=udp:66.180.205.3:5060


I have the following load_balancer configuration:
 id | group_id |  dst_uri  | probe_mode
+--+---+
  1 |1 | sip:66.180.205.11 |  2
  2 |1 | sip:66.180.205.12 |  2
  3 |2 | sip:10.0.10.1 |  2
  4 |2 | sip:10.0.10.2 |  2


What's happening is that the load balancer is trying to probe the public
IPs from the private interface IP (and failing of course).

tcpdump output on internal interface:
18:13:26.471734 IP 10.0.10.3.5060 > 66.180.205.11.5060: SIP, length:
18:13:28.473802 IP 10.0.10.3.5060 > 66.180.205.11.5060: SIP, length:


Thoughts?

Thanks,
Bill

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


Re: [OpenSIPS-Users] Opensips relaying MESSAGE - source IP problem

2010-11-07 Thread Sebastien CRUAUX
I'm getting the same problem with RTP packets... Maybe some issue with 
rtpproxy bridging mode ?



Le 05/11/2010 11:21, Vallimamod ABDULLAH a écrit :
> Hi,
>
> Have a look at force_send_socket 
> (http://www.opensips.org/Resources/DocsCoreFcn#toc103)
>
> Regards,
> - vma
> .
>
> On Nov 5, 2010, at 11:10 AM, Sebastien CRUAUX wrote:
>
>> Hi,
>>
>> I'm encountering some issue with my Opensips configuration.
>> My Opensips server is configured to relay SIP MESSAGE requests to
>> another server when the destination URI is not located on my server.
>> Here is the part of opensips.cfg which is concerned :
>>
>> if (!lookup("location","m")) {
>>
>>switch ($retcode) {
>>  case -1:
>>  case -3:
>>rewritehost("10.254.230.148");
>>if (is_method("MESSAGE")) {
>>  rewriteport("5062");
>>}
>>if (!t_relay()) {
>>  sl_reply_error();
>>} exit;
>>  case -2:
>>sl_send_reply("405", "Method Not Allowed");
>>exit;
>>}
>> }
>>
>> My server receives SIP requests on eth0 interface (IP 10.254.31.45) but
>> when it relays the requests to the server 10.254.230.148 it should use
>> eth2 IP (10.254.28.45) as src IP because there is a firewall between the
>> two servers and port 5062 is only allowed for source IP 10.254.28.45.
>> The problem is the following : when I open Wireshark on my Opensips
>> server, I can see that the source IP for the relayed MESSAGE is still
>> 10.254.31.45 so it never reaches the other server ! I don't understand
>> where is the issue, my Linux routing table is OK, when I'm trying to
>> reach 10.254.230.148 from my Opensips server using telnet for example it
>> uses the right interface and the right gateway. Here is my routing table :
>>
>> 10.254.230.144 10.254.28.1 255.255.255.240 UG 0 0 0 eth2
>> 10.254.31.0 0.0.0.0 255.255.255.0 U 0 0 0 eth0
>> 10.254.28.0 0.0.0.0 255.255.255.0 U 0 0 0 eth2
>> 10.254.29.0 0.0.0.0 255.255.255.0 U 0 0 0 eth3
>> 192.168.0.0 10.254.28.1 255.255.255.0 UG 0 0 0 eth2
>> 10.254.225.0 10.254.28.1 255.255.255.0 UG 0 0 0 eth2
>> 0.0.0.0 10.254.31.1 0.0.0.0 UG 0 0 0 eth0
>>
>> Did I miss something in Opensips configuration file ?
>> Thanks a lot for your help.
>>
>> Best Regards,
>>
>> Sebastien
>>
>>
>>
>> ___
>> 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