[Devel] How to use receive_info structure in a module of openser

Klaus Darilion klaus.mailinglists at pernau.at
Thu Jun 14 11:59:02 CEST 2007


Take a look at do_from_gw() in modules/lcr/lcr_mod.c

regards
klaus


lariny guy wrote:
> Hi,
>  
>  I have writen a new module for openser. So, can anyone tell me how to get access to the receive_info structure members from a module?!This, in order to access the softphone information like IP adress and port!
>  
>  Thank you in advance
>  
> 
> devel-request at openser.org wrote: Send Devel mailing list submissions to
>  devel at openser.org
> 
> To subscribe or unsubscribe via the World Wide Web, visit
>  http://openser.org/cgi-bin/mailman/listinfo/devel
> or, via email, send a message with subject or body 'help' to
>  devel-request at openser.org
> 
> You can reach the person managing the list at
>  devel-owner at openser.org
> 
> When replying, please edit your Subject line so it is more specific
> than "Re: Contents of Devel digest..."
> 
> 
> Today's Topics:
> 
>    1. RE: SF.net SVN: openser:
>       [2351]trunk/modules/presence/notify.c (Toni Barata)
>    2. SF.net SVN: openser: [2353] trunk (Henning Westerholt)
>    3. [ openser-Patches-1731009 ] move print_* functions from
>       db-modules to db core (SourceForge.net)
>    4. SF.net SVN: openser: [2354] trunk/db/db_ut.c (Henning Westerholt)
>    5. SF.net SVN: openser: [2352] trunk/db/schema (Juha Heinanen)
>    6. do_assign: no value in right expression (Juha Heinanen)
>    7. length of non-exiting $fU (Juha Heinanen)
>    8. null != null (Juha Heinanen)
>    9. Re: null != null (Daniel-Constantin Mierla)
>   10. Re: do_assign: no value in right expression
>       (Daniel-Constantin Mierla)
>   11. Re: SF.net SVN: openser: [2351]
>       trunk/modules/presence/notify.c (Daniel-Constantin Mierla)
>   12. Re: length of non-exiting $fU (Daniel-Constantin Mierla)
>   13. follow up to the comparing test for SER and OpenSER from
>       TransNexus (Di-Shi Sun)
> 
> 
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Mon, 11 Jun 2007 14:55:45 +0100
> From: "Toni Barata" 
> Subject: RE: [Devel] SF.net SVN: openser:
>  [2351]trunk/modules/presence/notify.c
> To: "Daniel-Constantin Mierla" ,
>  
> Message-ID:
>  
> Content-Type: text/plain; charset="us-ascii"
> 
> I forgot to mention that a need an example for presence service.
> 
> Best regards,
> Toni
> 
> -----Original Message-----
> From: devel-bounces at openser.org [mailto:devel-bounces at openser.org] On
> Behalf Of Toni Barata
> Sent: segunda-feira, 11 de Junho de 2007 14:51
> To: Daniel-Constantin Mierla; devel at openser.org
> Subject: RE: [Devel] SF.net SVN: openser:
> [2351]trunk/modules/presence/notify.c
> 
> Hi all,
> 
> Can someone send me an openser.cfg file example who works with
> trunk-2351 version?
> 
> Thanks
> Toni
> 
> -----Original Message-----
> From: devel-bounces at openser.org [mailto:devel-bounces at openser.org] On
> Behalf Of Daniel-Constantin Mierla
> Sent: segunda-feira, 11 de Junho de 2007 14:08
> To: devel at openser.org
> Subject: [Devel] SF.net SVN: openser: [2351]
> trunk/modules/presence/notify.c
> 
> Revision: 2351
>           http://openser.svn.sourceforge.net/openser/?rev=2351&view=rev
> Author:   miconda
> Date:     2007-06-11 06:07:36 -0700 (Mon, 11 Jun 2007)
> 
> Log Message:
> -----------
> - quick fix for presence crash due to free notify bodies in different
> types of event (mwi -- reported by Juha Heinanen) -- needs more analysis
> 
> Modified Paths:
> --------------
>     trunk/modules/presence/notify.c
> 
> 
> This was sent by the SourceForge.net collaborative development platform,
> the world's largest Open Source development site.
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
> 
> 
> 
> ------------------------------
> 
> Message: 2
> Date: Mon, 11 Jun 2007 06:57:32 -0700
> From: Henning Westerholt 
> Subject: [Devel] SF.net SVN: openser: [2353] trunk
> To: devel at openser.org
> Message-ID: 
> Content-Type: text/plain; charset=UTF-8
> 
> Revision: 2353
>           http://openser.svn.sourceforge.net/openser/?rev=2353&view=rev
> Author:   henningw
> Date:     2007-06-11 06:57:32 -0700 (Mon, 11 Jun 2007)
> 
> Log Message:
> -----------
> - move customized print_* functions from db-modules to db core
> - use a function pointer for the customized val2str function from the modules
>   that gets used in the common function in db core
> - Thanks to Victor Gamov for the patch
> 
> Modified Paths:
> --------------
>     trunk/db/db_ut.c
>     trunk/db/db_ut.h
>     trunk/modules/mysql/dbase.c
>     trunk/modules/mysql/val.c
>     trunk/modules/mysql/val.h
>     trunk/modules/postgres/dbase.c
>     trunk/modules/unixodbc/dbase.c
>     trunk/modules/unixodbc/val.c
>     trunk/modules/unixodbc/val.h
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
> 
> 
> 
> ------------------------------
> 
> Message: 3
> Date: Mon, 11 Jun 2007 07:02:19 -0700
> From: "SourceForge.net" 
> Subject: [Devel] [ openser-Patches-1731009 ] move print_* functions
>  from db-modules to db core
> To: noreply at sourceforge.net
> Message-ID: 
> Content-Type: text/plain; charset="UTF-8"
> 
> Patches item #1731009, was opened at 2007-06-04 20:40
> Message generated for change (Comment added) made by henningw
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1731009&group_id=139143
> 
> 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: None
> Group: ver devel
> Status: Open
> Resolution: None
> Priority: 5
> Private: No
> Submitted By: Victor Gamov (vitspec)
> Assigned to: Nobody/Anonymous (nobody)
> Summary: move print_* functions from db-modules to db core
> 
> Initial Comment:
> Hi!
> 
> When I prepare patch for MySQL PS I found that all DB modules (MySQL, UnixODBC, PostgreSQL) uses many similar functions like print_values() (I think its was created as copy-paste when new module writed).
> 
> I red devel list and found that Henning do many works to standardize such functions and move it into db/db_ut.c
> 
> In this patch I move print_values(), print_set() and print_where() functions into db/db_ut.c. New functions have db_ prefix in their names now.
> 
> MySQL and UnixODBC modules was patched to use new API. This modules are tested in simple environment (openser started, SELECT, INSERT, UPDATE works)
> 
> PostgreSQL module patched too but I haven't DB to test this patch.
> 
> Hope it will be usefull for OpenSER
> 
> ----------------------------------------------------------------------
> 
> Comment By: Henning Westerholt (henningw)
> Date: 2007-06-11 14:02
> 
> Message:
> Logged In: YES 
> user_id=337916
> Originator: NO
> 
> I've commited your patch after some small changes:
> 
> - fixing of a wrong define in the mysql val.h file
> - removing of some superflous logging in db core (function pointer stuff)
> 
> I applied it to trunk, thanks again.
> 
> Henning
> 
> ----------------------------------------------------------------------
> 
> Comment By: Victor Gamov (vitspec)
> Date: 2007-06-05 21:10
> 
> Message:
> Logged In: YES 
> user_id=1625470
> Originator: YES
> 
> Hi Henning!
> 
> If my comments or some improvments for this patch are needed please email
> me
> 
> Thanks!
> 
> ----------------------------------------------------------------------
> 
> Comment By: Henning Westerholt (henningw)
> Date: 2007-06-05 05:47
> 
> Message:
> Logged In: YES 
> user_id=337916
> Originator: NO
> 
> Hello Victor,
> 
> thank you for the patch. This should be defininitly useful. I haven't
> found time yet to look into this functions.
> 
> I'll review your patch in the next few days.
> 
> Cheers,
> 
> Henning
> 
> ----------------------------------------------------------------------
> 
> You can respond by visiting: 
> https://sourceforge.net/tracker/?func=detail&atid=743022&aid=1731009&group_id=139143
> 
> 
> 
> ------------------------------
> 
> Message: 4
> Date: Mon, 11 Jun 2007 07:08:06 -0700
> From: Henning Westerholt 
> Subject: [Devel] SF.net SVN: openser: [2354] trunk/db/db_ut.c
> To: devel at openser.org
> Message-ID: 
> Content-Type: text/plain; charset=UTF-8
> 
> Revision: 2354
>           http://openser.svn.sourceforge.net/openser/?rev=2354&view=rev
> Author:   henningw
> Date:     2007-06-11 07:08:06 -0700 (Mon, 11 Jun 2007)
> 
> Log Message:
> -----------
> -unify logging messages in db/db_ut.h, use 'db_' prefix in all cases
> 
> Modified Paths:
> --------------
>     trunk/db/db_ut.c
> 
> 
> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
> 
> 
> 
> ------------------------------
> 
> Message: 5
> Date: Mon, 11 Jun 2007 18:56:14 +0300
> From: jh at tutpro.com (Juha Heinanen)
> Subject: [Devel] SF.net SVN: openser: [2352] trunk/db/schema
> To: Henning Westerholt 
> Cc: devel at openser.org
> Message-ID: <18029.28830.855412.497304 at harjus.tutpro.com>
> Content-Type: text/plain; charset=us-ascii
> 
> henning,
> 
> one more thing:  address table belongs to permissions module, not to lcr
> module.
> 
> -- juha
> 
> 
> 
> 
> ------------------------------
> 
> Message: 6
> Date: Mon, 11 Jun 2007 19:16:09 +0300 (EEST)
> From: jh at tutpro.com (Juha Heinanen)
> Subject: [Devel] do_assign: no value in right expression
> To: devel at openser.org
> Message-ID: <20070611161609.5BC8BAC328 at harjus.tutpro.com>
> 
> my proxy got a request that had no From URI userpart, i.e., from uri
> looked like
> 
> From: sip:foo;tag=bar
> 
> i had an xlog statement in openser.cfg that assigns from uri userpart
> ($fU) to a pseudo variable.  as result, i get to syslog:
> 
> do_assign: no value in right expression
> 
> in these kind of situations, would it possible to assume that right
> expression has value NULL and not to produce the syslog message?  it
> would namely be too cumbersome to each time test if a thing is not
> NULL before the assignment.
> 
> -- juha
> 
> 
> 
> ------------------------------
> 
> Message: 7
> Date: Mon, 11 Jun 2007 19:24:09 +0300
> From: jh at tutpro.com (Juha Heinanen)
> Subject: [Devel] length of non-exiting $fU
> To: devel at openser.org
> Message-ID: <18029.30505.852260.504506 at harjus.tutpro.com>
> Content-Type: text/plain; charset=us-ascii
> 
> during my testing spree, another thing popped up.  
> 
> any explanation for this?
> 
>  xlog("L_INFO", "Legth of <$ru> user is <$(rU{s.len})>\n");
> 
> produces
> 
>  Legth of  user is <1>
> 
> -- juha
> 
> 
> 
> 
> 
> ------------------------------
> 
> Message: 8
> Date: Mon, 11 Jun 2007 19:34:42 +0300
> From: jh at tutpro.com (Juha Heinanen)
> Subject: [Devel] null != null
> To: devel at openser.org
> Message-ID: <18029.31138.718051.724340 at harjus.tutpro.com>
> Content-Type: text/plain; charset=us-ascii
> 
> Juha Heinanen writes:
> 
> here is a proof of a third one which i have suspected already earlier.
> 
> -- juha
> 
> statements
> 
>  $var(test) = null;
>  $avp(s:test) = null;
>  if ($var(test) != $avp(s:test)) {
>   xlog("L_INFO", "$var(test) != $avp(s:test)\n");
>  };
> 
> produce
> 
> 0 != 
> 
> 
> 
> ------------------------------
> 
> Message: 9
> Date: Tue, 12 Jun 2007 01:27:39 +0300
> From: Daniel-Constantin Mierla 
> Subject: Re: [Devel] null != null
> To: Juha Heinanen 
> Cc: devel at openser.org
> Message-ID: <466DCC5B.3050405 at voice-system.ro>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> setting $var(xyz) to null makes its value to integer 0. There is no 
> 'null' state for the value of the $var(xyz), same as for $avp(xyz) -- 
> making avp null actually deletes it.
> 
> In your comparison, you test integer '0' against unexisting avp.
> 
> Cheers,
> Daniel
> 
> On 06/11/07 19:34, Juha Heinanen wrote:
>> Juha Heinanen writes:
>>
>> here is a proof of a third one which i have suspected already earlier.
>>
>> -- juha
>>
>> statements
>>
>>  $var(test) = null;
>>  $avp(s:test) = null;
>>  if ($var(test) != $avp(s:test)) {
>>   xlog("L_INFO", "$var(test) != $avp(s:test)\n");
>>  };
>>
>> produce
>>
>> 0 != 
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>
>>   
> 
> 
> 
> ------------------------------
> 
> Message: 10
> Date: Tue, 12 Jun 2007 01:22:08 +0300
> From: Daniel-Constantin Mierla 
> Subject: Re: [Devel] do_assign: no value in right expression
> To: Juha Heinanen 
> Cc: devel at openser.org
> Message-ID: <466DCB10.6080708 at voice-system.ro>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hello,
> 
> assuming NULL value can producing unexpecting results. For example, 
> assigning null to an avp will delete first avp with that name. It might 
> not be what exactly someone expects from such operation -- instead of 
> getting a new avp, you get deleted an existing one.
> 
> Cheers,
> Daniel
> 
> 
> On 06/11/07 19:16, Juha Heinanen wrote:
>> my proxy got a request that had no From URI userpart, i.e., from uri
>> looked like
>>
>> From: sip:foo;tag=bar
>>
>> i had an xlog statement in openser.cfg that assigns from uri userpart
>> ($fU) to a pseudo variable.  as result, i get to syslog:
>>
>> do_assign: no value in right expression
>>
>> in these kind of situations, would it possible to assume that right
>> expression has value NULL and not to produce the syslog message?  it
>> would namely be too cumbersome to each time test if a thing is not
>> NULL before the assignment.
>>
>> -- juha
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>
>>   
> 
> 
> 
> ------------------------------
> 
> Message: 11
> Date: Tue, 12 Jun 2007 01:44:37 +0300
> From: Daniel-Constantin Mierla 
> Subject: Re: [Devel] SF.net SVN: openser: [2351]
>  trunk/modules/presence/notify.c
> To: Juha Heinanen 
> Cc: devel at openser.org
> Message-ID: <466DD055.3070500 at voice-system.ro>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> Hello,
> 
> On 06/11/07 16:25, Juha Heinanen wrote:
>> Daniel-Constantin Mierla writes:
>>
>>  > Log Message:
>>  > -----------
>>  > - quick fix for presence crash due to free notify bodies in different
>>  > - types of event (mwi -- reported by Juha Heinanen) -- needs more
>>  > - analysis
>>
>> daniel,
>>
>> thanks for the fix.  in the meanwhile, i was reading the sources and as
>> far as i can tell, memory for notify_body is allocated using pkg_malloc
>> both in case when aggregation is not needed and is needed.
>>   
> that's the str structure, not the content of it. Further down on the 
> code, the notify_body->s is allocated differently. It is the pointer 
> where the free crashed.
> 
> Cheers,
> Daniel
> 
>> -  in notify.c/get_p_notify_body():
>>
>>  DBG("PRESENCE:get_p_notify_body: Event does not
>>   require aggregation\n");
>>  ...
>>         notify_body= (str*)pkg_malloc(sizeof(str));
>>         ...
>>         return notify_body;
>>
>> - presence_xml/notify_body.c/agregate_xmls():
>>
>>  ...
>>  body = (str*)pkg_malloc(sizeof(str));
>>         ...
>>  return body;
>>
>> but let anca verify this.
>>
>> -- juha
>>
>>   
> 
> 
> 
> ------------------------------
> 
> Message: 12
> Date: Tue, 12 Jun 2007 02:05:22 +0300
> From: Daniel-Constantin Mierla 
> Subject: Re: [Devel] length of non-exiting $fU
> To: Juha Heinanen 
> Cc: devel at openser.org
> Message-ID: <466DD532.5040900 at voice-system.ro>
> Content-Type: text/plain; charset=ISO-8859-1; format=flowed
> 
> 
> 
> On 06/11/07 19:24, Juha Heinanen wrote:
>> during my testing spree, another thing popped up.  
>>
>> any explanation for this?
>>
>>  xlog("L_INFO", "Legth of <$ru> user is <$(rU{s.len})>\n");
>>
>> produces
>>
>>  Legth of  user is <1>
>>   
> well, yes, this is kind of bug, and that's mainly because behind there 
> is a value of integer 0, which gets converted to string and results in 
> length 1. Obviously, the null flag should be checked and the result 
> should be 0. I will think about a nice way of handling that. Thanks for 
> catching it.
> 
> Cheers,
> Daniel
> 
>> -- juha
>>
>>
>>
>> _______________________________________________
>> Devel mailing list
>> Devel at openser.org
>> http://openser.org/cgi-bin/mailman/listinfo/devel
>>
>>   
> 
> 
> 
> ------------------------------
> 
> Message: 13
> Date: Tue, 12 Jun 2007 09:15:10 +0800
> From: "Di-Shi Sun" 
> Subject: [Devel] follow up to the comparing test for SER and OpenSER
>  from TransNexus
> To: 
> Cc: devel at openser.org, Support of TransNexus 
> Message-ID: <00cc01c7ac8f$22213190$f3ab217d at e520>
> Content-Type: text/plain; charset="iso-8859-1"
> 
> All,
> 
> This e-mail is follow-up to our previous posting about tests we performed at TransNexus comparing SER and OpenSER. Our tests were for wholesale VoIP carriers who want a straightforward, unbiased comparison of OpenSER and SER. As part of this goal, we purposely chose the simple implementation of building each software with default settings.
> 
> Folks from the SER community have pointed out to us that building each platform based on the default configuration does not lead to an accurate comparison because debug and blacklisting settings for SER and OpenSER are different and favor the performance results of OpenSER.
> 
> Since our goal is to provide users with the most accurate comparison possible, we are seeking feedback from both communities on what changes should be made to the SER and OpenSER compile/configuration options in order to measure an accurate comparison between the two software platforms.
> 
> We are considering re-running the performance test with debug and blacklisting turned off for both OpenSER and SER based on advice from folks in the community that this configuration will produce a more accurate comparison.
> 
> Does anyone else have any advice or input to offer before we re-run the Performance Comparison test?
> 
> Thank you,
> 
> Di-Shi Sun.
> -------------- next part --------------
> An HTML attachment was scrubbed...
> URL: http://openser.org/pipermail/devel/attachments/20070612/edacb3dd/attachment.html
> 
> ------------------------------
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel
> 
> 
> End of Devel Digest, Vol 25, Issue 13
> *************************************
> 
> 
>        
> ---------------------------------
> Ask a question on any topic and get answers from real people. Go to Yahoo! Answers. 
> 
> 
> ------------------------------------------------------------------------
> 
> _______________________________________________
> Devel mailing list
> Devel at openser.org
> http://openser.org/cgi-bin/mailman/listinfo/devel



More information about the Devel mailing list