<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    <meta content="text/html; charset=ISO-8859-1"
      http-equiv="Content-Type">
    <title></title>
  </head>
  <body text="#000000" bgcolor="#ffffff">
    Hi Bobby,<br>
    <br>
    If you want to match the transaction (and dialog) you should
    explicitly arm an "onreply_route" for the initial INVITE:<br>
    <br>
    <tt>route {<br>
    </tt>
    <blockquote><tt>...<br>
        # here gets the initial INVITE<br>
        create_dialog();<br>
        t_on_reply("2"); # arm the onreply_route[2]<br>
        ...<br>
      </tt></blockquote>
    <tt>}<br>
      <br>
      # fires when a reply is received for the initial INVITE<br>
      onreply_route[2] {<br>
    </tt>
    <blockquote>
      <div><tt>$dlg_val(cisco) = "true";</tt></div>
      <div><tt>set_dlg_flag("3");</tt></div>
      <div><tt>...</tt></div>
    </blockquote>
    <tt>}</tt><br>
    <br>
    Please let us know if you find any problems.<br>
    <br>
    Regards,<br>
    <pre class="moz-signature" cols="72">Razvan Crainea
OpenSIPS Developer</pre>
    <br>
    On 08.08.2011 23:58, Bobby Smith wrote:
    <blockquote
cite="mid:CAJQeEgsvAs3GgiA-iJsBpL8ryfrWZreFSxYcERUtTNb89xJG2A@mail.gmail.com"
      type="cite">Hi Razvan,
      <div><br>
        So in trying to do this from the logs, I think that the dialog
        matching doesn't actually happen until the onreply_route
        processing is finished, so I cant access either the dlg_val or
        the DLG_flags. &nbsp;Log is below.</div>
      <div><br>
      </div>
      <div>I should mention this is from the 1.6.4 branch of opensips
        (not current 1.7).</div>
      <div><br>
      </div>
      <div><br>
        My default route looks like this:</div>
      <div><br>
      </div>
      <div>route {</div>
      <div>&nbsp; &nbsp; &nbsp;create_dialog();</div>
      <div>&nbsp; &nbsp; &nbsp;xlog("[REQUEST $ci] :: create dialog for $rm $ru placed
        in status $DLG_status with return code $rc");</div>
      <div>&nbsp; &nbsp; &nbsp;...</div>
      <div>&nbsp; &nbsp; &nbsp; loose_route();</div>
      <div>&nbsp; &nbsp; &nbsp;&nbsp;xlog("[REQUEST $ci] :: $rm $ru :: PRINT INFORMATION
        ABOUT DIALOG ::: dialog status $DLG_status, dialog flags
        $DLG_flags, dlg_val(cisco) $dlg_val(cisco)");</div>
      <div>&nbsp; &nbsp; &nbsp;...</div>
      <div>}</div>
      <div><br>
      </div>
      <div>and my onreply looks like this:</div>
      <div><br>
      </div>
      <div>onreply_route {</div>
      <div>&nbsp; &nbsp; &nbsp;xlog("[RESPONSE $ci] :: $rs :: PRINTING DIALOG INFO ::
        dialog status $DLG_status, dialog flags $DLG_flags,
        dlg_val(cisco) $dlg_val(cisco)");</div>
      <div>&nbsp; &nbsp; &nbsp;&nbsp;$dlg_val(cisco) = "true";</div>
      <div>&nbsp; &nbsp; &nbsp; set_dlg_flag("3");</div>
      <div>&nbsp; &nbsp; &nbsp;...</div>
      <div>}</div>
      <div><br>
      </div>
      <div>And here's the log statements from this occurring:</div>
      <div><br>
      </div>
      <div>
        <div>%011-08-08T20:39:30.574404+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_msg:
          SIP Reply &nbsp;(status):</div>
        <div>2011-08-08T20:39:30.574478+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_msg:
          &nbsp;version: &lt;SIP/2.0&gt;</div>
        <div>2011-08-08T20:39:30.574498+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_msg:
          &nbsp;status: &nbsp;&lt;200&gt;</div>
        <div>2011-08-08T20:39:30.574513+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_msg:
          &nbsp;reason: &nbsp;&lt;OK&gt;</div>
        <div>2011-08-08T20:39:30.574529+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=2</div>
        <div>2011-08-08T20:39:30.574542+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_to_param: tag=25ac01ebd3e5cd73i3</div>
        <div>2011-08-08T20:39:30.574558+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_to:
          end of header reached, state=29</div>
        <div>2011-08-08T20:39:30.574573+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_to:
          display={}, ruri={<a moz-do-not-send="true"
            href="mailto:sip%3ATEST107751@sip.foo.com">sip:TEST107751@sip.foo.com</a>}</div>
        <div>2011-08-08T20:39:30.574587+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:get_hdr_field: &lt;To&gt; [67]; uri=[<a
            moz-do-not-send="true"
            href="mailto:sip%3ATEST107751@sip.foo.com">sip:TEST107751@sip.foo.com</a>]&nbsp;</div>
        <div>2011-08-08T20:39:30.574600+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:get_hdr_field: to body [&lt;<a moz-do-not-send="true"
            href="mailto:sip%3ATEST107751@sip.foo.com">sip:TEST107751@sip.foo.com</a>&gt;]</div>
        <div>
          2011-08-08T20:39:30.574612+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:get_hdr_field: cseq &lt;CSeq&gt;: &lt;1&gt;
          &lt;INVITE&gt;</div>
        <div>2011-08-08T20:39:30.574629+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_via_param: found param type 232, &lt;branch&gt;
          = &lt;z9hG4bK8d7f.61ce6675.0&gt;; state=16</div>
        <div>2011-08-08T20:39:30.574646+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_via:
          end of header reached, state=5</div>
        <div>2011-08-08T20:39:30.574661+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: via found, flags=2</div>
        <div>2011-08-08T20:39:30.574674+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: this is the first via</div>
        <div>2011-08-08T20:39:30.574688+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:receive_msg: After parse_msg...</div>
        <div>2011-08-08T20:39:30.574705+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: [RESPONSE <a
            moz-do-not-send="true"
            href="mailto:1710098c6f37dc00e42e5d0d210ed870@10.2.1.87">1710098c6f37dc00e42e5d0d210ed870@10.2.1.87</a>]
          :: 200 :: PRINTING DIALOG INFO :: dialog status &lt;null&gt;,
          dialog flags &lt;null&gt;, dlg_val(cisco)&nbsp;</div>
        <div>2011-08-08T20:39:30.574720+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          ERROR:core:do_assign: setting PV failed</div>
        <div>2011-08-08T20:39:30.574734+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          ERROR:core:do_assign: error at line: 678</div>
        <div>2011-08-08T20:39:30.574751+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: [RESPONSE <a
            moz-do-not-send="true"
            href="mailto:1710098c6f37dc00e42e5d0d210ed870@10.2.1.87">1710098c6f37dc00e42e5d0d210ed870@10.2.1.87</a>]
          :: setting dlg_val(cisco) to &nbsp;with DLG_flags = &lt;null&gt;</div>
        <div>2011-08-08T20:39:30.574769+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=ffffffffffffffff</div>
        <div>2011-08-08T20:39:30.574784+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_via_param: found param type 235, &lt;rport&gt;
          = &lt;5060&gt;; state=6</div>
        <div>2011-08-08T20:39:30.574801+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_via_param: found param type 234,
          &lt;received&gt; = &lt;4.2.2.170&gt;; state=6</div>
        <div>2011-08-08T20:39:30.574818+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_via_param: found param type 232, &lt;branch&gt;
          = &lt;z9hG4bK8d7f.78413d97.0&gt;; state=16</div>
        <div>2011-08-08T20:39:30.574833+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_via:
          end of header reached, state=5</div>
        <div>2011-08-08T20:39:30.574847+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: via found, flags=ffffffffffffffff</div>
        <div>2011-08-08T20:39:30.574862+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: parse_headers: this is the second via</div>
        <div>2011-08-08T20:39:30.574876+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_via_param: found param type 232, &lt;branch&gt;
          = &lt;z9hG4bK4360341242842074756251312835968830&gt;; state=16</div>
        <div>2011-08-08T20:39:30.574893+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:core:parse_via:
          end of header reached, state=5</div>
        <div>2011-08-08T20:39:30.574909+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: via found, flags=ffffffffffffffff</div>
        <div>2011-08-08T20:39:30.574923+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:get_hdr_field: content_length=208</div>
        <div>2011-08-08T20:39:30.574936+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:get_hdr_field: found end of header</div>
        <div>2011-08-08T20:39:30.574989+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:check_ip_address: params 192.168.30.194, 4.2.2.171, 0</div>
        <div>2011-08-08T20:39:30.575009+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=ffffffffffffffff</div>
        <div>2011-08-08T20:39:30.575034+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:nathelper:check_content_type: type &lt;application/sdp&gt;
          found valid</div>
        <div>2011-08-08T20:39:30.575071+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:forward_reply: found module tm, passing reply to it</div>
        <div>2011-08-08T20:39:30.575088+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:tm:t_check:
          start=0xffffffffffffffff</div>
        <div>2011-08-08T20:39:30.575105+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=22</div>
        <div>2011-08-08T20:39:30.575132+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=8</div>
        <div>2011-08-08T20:39:30.575149+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:t_reply_matching: hash 63448 label 1466362902 branch 0</div>
        <div>2011-08-08T20:39:30.575172+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:t_reply_matching: REF_UNSAFE: after is 1</div>
        <div>2011-08-08T20:39:30.575190+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:t_reply_matching: reply matched (T=0x2b6e1e77db78)!</div>
        <div>2011-08-08T20:39:30.575217+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=8</div>
        <div>2011-08-08T20:39:30.575232+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:tm:t_check:
          end=0x2b6e1e77db78</div>
        <div>2011-08-08T20:39:30.575250+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:reply_received: org. status uas=180, uac[0]=180 local=0
          is_invite=1)</div>
        <div>2011-08-08T20:39:30.575273+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:t_should_relay_response: T_code=180, new_code=200</div>
        <div>2011-08-08T20:39:30.575296+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:tm:relay_reply:
          branch=0, save=0, relay=0</div>
        <div>2011-08-08T20:39:30.575311+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:run_trans_callbacks: trans=0x2b6e1e77db78, callback
          type 16, id 0 entered</div>
        <div>2011-08-08T20:39:30.575334+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:dialog:push_reply_in_dialog: 0x2b6e1e77ced0 totag in rpl
          is &lt;25ac01ebd3e5cd73i3&gt; (18)</div>
        <div>2011-08-08T20:39:30.575350+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:dialog:push_reply_in_dialog: branch with tag
          &lt;25ac01ebd3e5cd73i3&gt; already exists</div>
        <div>2011-08-08T20:39:30.575374+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:parse_headers: flags=ffffffffffffffff</div>
        <div>2011-08-08T20:39:30.575397+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:print_rr_body: current rr is
          <a class="moz-txt-link-rfc2396E" href="sip:4.2.2.171;lr=on;nat=yes;did=1a7.ed2a0657">&lt;sip:4.2.2.171;lr=on;nat=yes;did=1a7.ed2a0657&gt;</a></div>
        <div>2011-08-08T20:39:30.575420+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:print_rr_body: current rr is
          <a class="moz-txt-link-rfc2396E" href="sip:4.2.2.170;r2=on;lr=on;did=1a7.719de5a3">&lt;sip:4.2.2.170;r2=on;lr=on;did=1a7.719de5a3&gt;</a></div>
        <div>2011-08-08T20:39:30.575443+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:print_rr_body: current rr is
          <a class="moz-txt-link-rfc2396E" href="sip:172.16.30.170;r2=on;lr=on;did=1a7.719de5a3">&lt;sip:172.16.30.170;r2=on;lr=on;did=1a7.719de5a3&gt;</a></div>
        <div>2011-08-08T20:39:30.575459+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:print_rr_body: skipping 3 route records</div>
        <div>2011-08-08T20:39:30.575474+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:print_rr_body: out rr []</div>
        <div>2011-08-08T20:39:30.575501+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:print_rr_body: we have 3 records</div>
        <div>2011-08-08T20:39:30.575524+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:dialog:dlg_update_routing: dialog 0x2b6e1e77ced0[1]:
          rr=&lt;&gt; contact=&lt;<a moz-do-not-send="true"
            href="http://sip:TEST107751@192.168.30.194:5063">sip:TEST107751@192.168.30.194:5063</a>&gt;</div>
        <div>2011-08-08T20:39:30.575557+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:build_res_buf_from_sip_res: &nbsp;old size: 1096, new
          size: 1033</div>
        <div>2011-08-08T20:39:30.575611+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:core:build_res_buf_from_sip_res: copied size: orig:717,
          new: 654, rest: 379 msg=#012SIP/2.0 200 OK#015#012To: &lt;<a
            moz-do-not-send="true"
            href="mailto:sip%3ATEST107751@sip.foo.com">sip:TEST107751@sip.foo.com</a>&gt;;tag=25ac01ebd3e5cd73i3#015#012From:
          "Bobby Smith" &lt;<a moz-do-not-send="true"
            href="mailto:sip%3A507@10.2.1.87">sip:507@10.2.1.87</a>&gt;;tag=6174017421312835968828#015#012Call-ID:
          <a moz-do-not-send="true"
            href="http://1710098c6f37dc00e42e5d0d210ed870@10.2.1.87#015#012CSeq">1710098c6f37dc00e42e5d0d210ed870@10.2.1.87#015#012CSeq</a>:
          1 INVITE#015#012Via: SIP/2.0/UDP
          4.2.2.170;rport=5060;received=4.2.2.170;branch=z9hG4bK8d7f.78413d97.0#015#012Via:
          SIP/2.0/UDP
          10.2.1.87:5060;branch=z9hG4bK4360341242842074756251312835968830#015#012Record-Route:
          <a class="moz-txt-link-rfc2396E" href="sip:4.2.2.171;lr=on;nat=yes;did=1a7.ed2a0657">&lt;sip:4.2.2.171;lr=on;nat=yes;did=1a7.ed2a0657&gt;</a>#015#012Record-Route:
          <a class="moz-txt-link-rfc2396E" href="sip:4.2.2.170;r2=on;lr=on;did=1a7.719de5a3">&lt;sip:4.2.2.170;r2=on;lr=on;did=1a7.719de5a3&gt;</a>#015#012Record-Route:
          <a class="moz-txt-link-rfc2396E" href="sip:172.16.30.170;r2=on;lr=on;did=1a7.719de5a3">&lt;sip:172.16.30.170;r2=on;lr=on;did=1a7.719de5a3&gt;</a>#015#012Contact:
          "Extension" &lt;<a moz-do-not-send="true"
            href="http://sip:TEST107751@192.168.30.194:5063">sip:TEST107751@192.168.30.194:5063</a>&gt;#015#012Server:
          Linksys/SPA942-5.2.8#015#012Content-Length: 208#015#012Allow:
          ACK, BYE, CANCEL, INFO, INVITE, NOTIFY, OPTIONS,
          REFER#015#012Supported: replaces#015#012Content-Type:
          application/sdp#015#012#015#012v=0#015#012o=- 11235 11235 IN
          IP4 192.168.30.194#015#012s=-#015#012c=IN IP4
          192.168.30.194#015#012t=0 0#015#012m=audio 16466 RTP/AVP 0
          101#015#012a=rtpmap:0 PCMU/8000#015#012a=rtpmap:101
          telephone-event/8000#015#012a=fmtp:101
          0-15#015#012a=ptime:30#015#012a=sendrecv#015#012</div>
        <div>2011-08-08T20:39:30.575655+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:update_totag_set: new totag&nbsp;</div>
        <div>2011-08-08T20:39:30.575669+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:insert_timer_unsafe: [2]: 0x2b6e1e77dbf8 (136)</div>
        <div>2011-08-08T20:39:30.575687+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:tm:run_trans_callbacks: trans=0x2b6e1e77db78, callback
          type 128, id 0 entered</div>
        <div>2011-08-08T20:39:30.575702+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:dialog:next_state_dlg: dialog 0x2b6e1e77ced0 changed from
          state 2 to state 3, due event 3</div>
        <div>2011-08-08T20:39:30.575717+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:dialog:dlg_onreply: dialog 0x2b6e1e77ced0 confirmed</div>
        <div>2011-08-08T20:39:30.575741+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]:
          DBG:dialog:insert_dlg_timer_unsafe: inserting 0x2b6e1e77cf08
          for 43331</div>
        <div>2011-08-08T20:39:30.575757+00:00 atlsvsreg02
          /usr/local/opensips/sbin/opensips[28194]: DBG:dialog:ref_dlg:
          ref dlg 0x2b6e1e77ced0 with 1 -&gt; 3</div>
      </div>
      <div><br>
        <br>
        <div class="gmail_quote">On Fri, Aug 5, 2011 at 3:53 AM, Razvan
          Crainea <span dir="ltr">&lt;<a moz-do-not-send="true"
              href="mailto:razvancrainea@opensips.org">razvancrainea@opensips.org</a>&gt;</span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt
            0.8ex; border-left: 1px solid rgb(204, 204, 204);
            padding-left: 1ex;">
            <div text="#000000" bgcolor="#ffffff"> Hi Bobby,<br>
              <br>
              The $DLG_flags or a $dlg_var(name) are the pseudo
              variables that should help you. In order to use them, you
              must use create_dialog() [1] for the Initial INVITE.<br>
              In the sequential requests, you should read the values
              only after loose_route() [2] is called, because there's
              where the dialog is matched.<br>
              Please try again and let us know your results.<br>
              <br>
              [1] <a moz-do-not-send="true"
href="http://www.opensips.org/html/docs/modules/devel/dialog.html#id293854"
                target="_blank">http://www.opensips.org/html/docs/modules/devel/dialog.html#id293854</a><br>
              [2] <a moz-do-not-send="true"
href="http://www.opensips.org/html/docs/modules/devel/rr.html#loose-route-id"
                target="_blank">http://www.opensips.org/html/docs/modules/devel/rr.html#loose-route-id</a><br>
              <br>
              Regards,<br>
              <font color="#888888">
                <pre cols="72">Razvan Crainea
OpenSIPS Developer</pre>
              </font>
              <div>
                <div class="h5"> <br>
                  On 05.08.2011 07:14, Bobby Smith wrote:
                  <blockquote type="cite">Thanks for the suggestion --
                    unfortunately I saw this previously in a thread and
                    thought that'd be the key, but the results from
                    cranking debug up the same show it to be a different
                    transaction on receiving the ACK and thus the value
                    is null. :(
                    <div> <br>
                    </div>
                    <div>I've played around with this just a little bit
                      more and by modifying the localcache key to be
                      $fU_$ci (from user / callid pair, or some tag, or
                      something related to the initial request that's
                      available in the script context) I can get it to
                      work how I want, but this really just doesn't seem
                      like the right way to do it.</div>
                    <div><br>
                    </div>
                    <div><br>
                      <div class="gmail_quote">On Fri, Aug 5, 2011 at
                        12:08 AM, Brett Nemeroff <span dir="ltr">&lt;<a
                            moz-do-not-send="true"
                            href="mailto:brett@nemeroff.com"
                            target="_blank">brett@nemeroff.com</a>&gt;</span>
                        wrote:<br>
                        <blockquote class="gmail_quote" style="margin:
                          0pt 0pt 0pt 0.8ex; border-left: 1px solid
                          rgb(204, 204, 204); padding-left: 1ex;">
                          <div bgcolor="#FFFFFF">
                            <div>See if setting this param on helps.</div>
                            <div><br>
                              <a moz-do-not-send="true"
                                href="http://www.opensips.org/html/docs/modules/devel/tm.html#id293118"
                                target="_blank">http://www.opensips.org/html/docs/modules/devel/tm.html#id293118</a><br>
                              -Brett</div>
                            <div>
                              <div>
                                <div><br>
                                  On Aug 4, 2011, at 7:48 PM, Bobby
                                  Smith &lt;<a moz-do-not-send="true"
                                    href="mailto:bobby.smith@gmail.com"
                                    target="_blank">bobby.smith@gmail.com</a>&gt;

                                  wrote:<br>
                                  <br>
                                </div>
                                <blockquote type="cite">
                                  <div>All,
                                    <div><br>
                                      Here's why I'm trying to
                                      accomplish:</div>
                                    <div><br>
                                    </div>
                                    <div>route [subsequent_request] {</div>
                                    <div>&nbsp; &nbsp;if (has_totag &amp;&amp;
                                      is_method("ACK") {</div>
                                    <div>&nbsp; &nbsp; &nbsp;if (MY_VAR = "cisco") {</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; lookup("location");</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; ... relay and exit</div>
                                    <div>&nbsp; &nbsp; &nbsp;}</div>
                                    <div>&nbsp; &nbsp; &nbsp;else {</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ... relay and exit lr</div>
                                    <div>&nbsp; &nbsp; &nbsp;}</div>
                                    <div>&nbsp; &nbsp;}</div>
                                    <div>}</div>
                                    <div><br>
                                    </div>
                                    <div>onreply_route [foo] {</div>
                                    <div>&nbsp; &nbsp; &nbsp;....</div>
                                    <div>&nbsp; &nbsp; &nbsp;if($ua =~ "Cisco-CP79") {</div>
                                    <div>&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; MY_VAR = "cisco"</div>
                                    <div>&nbsp; &nbsp; &nbsp;}</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] &nbsp;</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 moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-importance.html" name="13198eefe180e94f_1319820bcee901dd_d4e475468" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">importance</a> of
      delivering all 200 (OK) responses to an <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-invite.html" name="13198eefe180e94f_1319820bcee901dd_d4e475473" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">INVITE</a> to the <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="13198eefe180e94f_1319820bcee901dd_d4e475476" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">UAC</a>.  To
      deliver them all to the <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="13198eefe180e94f_1319820bcee901dd_d4e475481" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">UAC</a>, the <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uas.html" name="13198eefe180e94f_1319820bcee901dd_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 moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="13198eefe180e94f_1319820bcee901dd_d4e475492" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">UAC</a> alone
      takes responsibility for acknowledging them with <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-ack.html" name="13198eefe180e94f_1319820bcee901dd_d4e475497" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">ACK</a> (see Section
      13.2.2.4).  Since this <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-ack.html" name="13198eefe180e94f_1319820bcee901dd_d4e475503" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">ACK</a> is retransmitted only by the <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-uac.html" name="13198eefe180e94f_1319820bcee901dd_d4e475506" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">UAC</a>, it is
      effectively considered its own <a moz-do-not-send="true" href="http://rfc-ref.org/RFC-TEXTS/3261/kw-transaction.html" name="13198eefe180e94f_1319820bcee901dd_d4e475511" style="font-family: tahoma,verdana,sans-serif; font-weight: normal;" target="_blank">transaction</a>.
</pre>
                                      </span>
                                      <div style="font-size: medium;
                                        font-family: 'Times New Roman';"><br>
                                      </div>
                                      <div style="font-size: medium;
                                        font-family: 'Times New Roman';"><br>
                                      </div>
                                      <div style="font-family: 'Times
                                        New Roman';"> Is there a way to
                                        get this associated with the
                                        right dialog or something? &nbsp;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>
                                      <span style="font-family: 'Times
                                        New Roman';"> </span>
                                      <div style="font-family: 'Times
                                        New Roman';"><br>
                                      </div>
                                      <div style="font-family: 'Times
                                        New Roman';"><br>
                                        Thanks for the ideas,</div>
                                      <div style="font-family: 'Times
                                        New Roman';"><br>
                                        BobbyS</div>
                                    </div>
                                  </div>
                                </blockquote>
                              </div>
                            </div>
                            <blockquote type="cite">
                              <div><span>_______________________________________________</span><br>
                                <span>Users mailing list</span><br>
                                <span><a moz-do-not-send="true"
                                    href="mailto:Users@lists.opensips.org"
                                    target="_blank">Users@lists.opensips.org</a></span><br>
                                <span><a moz-do-not-send="true"
                                    href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                                    target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a></span><br>
                              </div>
                            </blockquote>
                          </div>
                          <br>
_______________________________________________<br>
                          Users mailing list<br>
                          <a moz-do-not-send="true"
                            href="mailto:Users@lists.opensips.org"
                            target="_blank">Users@lists.opensips.org</a><br>
                          <a moz-do-not-send="true"
                            href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
                            target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
                          <br>
                        </blockquote>
                      </div>
                      <br>
                    </div>
                    <pre><fieldset></fieldset>
_______________________________________________
Users mailing list
<a moz-do-not-send="true" href="mailto:Users@lists.opensips.org" target="_blank">Users@lists.opensips.org</a>
<a moz-do-not-send="true" href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a>
</pre>
                  </blockquote>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Users mailing list<br>
            <a moz-do-not-send="true"
              href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
            <a moz-do-not-send="true"
              href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users"
              target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
  </body>
</html>