Sorry, there were a couple of typos in that:<div><br></div><div><span class="Apple-style-span" style="color: rgb(51, 51, 51); font-family: arial, sans-serif; font-size: 13px; background-color: rgb(255, 255, 255); "> if (MY_VAR = "cisco") { >>></span></div>
<div><font class="Apple-style-span" color="#333333" face="arial, sans-serif"><<< if (MY_VAR =~/== "cisco")</font></div><div><font class="Apple-style-span" color="#333333" face="arial, sans-serif"><br></font></div>
<div><font class="Apple-style-span" color="#333333" face="arial, sans-serif">and assume onreply_route[foo] has a trigger armed (or is the default onreply route).</font></div><div><font class="Apple-style-span" color="#333333" face="arial, sans-serif"><br>
</font></div><div><font class="Apple-style-span" color="#333333" face="arial, sans-serif">I will post the context of my routing script if necessary but I really think this is just a fundamental understanding problem that I don't quite get how these mechanisms work.</font></div>
<div><font class="Apple-style-span" color="#333333" face="arial, sans-serif"><br>Thanks,<br>BobbyS</font></div><div><font class="Apple-style-span" color="#333333" face="arial, sans-serif"><br></font></div><div><div class="gmail_quote">
On Thu, Aug 4, 2011 at 8:48 PM, Bobby Smith <span dir="ltr"><<a href="mailto:bobby.smith@gmail.com">bobby.smith@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
All,<div><br>Here's why I'm trying to accomplish:</div><div><br></div><div>route [subsequent_request] {</div><div> if (has_totag && is_method("ACK") {</div><div> if (MY_VAR = "cisco") {</div>
<div> lookup("location");</div><div> ... relay and exit</div><div> }</div><div> else {</div><div> ... relay and exit lr</div><div> }</div><div> }</div><div>}</div><div><br></div>
<div>onreply_route [foo] {</div><div> ....</div><div> if($ua =~ "Cisco-CP79") {</div><div> MY_VAR = "cisco"</div><div> }</div><div>}</div><div><br></div><div>The reasons are not really relevant (it's to get rid of a really poor UA implementation on older Cisco 79XX firmwares), but my intent is:</div>
<div><br></div><div>1) Set a transaction-visible-only value in onreply_route [foo] </div><div>2) Retrieve it on the ACK that completes the initial invite transaction.</div><div><br>My problems:</div><div><br></div><div>
1) if MY_VAR is an $avp, it returns null on retrieving it in the route[subsequent_request], even with the onreply flag for tm set.</div>
<div>2) if MY_VAR is a $var, it's process global and so, the next transaction that comes in could share the same state (race)</div><div>3) if MY_VAR is a flag, I can't retrieve it in the route [subsequent request]</div>
<div>4) if MY_VAR is a dlg_flag or a dlg_var, I can't retrieve it in the subsequent request even if invoking create_dialog as the first action in the routing script (if it's an initial invite).</div><div>5) The only thing I've been able to do is create a unique key via localcache (with $fU_useragent = myvalue) and fetch it, but this does not allow multiple UA's to register with the same fU</div>
<div><br></div><div>My question is, is there any way to set a transaction state only value in an onreply hook, and retrieve it on the ACK?<br><br>I know according to the RFC:</div><div><br></div><div><span style="font-family:'Times New Roman'"><pre style="font-size:medium">
The reason for this separation is rooted in the <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-importance.html" name="131976980ebb0403_d4e475468" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">importance</a> of
delivering all 200 (OK) responses to an <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-invite.html" name="131976980ebb0403_d4e475473" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">INVITE</a> to the <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="131976980ebb0403_d4e475476" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">UAC</a>. To
deliver them all to the <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="131976980ebb0403_d4e475481" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">UAC</a>, the <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uas.html" name="131976980ebb0403_d4e475485" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">UAS</a> alone takes responsibility
for retransmitting them (see Section 13.3.1.4), and the <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="131976980ebb0403_d4e475492" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">UAC</a> alone
takes responsibility for acknowledging them with <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-ack.html" name="131976980ebb0403_d4e475497" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">ACK</a> (see Section
13.2.2.4). Since this <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-ack.html" name="131976980ebb0403_d4e475503" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">ACK</a> is retransmitted only by the <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="131976980ebb0403_d4e475506" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">UAC</a>, it is
effectively considered its own <a href="http://rfc-ref.org/RFC-TEXTS/3261/kw-transaction.html" name="131976980ebb0403_d4e475511" style="font-family:tahoma, verdana, sans-serif;font-weight:normal" target="_blank">transaction</a>.
</pre><div style="font-size:medium"><br></div><div style="font-size:medium"><br></div><div>Is there a way to get this associated with the right dialog or something? I've tried setting a dialog profile on initial invite, storing a value in the 200 OK onreply, and retrieving it as well in the ACK, but I get no dialog has been created (I guess because the dialog is early or something).</div>
<div><br></div><div><br>Thanks for the ideas,</div><div><br>BobbyS</div></span></div>
</blockquote></div><br></div>