[Asterisk-Users] Re: Originate not understanding 2 vars in setvars
Tony Mountifield
tony at softins.clara.co.uk
Thu Sep 15 02:37:22 MST 2005
In article <432934EA.90907 at osiag.de>, Joerg Lauer <lauer at osiag.de> wrote:
> Hi,
>
> I'm currently trying to originate a call with 2 variables set. I tried
> doing it via manager API and call File and both failed, because the vars
> were not separated. I'm using Asterisk 1.2_beta1 on this machine
>
> Can anyone here verify wether this is a bug or just a stupid error on my
> part?
>
> This is the callfile I tried to use, after the manager way failed:
>
> Channel: local/21 at outbounddial/n
> MaxRetries: 0
> RetryTime: 60
> WaitTime: 30
> Context: outbound
> Extension: s
> Priority: 1
> SetVar: actionID=54547-1126771509609|AgiIP=192.168.10.249
>
> The part of the extension.conf it should work with is this:
>
> [outbound]
> exten => s,1,Agi(agi://${AgiIP}:1234/outbound.agi?actionId=${actionId})
>
> Asterisk dials out, as it should, but when the call is answered I get
> the following message in CLI:
>
> Executing AGI("Local/21 at outbounddial-d582,1",
> "agi://:1234/outbound.agi?actionId=54547-1126771509609|AgiIP=192.168.10.249")
> in new stack
> Sep 15 12:36:50 WARNING[18839]: res_agi.c:153 launch_netscript: Unable
> to locate host ''
>
> According to the help (show manager command Originate), I think it
> should have worked.
It looks like it has changed between 1.0.x stable and 1.2beta head, but
that the help text hasn't been changed. Also, note that call files are
processed by completely different code (pbx/pbx_spool.c) than the manager
API (manager.c). e.g. call file uses Setvar but manager uses Variable;
call file uses Extension but manager uses Exten.
Firstly in the Manager API, in Stable you would include this:
Variable: actionID=54547-1126771509609|AgiIP=192.168.10.249
However, in Head you have to do this:
Variable: actionID=54547-1126771509609
Variable: AgiIP=192.168.10.249
I don't know if this change is documented anywhere.
In call files, it looks like you have to do the following in both Stable
and Head:
Setvar: actionID=54547-1126771509609
Setvar: AgiIP=192.168.10.249
All the above was just gleaned in the last few minutes by reading the
source code, which is available for anyone to read :-) I haven't run
any experiments to test my conclusions!
Hope this helps!
Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
More information about the asterisk-users
mailing list