Extracting a value from a header and assigning it to an AVP

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|

Extracting a value from a header and assigning it to an AVP

Sven Schulz
Extracting a value from a header and assigning it to an AVP Lets say for example, another SIP server sends my opensips server a header “P-Hint: 3”.
I would like to extract the value (3) from that header (P-Hint:) and assign it to an AVP.
How do I do this?

I tried this but it doesn’t seem to work:

if (is_present_hf("P-Hint")) {
                $avp(i:20)=$(hdr(P-Hint));

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Extracting a value from a header and assigning it to an AVP

SamyGo
Print an xlog there, I think it's not hitting this condition ! 

On Wed, Sep 28, 2011 at 1:26 AM, Sven Schulz <[hidden email]> wrote:
Lets say for example, another SIP server sends my opensips server a header “P-Hint: 3”.
I would like to extract the value (3) from that header (P-Hint:) and assign it to an AVP.
How do I do this?

I tried this but it doesn’t seem to work:

if (is_present_hf("P-Hint")) {
                $avp(i:20)=$(hdr(P-Hint));

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users



_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Extracting a value from a header and assigning it to an AVP

Sven Schulz
Re: [OpenSIPS-Users] Extracting a value from a header and assigning it to an AVP Ok, I fixed it. I was hitting  the condition. My problem was that the other SIP server was adding the value as a string not an integer.

So this worked:

$avp(i:20)=$(hdr(P-Hint){s.int});


On 9/28/11 1:41 AM, "Sam Govind" <govoiper@...> wrote:

Print an xlog there, I think it's not hitting this condition ! 

On Wed, Sep 28, 2011 at 1:26 AM, Sven Schulz <svens@...> wrote:
Lets say for example, another SIP server sends my opensips server a header “P-Hint: 3”.
I would like to extract the value (3) from that header (P-Hint:) and assign it to an AVP.
How do I do this?

I tried this but it doesn’t seem to work:

if (is_present_hf("P-Hint")) {
                $avp(i:20)=$(hdr(P-Hint));

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




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

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users