[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openser-users
Subject:    [SR-Users] Adding "q" value for the main branch
From:       Maxim M <simax80 () gmail ! com>
Date:       2019-11-28 14:14:53
Message-ID: CAF4tRoV40aODtKzKjQhztKzJjLUmaLz8dZ0-cmR7guLzb2HUZg () mail ! gmail ! com
[Download RAW message or body]

[Attachment #2 (multipart/alternative)]


Maxim Malygin <maxim.malygin@gmail.com>
17:08 (5 минут назад)
кому: sr-users
Hello,

I need to form list of Contact headers with "q" parameters for "302 Moved
Temporary".

I do something like this:

...
# $xavp(contacts) - contains list of contact URIs (uri) and Q values (q)
$var(i) = 0;
$var(num) = $cnt($xavp(contacts));
while($var(i) < $var(num)) {
    if($var(i) == 0) {
        # How to add q value to this branch?
        $ru = $xavp(contacts[$var(i)]=>uri);
    } else {
        append_branch("$xavp(contacts[$var(i)]=>uri)",
"$xavp(contacts[$var(i)]=>q)");
    }
}
send_reply("302", "Moved Temporarily");
...

Is it possible to set "q" value for the main branch?
For additional branches I do it via append_branch("uri", q_value) but I
didn't find any way to do it for the main branch pointed via $ru/$du. The
pseudo-variable "$branch" also doesn't allow me to access the main branch.

Thanks,
Maxim

[Attachment #5 (text/html)]

<div dir="ltr"><div class="gmail-gE gmail-iv gmail-gt" style="padding:20px 0px \
0px;font-size:0.875rem;font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif"><br \
class="gmail-Apple-interchange-newline"><table cellpadding="0" class="gmail-cf \
gmail-gJ" style="border-collapse:collapse;margin-top:0px;width:auto;font-size:0.875rem;letter-spacing:0.2px;display:block"><tbody \
style="display:block"><tr class="gmail-acZ" style="height:auto;display:flex"><td \
class="gmail-gF gmail-gK" \
style="white-space:nowrap;padding:0px;vertical-align:top;width:806.406px;line-height:20px;display:block;max-height:20px"><table \
cellpadding="0" class="gmail-cf gmail-ix" \
style="border-collapse:collapse;table-layout:fixed;width:806px"><tbody><tr><td \
class="gmail-c2" style="display:flex"><h3 class="gmail-iw" \
style="overflow:hidden;font-size:0.75rem;font-weight:inherit;margin:inherit;text-overflow:ellipsis;letter-spacing:0.3px;color:rgb(95,99,104);line-height:20px"><span \
class="gmail-qu" tabindex="-1"><span name="Maxim Malygin" class="gmail-gD" \
style="color:rgb(32,33,36);font-size:0.875rem;font-weight:bold;display:inline;vertical-align:top;letter-spacing:0.2px;line-height:20px">Maxim \
Malygin</span>  <span class="gmail-go" \
style="vertical-align:top;color:rgb(85,85,85)">&lt;<a \
href="mailto:maxim.malygin@gmail.com">maxim.malygin@gmail.com</a>&gt;</span></span></h3></td></tr></tbody></table></td><td \
class="gmail-gH gmail-bAk" \
style="text-align:right;white-space:nowrap;vertical-align:top;display:block;max-height:20px"><div \
class="gmail-gK" style="padding:0px;display:flex"><span id="gmail-:16e" \
class="gmail-g3" title="28 нояб. 2019 г., 17:08" alt="28 нояб. 2019 г., \
17:08" tabindex="-1" \
style="vertical-align:top;margin:0px;font-size:0.75rem;letter-spacing:0.3px;color:rgb(95,99,104);display:block;line-height:20px">17:08 \
(5 минут назад)</span><div class="gmail-zd gmail-bi4" title="Не \
помечено" tabindex="0" \
style="display:inline-block;height:20px;margin-left:20px;outline:0px"><span \
class="gmail-T-KT" style="display:inline-flex;height:20px;text-align:center;width:20px;padding:0px;margin:0px;border:none;outline:none"></span></div></div></td><td \
class="gmail-gH" style="text-align:right;white-space:nowrap;vertical-align:top;display:flex"></td><td \
class="gmail-gH gmail-acX gmail-bAm" rowspan="2" \
style="text-align:right;white-space:nowrap;vertical-align:top;display:block;max-height:20px"><div \
class="gmail-T-I gmail-J-J5-Ji gmail-T-I-Js-IF gmail-aaq gmail-T-I-ax7 gmail-L3" \
tabindex="0" style="display:inline-flex;border-radius:2px 0px 0px \
2px;font-size:0.875rem;text-align:center;margin:0px 0px 0px \
20px;height:20px;line-height:18px;min-width:0px;outline:none;padding:0px;background:transparent;color:rgb(68,68,68);border:none"><img \
class="gmail-hB gmail-T-I-J3" \
src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" style="background: \
url(&quot;https://www.gstatic.com/images/icons/material/system/1x/reply_black_20dp.png&quot;) \
50% 50% / 20px no-repeat; height: 20px; margin: 0px; vertical-align: middle; width: \
20px; opacity: 0.54; display: inline-block; padding: 0px; transition: opacity 0.15s \
cubic-bezier(0.4, 0, 0.2, 1) 0s;"></div><div id="gmail-:15h" class="gmail-T-I \
gmail-J-J5-Ji gmail-T-I-Js-Gs gmail-aap gmail-T-I-awG gmail-T-I-ax7 gmail-L3" \
tabindex="0" style="display:inline-flex;border-radius:0px 2px 2px \
0px;font-size:0.875rem;text-align:center;margin:0px 0px 0px \
20px;height:20px;line-height:18px;min-width:0px;outline:none;padding:0px;background:transparent;color:rgb(68,68,68);border:none"><img \
class="gmail-hA gmail-T-I-J3" \
src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" style="background: \
url(&quot;https://www.gstatic.com/images/icons/material/system/1x/more_vert_black_20dp.png&quot;) \
50% 50% / 20px no-repeat; height: 20px; width: 20px; margin: 0px; vertical-align: \
middle; opacity: 0.54; display: inline-block; padding: 0px; transition: opacity 0.15s \
cubic-bezier(0.4, 0, 0.2, 1) 0s;"></div></td></tr><tr class="gmail-acZ gmail-xD" \
style="height:auto;display:flex"><td colspan="3"><table cellpadding="0" \
class="gmail-cf gmail-adz" \
style="border-collapse:collapse;table-layout:fixed;white-space:nowrap;width:1054px"><tbody><tr><td \
class="gmail-ady" style="overflow:visible;text-overflow:ellipsis;display:flex;line-height:20px"><div \
class="gmail-iw gmail-ajw" \
style="overflow:hidden;max-width:92%;display:inline-block"><span class="gmail-hb" \
style="vertical-align:top;color:rgb(95,99,104);font-size:0.75rem;letter-spacing:0.3px;line-height:20px">кому: \
<span dir="ltr" name="sr-users" class="gmail-g2" \
style="vertical-align:top">sr-users</span></span></div><div id="gmail-:15g" \
class="gmail-ajy" tabindex="0" \
style="display:inline-flex;margin-left:4px;vertical-align:top;border:none;outline:none"><img \
class="gmail-ajz" src="https://mail.google.com/mail/u/0/images/cleardot.gif" alt="" \
style="background: url(&quot;https://www.gstatic.com/images/icons/material/system/1x/arrow_drop_down_black_20dp.png&quot;) \
50% 50% / 20px no-repeat; cursor: pointer; padding: 0px; vertical-align: baseline; \
height: 20px; width: 20px; border: none; margin: 0px 0px 0px auto; right: 0px; top: \
0px; display: flex; opacity: \
0.54;"></div></td></tr></tbody></table></td></tr></tbody></table></div><div \
id="gmail-:3zg" style="font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div \
class="gmail-qQVYZb"></div><div class="gmail-utdU2e"></div><div \
class="gmail-btm"></div></div><div class="gmail-" \
style="font-family:Roboto,RobotoDraft,Helvetica,Arial,sans-serif;font-size:medium"><div \
class="gmail-aHl" style=""></div><div id="gmail-:15f" tabindex="-1"></div><div \
id="gmail-:16y" class="gmail-ii gmail-gt" \
style="font-size:0.875rem;direction:ltr;margin:8px 0px 0px;padding:0px"><div \
id="gmail-:16x" class="gmail-a3s gmail-aXjCH" \
style="overflow:hidden;font-variant-numeric:normal;font-variant-east-asian:normal;font \
-stretch:normal;font-size:small;line-height:1.5;font-family:Arial,Helvetica,sans-serif"><div \
dir="ltr">Hello,<div><br></div><div>I need to form list of Contact headers with \
&quot;q&quot; parameters for &quot;302 Moved \
Temporary&quot;.</div><div><br></div><div>I do something like \
this:</div><div><br></div><div>...</div><div># $xavp(contacts) - contains list of \
contact URIs (uri) and Q values (q)</div><div>$var(i) = 0;</div><div>$var(num) = \
$cnt($xavp(contacts));</div><div>while($var(i) &lt; $var(num)) {</div><div>      \
if($var(i) == 0) {</div><div>            # How to add q value to this \
branch?</div><div>            $ru = $xavp(contacts[$var(i)]=&gt;uri);</div><div>      \
} else {</div><div>            \
append_branch(&quot;$xavp(contacts[$var(i)]=&gt;uri)&quot;, \
&quot;$xavp(contacts[$var(i)]=&gt;q)&quot;);</div><div>      \
}</div><div>}<br></div><div><div>send_reply(&quot;302&quot;, &quot;Moved \
Temporarily&quot;);</div><div></div></div><div>...</div><div><br></div><div>Is it \
possible to set &quot;q&quot; value for the main branch?</div><div>For additional \
branches I do it via append_branch(&quot;uri&quot;, q_value) but I didn&#39;t find \
any way to do it for the main branch pointed via $ru/$du. The pseudo-variable \
&quot;$branch&quot; also doesn&#39;t allow me to access the main \
branch.</div><div><br></div><div>Thanks,</div><div>Maxim</div></div></div></div></div></div>



[Attachment #6 (text/plain)]

_______________________________________________
Kamailio (SER) - Users Mailing List
sr-users@lists.kamailio.org
https://lists.kamailio.org/cgi-bin/mailman/listinfo/sr-users


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic