[asterisk-app-dev] Setting a channel variable

Nitesh Bansal nitesh.bansal at gmail.com
Wed Apr 6 03:22:30 CDT 2016


Thanks Joshua, yes it works by directly passing the variables to originate.

Thanks,
Nitesh

On Tue, Apr 5, 2016 at 4:30 PM, Joshua Colp <jcolp at digium.com> wrote:

> Nitesh Bansal wrote:
>
>> Hello,
>>
>> I want to use ARI node client library to initiate a call, i'm using the
>> sample code
>> from the ari example 'bridge-move.js', the code is running fine.
>>
>> https://wiki.asterisk.org/wiki/display/AST/ARI+and+Bridges%3A+Bridge+Operations#ARIandBridges:BridgeOperations-bridge-move.js
>> But now before initiating the call, I want to be able to add a 'Route'
>> header in
>> the outgoing call placed, I'm trying to achieve it by adding a channel
>> variable, it seems
>> that it isn't working, I don't see any route header added in the
>> outgoing INVITE.
>>
>> This is my code in the originate function:
>> channel.setChannelVar({variable : "SIPADDHEADER", value : "Route :
>> nbansal at iptel.org <mailto:nbansal at iptel.org>"});
>>
>
> You need to pass in the variables to set on the originate itself using the
> variables argument, and not set it afterwards. This should work as you
> expect/need.
>
> --
> Joshua Colp
> Digium, Inc. | Senior Software Developer
> 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
> Check us out at: www.digium.com & www.asterisk.org
>
>
> _______________________________________________
> asterisk-app-dev mailing list
> asterisk-app-dev at lists.digium.com
> http://lists.digium.com/cgi-bin/mailman/listinfo/asterisk-app-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-app-dev/attachments/20160406/ece5f303/attachment.html>


More information about the asterisk-app-dev mailing list