[OpenSIPS-Users] function with 6 parameters

rad bogdan bogdan_rad2004 at yahoo.com
Wed Apr 6 16:51:55 CEST 2011


Hi Bogdan,

The "inversion" is only in the triggered function.
The arguments are passed correctly from left to right to the fixup function.

The triggered function is:

test_function(struct sip_msg *msg, char *arg1, char *arg2, char* arg3, char* arg4, char* arg5, char* arg6)
{
    str arg1_s  = {NULL, 0};

    if(arg1 == NULL || fixup_get_svalue(msg, (gparam_p)arg1, &arg1_s) != 0)
    {
        LM_ERR("Invalid arg1 argument\n");
        return -1;
    }
.........
}

arg1_s.s has the value of arg6_s.s while arg6_s.s has the correct value.

Thanks,
Bogdan

--- On Wed, 4/6/11, Bogdan-Andrei Iancu <bogdan at opensips.org> wrote:

From: Bogdan-Andrei Iancu <bogdan at opensips.org>
Subject: Re: [OpenSIPS-Users] function with 6 parameters
To: "OpenSIPS users mailling list" <users at lists.opensips.org>
Cc: "rad bogdan" <bogdan_rad2004 at yahoo.com>
Date: Wednesday, April 6, 2011, 5:15 PM



  

    
  Hi Bogdan,

    

    This "inversion" is visible in the fixup function or is the
    triggered function ?

    

    Regards,

    Bogdan

    

    On 04/06/2011 02:44 PM, rad bogdan wrote:
    
      
        
          
            Hi everyone,

              

              I implemented an OpenSIPS custom module that communicates
              with an external application. From the routing script I
              call a function with 6 parameters:

              

              test_function('$fU', '$tU', '$ci', '$avp(s:name1)',
              '$avp(s:name2)', '$var(name3)')

              

              The problem is that when the corresponding function is
              called in C, the first parameter gets the value of the
              last one.

              

              This doesn't happen when the function is made to take 5
              parameters.

              

              The fixup function that I use is this:

              

              static int pvn_fixup_spve_spve_6(void** param, int
              param_no)

              {

                  if (!(param_no >= 1 && param_no <= 6))

                  {

                      LM_ERR("invalid parameter number %d\n", param_no);

                      return E_UNSPEC;

                  }

                  

                  return fixup_spve(param);

              }

              

              Is there something wrong with it or the problem is
              elsewhere ?

              

              Thanks,

              Bogdan

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

    
    

    

    -- 
Bogdan-Andrei Iancu
OpenSIPS eBootcamp - 2nd of May 2011
OpenSIPS solutions and "know-how"
  
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.opensips.org/pipermail/users/attachments/20110406/a14b67b8/attachment.htm>


More information about the Users mailing list