[Kamailio-Users] Problem Dynamically Setting Forward

Daniel-Constantin Mierla miconda at gmail.com
Thu Sep 18 18:28:10 CEST 2008


Hello,

On 09/18/08 13:48, Jon Farmer wrote:
> Hi
>
> I am trying to call a script via exec_avp and then use the output of 
> the script to use as an argument to forward(). Such as
>
>
> route[2] {
>         # forward to AGCF
>         exec_avp("/usr/utils/select_incoming_agcf.php");
>         record_route();
>         xlog("forward to: $avp(i:1)\n");
>         #forward("$avp(s:1)");
>         forward("$avp(s:1);
>
>         exit;
> }
>
>
> However syslog complains as follows
>
> Sep 18 11:42:12 vla openser[19470]: ERROR:core:parse_phostport: bad 
> protocol in $avp(s:1)
> Sep 18 11:42:12 vla openser[19470]: ERROR:core:fix_actions: 
> ERROR:fix_actions: FORWARD/SEND bad argument
> Sep 18 11:42:12 vla openser[19470]: ERROR:core:main: failed to fix 
> configuration with err code -6
>
> The output of the script is 10.0.0.1:5060 <http://10.0.0.1:5060>
>
>
> Any ideas?
forward() function takes only static string. as parameter. For you case 
you can set the $du, just have in mind that the value of $du must be a 
valid sip uri.

$avp(i:1) = "sip:10.10.10:5060";
$du = $avp(i:1);
forward();

Cheers,
Daniel

-- 
Daniel-Constantin Mierla
http://www.asipto.com





More information about the sr-users mailing list