[OpenSIPS-Users] Help with is_present_hf

Dave Singer dave.singer at wideideas.com
Mon Feb 7 18:48:21 CET 2011


Tyler,

Not sure but I believe custom headers are supposed to start with "X-"
and it may be that opensips is rejecting putting it in because it is
not a standard SIP header and it does not start with "X-".
Turning up the debug would probably show why.

Dave

On Mon, Feb 7, 2011 at 6:02 AM, Tyler Merritt <tyler at fonality.com> wrote:
> Using Opensips 1.6 ->
> Can anyone tell me what I'm doing wrong here?
> if (is_present_hf("P-Called-Party-Id")) {
>                          append_hf("GW: EPSILON\r\n");
>                          $avp(oriUri) =
> $(hdr(P-Called-Party-Id){s.substr,5,12});
>                          xlog("L_INFO", "Reply user now equals $avp(oriUri)
> from P-Called-Party-Id");
>   }
>
> Here is the packet that should hit this block:
> E..... at ...u.................INVITE sip:NUMBER at HOST:5060 SIP/2.0
> Via: SIP/2.0/UDP REMOTEHOST:5060;branch=z9hG4bKbkr26a0010bgsbs5b640.1
> Max-Forwards: 66
> From: "NUMBER" <sip:NUMBER at HOST>;tag=SDd4l3002-as19e30264
> To: <sip:NUMBER at HOST>
> Contact: <sip:NUMBER at HOST:5060;transport=udp>;nat=yes
> CSeq: 103 INVITE
> P-Called-Party-Id: <sip:NUMBER at HOST:5060>
> Allow: INVITE, ACK, CANCEL, BYE
> As you can see - there is definitely a P-Called-Party-Id...
> The daemon.log actually shows the avp being set:
> /usr/sbin/opensips[13365]: Reply user now equals NUMBER from
> P-Called-Party-Id
> That's the only place in my config where I'm setting the $avp at all.
> And yet - I've added a bunch of header fields that help me watch where a
> packet routes through the code:
> GW: ALPHA
> GW: CHARLIE
> GW: NOVEMBER
> GW: SIERRA
> GW: TANGO
> GW: WILCO
> GW: XRAY
> GW: ZULU
>
> The header "GW: EPSILON" should be added if the packet were routed through
> that block of code - and it's not...
> I don't get it.  The functionality that I'm aiming for isn't working
> (resetting the outbound Contact to the inbound URI of the original request -
> but there's an Asterisk box in the way so it's the same as referencing two
> requests prior).
>
> _______________________________________________
> Users mailing list
> Users at lists.opensips.org
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>



More information about the Users mailing list