<br><br><div class="gmail_quote">On Tue, Mar 16, 2010 at 10:20 AM, Bogdan-Andrei Iancu <span dir="ltr"><<a href="mailto:bogdan@voice-system.ro">bogdan@voice-system.ro</a>></span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Hi Jock,<br>
<br>
The ds_select_domain() function expects to receive (as set id) and<br>
integer value (directly or via a pv).<br>
<br>
In your case $var(beep) contains a string and not a number. Try:<br>
$var(beep) = $(ru{s.substr,27,4}{<a href="http://s.int" target="_blank">s.int</a>});<br>
<br>
to force the value as number.<br>
<div><div class="h5"><br></div></div></blockquote><div><br>Ah!!<br><br>And it works like a charm, fantastic, thank you, Bogdan.<br><br> - JP<br> </div><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
<div><div class="h5">
Jock McKechnie wrote:<br>
> Good morning;<br>
><br>
> I've been fiddling with dispatcher and I would like to maintain<br>
> several dispatcher sets that get selected based on the $ru. The $ru<br>
> would be parsed, a dispatcher set placed in a variable, and then<br>
> ds_select_domain() would be called upon the variable... except<br>
> ds_select_domain() doesn't appear to work with being called using<br>
> variables... or perhaps I'm doing something wrong.<br>
><br>
> The $ru would look something like this: "+12125551212@dispatcher1001",<br>
> which I'm using the following directives to handle:<br>
><br>
> if ($ru =~ "dispatcher") {<br>
> $var(beep) = $(ru{s.substr,27,4});<br>
><br>
> xlog("L_INFO", "[$Tf] Found dispatcher, set: $var(beep)\n");<br>
><br>
> if (!ds_select_domain("$var(beep)","4")) {<br>
> t_reply("503", "Unable to location dispatcher set requested");<br>
> return;<br>
> }<br>
><br>
> route(1);<br>
> return;<br>
> }<br>
><br>
> The $var(beep) is being parsed out correctly (The xlog() messages show<br>
> as such), but get the following:<br>
> ERROR:core:fixup_get_ivalue: no valid PV value found (error in scripts)<br>
> ERROR:dispatcher:w_ds_select_domain: no dst set value<br>
> ERROR:tm:w_t_reply: failed to send a t_reply to a message for which no<br>
> transaction-state has been established<br>
><br>
> I suspect the important one in the list above is the first, where the<br>
> get_ivalue is failing, but I'm not sure. I suspect if it can tell it's<br>
> a variable then I probably am doing something amiss, but I sure would<br>
> appreciate if some learned soul could tell me what I'm doing wrong.<br>
><br>
> My thanks;<br>
><br>
> - Jock<br>
</div></div>> ------------------------------------------------------------------------<br>
><br>
> _______________________________________________<br>
> Users mailing list<br>
> <a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
> <a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
><br>
<br>
<br>
--<br>
Bogdan-Andrei Iancu<br>
<a href="http://www.voice-system.ro" target="_blank">www.voice-system.ro</a><br>
<br>
<br>
_______________________________________________<br>
Users mailing list<br>
<a href="mailto:Users@lists.opensips.org">Users@lists.opensips.org</a><br>
<a href="http://lists.opensips.org/cgi-bin/mailman/listinfo/users" target="_blank">http://lists.opensips.org/cgi-bin/mailman/listinfo/users</a><br>
</blockquote></div><br>