Using Opensips 1.6 -><div><br></div><div>Can anyone tell me what I'm doing wrong here?</div><div><br></div><div><div>if (is_present_hf("P-Called-Party-Id")) {</div><div> append_hf("GW: EPSILON\r\n");</div>
<div> $avp(oriUri) = $(hdr(P-Called-Party-Id){s.substr,5,12});</div><div> xlog("L_INFO", "Reply user now equals $avp(oriUri) from P-Called-Party-Id");</div>
<div> }</div><div><br></div><div><br></div><div>Here is the packet that should hit this block:</div><div><br></div><div><div>E.....@...u.................INVITE sip:NUMBER@HOST:5060 SIP/2.0</div><div>Via: SIP/2.0/UDP REMOTEHOST:5060;branch=z9hG4bKbkr26a0010bgsbs5b640.1</div>
<div>Max-Forwards: 66</div><div>From: "NUMBER" <sip:NUMBER@HOST>;tag=SDd4l3002-as19e30264</div><div>To: <sip:NUMBER@HOST></div><div>Contact: <sip:NUMBER@HOST:5060;transport=udp>;nat=yes</div><div>
CSeq: 103 INVITE</div><div>P-Called-Party-Id: <sip:NUMBER@HOST:5060></div><div>Allow: INVITE, ACK, CANCEL, BYE</div></div><div><br></div><div>As you can see - there is definitely a P-Called-Party-Id... </div><div>
<br>
</div><div>The daemon.log actually shows the avp being set:</div><div><br></div><div><div>/usr/sbin/opensips[13365]: Reply user now equals NUMBER from P-Called-Party-Id</div></div><div><br></div><div>That's the only place in my config where I'm setting the $avp at all. </div>
<div><br></div><div>And yet - I've added a bunch of header fields that help me watch where a packet routes through the code:</div><div><br></div><div><div>GW: ALPHA</div><div>GW: CHARLIE</div><div>GW: NOVEMBER</div><div>
GW: SIERRA</div><div>GW: TANGO</div><div>GW: WILCO</div><div>GW: XRAY</div><div>GW: ZULU</div></div><div><br></div><div><br></div><div>The header "GW: EPSILON" should be added if the packet were routed through that block of code - and it's not...</div>
<div><br></div><div>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).</div>
<div><br></div>
</div>