<div dir="ltr"><div>I was running version 1.9 and just upgraded to 1.11.2. I was having my issue on 1.9 and thought a newer version might fix my issue but it is still occuring.</div><div><br></div>I am using dlg_val to keep up with parked calls on Asterisk so that if someone needs to retrieve a parked call the caller is relayed to the correct Asterisk server that actually has the parked call. For some reason if someone first tries to retrieve a parked call it I see an error of "no value in right expression" but if I call back a second time the call is retrieved. I am not sure why the dlg_val would not have a value the first time but the second time it all of a sudden has been populated. Here is the syslog with xlog data and then I will show my script.<div>
<br></div><div><br></div><div><br></div><div><div>Caller = 9014XX6XX8</div><div>Callee<span class="" style="white-space:pre">        </span>(Person parking call) = 9018X19XX4</div><div>Call Park Initiate Number = *700</div><div>
Call Parked Number = *701</div><div>New Caller Picking up call = 9018X19XX0</div><div><br></div><div><br></div><div>Caller Calls Callee</div><div>Aug 18 20:03:58 SIPProxy02 /usr/local/sbin/opensips[26074]: Dialog Before: td [50.57.54.156], rU [9018X19XX4] fU [19014XX6XX8] HostVar [<null>]</div>
<div>Aug 18 20:03:58 SIPProxy02 /usr/local/sbin/opensips[26074]: About to Route to Asterisk the From User Display name is the following fn [<null>] </div><div>Aug 18 20:03:58 SIPProxy02 /usr/local/sbin/opensips[26074]: ToAsterisk Route Before PSTN call IF check fU[19014XX6XX8] tU[9018X19XX4]</div>
<div><br></div><div>Callee is parking call</div><div>Aug 18 20:04:13 SIPProxy02 /usr/local/sbin/opensips[26077]: The Caller is a Local customer fu - [<a href="mailto:sip%3A9018X19XX4@launchyc.com">sip:9018X19XX4@launchyc.com</a>]</div>
<div>Aug 18 20:04:13 SIPProxy02 /usr/local/sbin/opensips[26077]: Dialog Before: td [<a href="http://launchyc.com">launchyc.com</a>], rU [*700] fU [9018X19XX4] HostVar [<null>]</div><div>Aug 18 20:04:13 SIPProxy02 /usr/local/sbin/opensips[26077]: Dialog 2: 9018X19XX4 has another ongoing, on host sip:108.X.X.17</div>
<div>Aug 18 20:04:13 SIPProxy02 /usr/local/sbin/opensips[26077]: ToAsterisk Route Before PSTN call IF check fU[9018X19XX4] tU[*700]</div><div><br></div><div><br></div><div>New Caller trying to pick up call at *701 and it fails</div>
<div>Aug 18 20:04:40 SIPProxy02 /usr/local/sbin/opensips[26076]: The Caller is a Local customer fu - [<a href="mailto:sip%3A9018X19XX0@launchyc.com">sip:9018X19XX0@launchyc.com</a>]</div><div>Aug 18 20:04:40 SIPProxy02 /usr/local/sbin/opensips[26076]: Dialog Before: td [<a href="http://launchyc.com">launchyc.com</a>], rU [*701] fU [9018X19XX0] HostVar [<null>]</div>
<div>Aug 18 20:04:40 SIPProxy02 /usr/local/sbin/opensips[26076]: Dialog 3: 9018X19XX0 Retrieving Parked Call on host <null></div><div>Aug 18 20:04:40 SIPProxy02 /usr/local/sbin/opensips[26076]: ERROR:core:eval_elem: invalid string operands</div>
<div>Aug 18 20:04:40 SIPProxy02 /usr/local/sbin/opensips[26076]: WARNING:core:do_assign: no value in right expression on line 2159</div><div>Aug 18 20:04:40 SIPProxy02 /usr/local/sbin/opensips[26076]: ToAsterisk Route Before PSTN call IF check fU[9018X19XX0] tU[*701]</div>
<div><br></div><div>Second time trying to pick up parked call and everything works as it should</div><div>Aug 18 20:04:56 SIPProxy02 /usr/local/sbin/opensips[26077]: The Caller is a Local customer fu - [<a href="mailto:sip%3A9018X19XX0@launchyc.com">sip:9018X19XX0@launchyc.com</a>]</div>
<div>Aug 18 20:04:56 SIPProxy02 /usr/local/sbin/opensips[26077]: Dialog Before: td [<a href="http://launchyc.com">launchyc.com</a>], rU [*701] fU [9018X19XX0] HostVar [sip:108.X.X.17]</div><div>Aug 18 20:04:56 SIPProxy02 /usr/local/sbin/opensips[26077]: Dialog 3: 9018X19XX0 Retrieving Parked Call on host sip:108.X.X.17</div>
<div>Aug 18 20:04:56 SIPProxy02 /usr/local/sbin/opensips[26077]: ToAsterisk Route Before PSTN call IF check fU[9018X19XX0] tU[*701]</div><div><br></div><div><br></div><div><br></div><div>Script Section</div><div><br></div>
<div><br></div><div> ### - We need to see if someone in the domain parked a call</div><div> ### - If $var(x) doesn't equal 0 then our second ElseIf below will be True</div><div> get_dialog_info("host","$var(x)","parkedcall","$td");</div>
<div><br></div><div><br></div><div>xlog("Dialog Before: td [$td], rU [$rU] fU [$fU] HostVar [$var(x)]\n");</div><div><br></div><div><br></div><div> ## -- This is required so that if a Customer wants to do an Attended Transfer we send him to the</div>
<div> ## -- same Asterisk server his first call is already terminated to.</div><div> ## -- We also make sure the number doesn't start with the customers Voicemail number so that calls to voicemail don't always</div>
<div> ## -- get routed to the same Asterisk server</div><div> if ( get_dialog_info("host","$var(x)","caller","$fU") || get_dialog_info("host","$var(x)","caller","$rU") && $rU !~ "^\*555") {</div>
<div>xlog("Dialog 1: $fU has another ongoing, on host $var(x)\n");</div><div> #route to host $var(x)</div><div> $du = "sip:" + $rU + "@" + $(var(x){s.substr,4,0}) + ":5060";</div>
<div><br></div><div> ### - We need to keep up with Parked calls if the attended transfer is to a *700 number</div><div> if ( !match_dialog() )</div><div> {</div><div> create_dialog();</div>
<div> }</div><div> if($rU =~ "^\*7+"){</div><div> ### -- Someone is parking a call</div><div> $dlg_val(parkedcall) = $td;</div><div> }</div>
<div> $dlg_val(host) = $du;</div><div><br></div><div> } else if ( get_dialog_info("host","$var(x)","callee","$rU") || get_dialog_info("host","$var(x)","callee","$fU") && $rU !~ "^\*555") {</div>
<div> #route to host $var(x)</div><div>xlog("Dialog 2: $fU has another ongoing, on host $var(x)\n");</div><div> $du = "sip:" + $rU + "@" + $(var(x){s.substr,4,0}) + ":5060";</div>
<div><br></div><div> ### - We need to keep up with Parked calls if the attended transfer is to a *700 number</div><div> if ( !match_dialog() )</div><div> {</div><div> create_dialog();</div>
<div> }</div><div> if($rU =~ "^\*7+"){</div><div> ### -- Someone is parking a call</div><div> $dlg_val(parkedcall) = $td;</div><div> }</div>
<div> $dlg_val(host) = $du;</div><div><br></div><div> } else if ( $var(x) != "0" && $rU =~ "^\*7+") {</div><div> ### -- Someone in domain X has parked a call and we need to send this caller to the same Asterisk server so they can</div>
<div> ### -- pick up the parked call</div><div>xlog("Dialog 3: $fU Retrieving Parked Call on host $var(x)\n");</div><div> $du = "sip:" + $rU + "@" + $(var(x){s.substr,4,0}) + ":5060";</div>
<div><br></div><div> } else {</div><div><br></div><div> if ( !match_dialog() )</div><div> {</div><div> create_dialog();</div><div> }</div><div> $dlg_val(caller) = $fU;</div>
<div> $dlg_val(callee) = $rU;</div><div><br></div><div><br></div><div> # Had to comment this out because of Asterisk bug. See statement below</div><div> load_balance("100","sip");</div>
<div><br></div><div> if ($retcode<0) {</div><div> sl_send_reply("500","Service full");</div><div> exit;</div><div> }</div>
<div><br></div><div> $dlg_val(host) = $du;</div><div><br></div><div> # arm a failure route for be able to catch a failure event and to do</div><div> # failover to the next available destination</div>
<div><br></div><div> ### - Set timeout to failover to other Load Balancer</div><div> #$T_fr_inv_timeout = "5";</div><div> $T_fr_timeout = 3;</div><div> #$T_fr_timeout = "8";</div>
<div> t_on_failure("LB_failed");</div></div></div>