Re: [OpenSIPS-Devel] Share SIP Messages between 2 processes

2010-01-15 Thread Bogdan-Andrei Iancu
Olivier Détour wrote:
 On Thu, Jan 14, 2010 at 6:55 PM, Bogdan-Andrei Iancu
 bog...@voice-system.ro wrote:
   
 Hi Olivier,

 Olivier Détour wrote:
 
 Hi,

 I'm writing a B2B module for the B2B_entities module (like B2B_logic).
 In my initialisation,
 I create an extra process to poll on an extra FD to receive order to
 create UAC part.

   
 Why don't you use the MI stuff for this? you can trigger an action /
 event by sending an MI command to the server - you module just has to
 export a new MI function.
 
 I would like to know how to share a SIP message between the module and
 the extra process
 (I'm using OpenSIPs in fork mode ...) ? I tried to shm_malloc it but I
 get an out of memory error
 on the second Communication.

   
 normally using shm_malloc is the trick, but depends of where you fork
 your process (if the shm is inherited) and who you use it for
 transferring data from from A to B.
 

 Forks come from OpenSIPs itself (worker forks + my extra fork (extra
 process in module declaration)).
   
OK, that's correct
 I think I have to use shared memory to share data between different
 processes. I tried to find the best and the most optimize way to use
 it.
   
yes, you should use the sh mem. But what exactly do faile for you? I 
mean what exactly are you doing and what step fails? is the malloc not 
working? or ?
 Do you know actually, how much percent of the 32 MB of shared memory,
 is used by OpenSIPs ?
   
Depends of what modules you are using - each module may have some 
internal data structures that are kept in shm mem.
You can check this via MI interface, after starting opensips (with no 
ongoing traffic) : opensipsctl fifo get_statistics all

Regards,
Bogdan

-- 
Bogdan-Andrei Iancu
www.voice-system.ro


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


Re: [OpenSIPS-Devel] Debugging crash

2010-01-15 Thread Alex Massover
Yes, you right, I should have done it in the libradiusclient rather than 
hacking acc module.
Now it runs already for 18 hours - so I suppose it's OK for now, before the new 
design is available.

Thanks and looking forward to switch to the new opensips architecture! :)
--
Sincerely yours,
Alex Massover
VoIP RD TL
Jajah Inc.

 -Original Message-
 From: devel-boun...@lists.opensips.org [mailto:devel-
 boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
 Sent: Friday, January 15, 2010 1:48 PM
 To: OpenSIPS devel mailling list
 Subject: Re: [OpenSIPS-Devel] Debugging crash
 
 Hi Alex,
 
 I see - I guess you did some extension to simulate non blocking radius
 acc and this triggers the problem in the lib.
 
 Regarding the question - to make the acc non-blocking is something to
 be
 normally done in the lib radius (like the net functions do allow you to
 use them into a non-blocking way). Trying to emulate non-blocking in
 opensips for blocking function is a kind of ugly and bullsxxt stuff.
 
 Anyhow, we are preparing the new design for opensips - probably it will
 be published next week or so. It will solve all these problems.
 
 Regards,
 Bogdan
 
 Regards,
 Bogdan
 
 Alex Massover wrote:
  Hi!
 
  I use DNS. As far as I understand the reason could be that
 libradiusclient use gethostbyaddr() which is not reentrant and I call
 to libradiusclient in threads.
 
  So I recompiled libradiusclient with -D_REENTRANT.
 
  Afterwards it crashed also in libradiusclient in free() - no idea
 meanwhile how it happened. Just to be sure I added one more if() before
 sending it to free().
 
  The strange thing is that crash happens only after several hours of
 stress test, after processing thousands of calls.
  AFAIU it looks like memory corruption.
 
  Now I recompiled everything with -O0 and run with _MALLOCK_CHECK=1,
 meanwhile it's ok.
 
  Can you think about any special complication of opening threads to
 make accounting non-blocking?
 
 
  --
  Sincerely yours,
  Alex Massover
  VoIP RD TL
  Jajah Inc.
 
 
  -Original Message-
  From: devel-boun...@lists.opensips.org [mailto:devel-
  boun...@lists.opensips.org] On Behalf Of Bogdan-Andrei Iancu
  Sent: Thursday, January 14, 2010 8:06 PM
  To: OpenSIPS devel mailling list
  Subject: Re: [OpenSIPS-Devel] Debugging crash
 
  Hi Alex,
 
  The crash looks to be in the libradiusclient stuffand not in the
  opensips part.
 
  Looking at the backtrace, it seams the lib tries to resolve the name
 of
  the acc server - do you use DNS or IP for it?
 
  Regards,
  Bogdan
 
  Alex Massover wrote:
 
  Hmmm... -D_REENTRANT supposed to help here?
 
  --
 
  Best Regards,
 
  Alex Massover
 
  VoIP RD TL
 
  Jajah Inc.
 
  *From:* devel-boun...@lists.opensips.org
  [mailto:devel-boun...@lists.opensips.org] *On Behalf Of *Alex
 
  Massover
 
  *Sent:* Monday, January 11, 2010 12:21 PM
  *To:* OpenSIPS devel mailling list
  *Subject:* Re: [OpenSIPS-Devel] Debugging crash
 
  Here's a backtrace:
 
  #0 0xb7fcf424 in __kernel_vsyscall ()
 
  (gdb) bt
 
  #0 0xb7fcf424 in __kernel_vsyscall ()
 
  #1 0xb7e7c640 in raise () from /lib/i686/cmov/libc.so.6
 
  #2 0xb7e7e018 in abort () from /lib/i686/cmov/libc.so.6
 
  #3 0xb7eb93dd in ?? () from /lib/i686/cmov/libc.so.6
 
  #4 0xb7ebf6b4 in ?? () from /lib/i686/cmov/libc.so.6
 
  #5 0xb7ec18b6 in free () from /lib/i686/cmov/libc.so.6
 
  #6 0xb7ebb69d in _IO_file_seekoff () from /lib/i686/cmov/libc.so.6
 
  #7 0xb7eb1900 in ?? () from /lib/i686/cmov/libc.so.6
 
  #8 0xb7eb7ea8 in rewind () from /lib/i686/cmov/libc.so.6
 
  #9 0xb74c7f2e in ?? () from /lib/i686/cmov/libnss_files.so.2
 
  #10 0xb74c86b8 in _nss_files_gethostbyaddr_r () from
  /lib/i686/cmov/libnss_files.so.2
 
  #11 0xb7f4a5ec in gethostbyaddr_r () from /lib/i686/cmov/libc.so.6
 
  #12 0xb7f4a3dc in gethostbyaddr () from /lib/i686/cmov/libc.so.6
 
  #13 0xb7ae75f5 in rc_ip_hostname () from /usr/lib/libradiusclient-
 
  ng.so.2
 
  #14 0xb7ae3b5f in rc_send_server () from /usr/lib/libradiusclient-
 
  ng.so.2
 
  #15 0xb7ae2b3d in rc_acct () from /usr/lib/libradiusclient-ng.so.2
 
  #16 0xb7da60cf in rad_send_message () from
  /usr/lib/opensips/modules/aaa_radius.so
 
  #17 0xb7ac6fed in thread_rc_acct () from
 
  /usr/lib/opensips/modules/acc.so
 
  #18 0xb7ba54c0 in start_thread () from
 /lib/i686/cmov/libpthread.so.0
 
  #19 0xb7f3161e in clone () from /lib/i686/cmov/libc.so.6
 
  --
 
  Best Regards,
 
  Alex Massover
 
  VoIP RD TL
 
  Jajah Inc.
 
  *From:* devel-boun...@lists.opensips.org
  [mailto:devel-boun...@lists.opensips.org] *On Behalf Of *Alex
 
  Massover
 
  *Sent:* Monday, January 11, 2010 12:04 PM
  *To:* OpenSIPS devel mailling list
  *Subject:* [OpenSIPS-Devel] Debugging crash
 
  Hi!
 
  We're running a stress test and after some time (tens of minutes
 and
  hundreds of processes calls) OpenSIPS 1.6.0 crashes.
 
  Below is an output of gdb. OpenSIPS is slightly tuned for
 
  performance:
 
  a) RADIUS accounting is sent in 

[OpenSIPS-Devel] [ opensips-Bugs-2927295 ] tm module socket write problems

2010-01-15 Thread SourceForge.net
Bugs item #2927295, was opened at 2010-01-07 04:29
Message generated for change (Comment added) made by bogdan_iancu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=2927295group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.6.x
Status: Closed
Resolution: Fixed
Priority: 5
Private: No
Submitted By: Richard Revels (rrevels)
Assigned to: Bogdan-Andrei Iancu (bogdan_iancu)
Summary: tm module socket write problems

Initial Comment:
Yes there is still a problem in t_fifo.c but I couldn't figure out how to 
re-open the last tracker.  The parameters declared for t_write_req are vm_fifo 
and info but the pointers passed to the function are reversed.  It looks like 
t_write_unix has the same problem.  I fixed the this by swapping the variable 
names passed to assemble_msg and write_to_fifo but I suspect this isn't the 
best way to resolve the problem.

--

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-01-15 14:45

Message:
If something new comes up, please reopen of open a new report.

Thanks.
Bogdan

--

Comment By: Bogdan-Andrei Iancu (bogdan_iancu)
Date: 2010-01-08 11:53

Message:
Indeed the two params were swapped . I fixed this on SVN - could you please
test it to see if it works now ?

Thanks and regards,
Bogdan

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=2927295group_id=232389

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


Re: [OpenSIPS-Devel] Share SIP Messages between 2 processes

2010-01-15 Thread Olivier Détour
On Fri, Jan 15, 2010 at 12:52 PM, Bogdan-Andrei Iancu
bog...@voice-system.ro wrote:
 Olivier Détour wrote:
 On Thu, Jan 14, 2010 at 6:55 PM, Bogdan-Andrei Iancu
 bog...@voice-system.ro wrote:

 Hi Olivier,

 Olivier Détour wrote:

 Hi,

 I'm writing a B2B module for the B2B_entities module (like B2B_logic).
 In my initialisation,
 I create an extra process to poll on an extra FD to receive order to
 create UAC part.


 Why don't you use the MI stuff for this? you can trigger an action /
 event by sending an MI command to the server - you module just has to
 export a new MI function.

 I would like to know how to share a SIP message between the module and
 the extra process
 (I'm using OpenSIPs in fork mode ...) ? I tried to shm_malloc it but I
 get an out of memory error
 on the second Communication.


 normally using shm_malloc is the trick, but depends of where you fork
 your process (if the shm is inherited) and who you use it for
 transferring data from from A to B.


 Forks come from OpenSIPs itself (worker forks + my extra fork (extra
 process in module declaration)).

 OK, that's correct
 I think I have to use shared memory to share data between different
 processes. I tried to find the best and the most optimize way to use
 it.

 yes, you should use the sh mem. But what exactly do faile for you? I
 mean what exactly are you doing and what step fails? is the malloc not
 working? or ?

When I use B2B, I have to forward my INVITE in another process, that
is why I have to copy it (body, URIs, ...) in my shm_malloced internal
data structure. It works, but I find it ugly.
Moreover, sometimes I get an internal error because I don't have
enough shared memory,
that's why I want to find a better way.

I'm blocked by OpenSIPs' architecture.

If this is the only way, I could optimize it on my side.

 Do you know actually, how much percent of the 32 MB of shared memory,
 is used by OpenSIPs ?

 Depends of what modules you are using - each module may have some
 internal data structures that are kept in shm mem.
 You can check this via MI interface, after starting opensips (with no
 ongoing traffic) : opensipsctl fifo get_statistics all


Thanks for the tips, it will be helpful to debugging.

 Regards,
 Bogdan


Regards,

-- 
Olivier Détour

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


[OpenSIPS-Devel] [ opensips-Bugs-2932845 ] 180 Ringing not forward to B2B_logic

2010-01-15 Thread SourceForge.net
Bugs item #2932845, was opened at 2010-01-15 12:49
Message generated for change (Tracker Item Submitted) made by nobody
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=2932845group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.6.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Nobody/Anonymous (nobody)
Summary: 180 Ringing not forward to B2B_logic

Initial Comment:
When a 180 ringing comes on OpenSIPs, it is not forward to B2B_logic module.

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=2932845group_id=232389

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


[OpenSIPS-Devel] [ opensips-Bugs-2932845 ] 180 Ringing not forward to B2B_logic

2010-01-15 Thread SourceForge.net
Bugs item #2932845, was opened at 2010-01-15 14:49
Message generated for change (Settings changed) made by anca_vamanu
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=2932845group_id=232389

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: modules
Group: 1.6.x
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Nobody/Anonymous (nobody)
Assigned to: Anca Vamanu (anca_vamanu)
Summary: 180 Ringing not forward to B2B_logic

Initial Comment:
When a 180 ringing comes on OpenSIPs, it is not forward to B2B_logic module.

--

Comment By: Anca Vamanu (anca_vamanu)
Date: 2010-01-15 15:51

Message:
Hi,

Have you set the module parameter in tm:
modparam(tm, pass_provisional_replies, 1) ?

Regards,
Anca

--

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detailatid=1086410aid=2932845group_id=232389

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


Re: [OpenSIPS-Devel] [ opensips-Bugs-2932845 ] 180 Ringing not forward to B2B_logic

2010-01-15 Thread Olivier Détour
On Fri, Jan 15, 2010 at 2:51 PM, SourceForge.net
nore...@sourceforge.net wrote:
 Bugs item #2932845, was opened at 2010-01-15 14:49
 Message generated for change (Settings changed) made by anca_vamanu
 You can respond by visiting:
 https://sourceforge.net/tracker/?func=detailatid=1086410aid=2932845group_id=232389

 Please note that this message will contain a full copy of the comment thread,
 including the initial issue submission, for this request,
 not just the latest update.
 Category: modules
 Group: 1.6.x
 Status: Open
 Resolution: None
 Priority: 5
 Private: No
 Submitted By: Nobody/Anonymous (nobody)
Assigned to: Anca Vamanu (anca_vamanu)
 Summary: 180 Ringing not forward to B2B_logic

 Initial Comment:
 When a 180 ringing comes on OpenSIPs, it is not forward to B2B_logic module.

 --

Comment By: Anca Vamanu (anca_vamanu)
 Date: 2010-01-15 15:51

 Message:
 Hi,

 Have you set the module parameter in tm:
 modparam(tm, pass_provisional_replies, 1) ?

Yes, this parameter is set.


 Regards,
 Anca


-- 
Olivier Détour
Sent from Paris, Île-de-France, France

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