[SR-Users] force_send_socket

Daniel-Constantin Mierla miconda at gmail.com
Wed Dec 11 10:45:00 CET 2013


On 11/12/13 10:35, Alex Balashov wrote:
> On 12/11/2013 04:31 AM, Keith wrote:
>> Hi,
>>
>> I am using force_send_socket as I have two interfaces. It works fine but
>> at the moment I am hard coding the IP address. I want to use a variable
>> instead, I have tried the following:
>>
>> force_send_socket($sel(cfg_get.kamailio.bindip);
>>
>> But kamailio doesn't start and complains about the format.
>
> force_send_socket() is an old core function that does not accept 
> variables.  Try write to $fs instead:
>
>    $fs = "udp:$sel(cfg_get.kamailio.bindip):5060";
Actually, to work, the above line has to be:

    $fs = "udp:" + $sel(cfg_get.kamailio.bindip) + ":5060";

or:

    pv_printf($fs, "udp:$sel(cfg_get.kamailio.bindip):5060");

or with more recent versions:

$fs = $_s(udp:$sel(cfg_get.kamailio.bindip):5060);

Cheers,
Daniel

-- 
Daniel-Constantin Mierla - http://www.asipto.com
http://twitter.com/#!/miconda - http://www.linkedin.com/in/miconda




More information about the sr-users mailing list