[Kamailio-Users] i want to get user defined header value

Daniel-Constantin Mierla miconda at gmail.com
Tue Nov 24 10:17:02 CET 2009



On 24.11.2009 9:57 Uhr, Alex Balashov wrote:
> Daniel-Constantin Mierla wrote:
>> Hello,
>>
>> On 24.11.2009 9:50 Uhr, Alex Balashov wrote:
>>> Daniel-Constantin Mierla wrote:
>>>
>>>> Hello,
>>>>
>>>> On 23.11.2009 11:37 Uhr, Alex Balashov wrote:
>>>>> Please don't forget to copy your responses back to the list so 
>>>>> that others can benefit from this discussion.
>>>>>
>>>>> I must have misunderstood your intended meaning of "user-defined." 
>>>>> $hdr(...) takes only string literals as arguments, not 
>>>>> pseudovariables.
>>>> actually $hdr(...) should be able to take PV as header name:
>>>>
>>>> $var(n) = "From";
>>>> xlog("--- $hdr($var(n))\n");
>>>>
>>>> If it is no longer working, that should be fixed.
>>>
>>> I came to the same conclusion a few hours ago after reviewing the 
>>> code.  It is strange that it does not work.
>>
>> have you tested and does not work? Any error message in the logs? I 
>> can test later today...
>>
>> Thanks,
>> Daniel
>>
>>
>
> It does not with Kamailio 1.5.1:
>
> Nov 24 03:45:25 diminuendo-1 /usr/local/sbin/kamailio[25362]: 
> ERROR:core:pv_get_spec_name: name type is PV_NAME_OTHER - cannot resolve
> Nov 24 03:45:25 diminuendo-1 /usr/local/sbin/kamailio[25362]: 
> ERROR:pv:pv_get_hdr: invalid name
> Nov 24 03:45:25 diminuendo-1 /usr/local/sbin/kamailio[25362]: 
> [R-2:SDl9o0101-a1aa80162d5fbfc1911a608785ad814e-omv02r3] -> From header:
>
> This is attempting to do:
>
>         $var(n) = "From";
>         xlog("L_INFO", "[R-2:$ci] -> From header: $hdr($var(n))\n");
>
>
I tested with 1.5.3 and works. It was an issue fixed after 1.5.1:
http://openser.svn.sourceforge.net/viewvc/openser?view=rev&revision=5869


Cheers,
Daniel

-- 
Daniel-Constantin Mierla
* http://www.asipto.com/




More information about the Users mailing list