[Asterisk-Dev] ParkAndAnnounce() - trying to add var to indicate
parked exten
Andrew Kohlsmith
akohlsmith-asterisk at benshaw.com
Sat Oct 15 08:29:01 MST 2005
On Saturday 15 October 2005 00:28, Andrew Kohlsmith wrote:
> Subject line says it all. I thought this would be a trivial modification
> to ParkAndAnnounce, but it's proving difficult and I can't figure out why.
Well I figured out why pbx_builtin_setvar_helper() isn't cutting it, but I'm
still no farther ahead.
ast_request_and_dial doesn't return until AFTER the channel's been created and
dialled, so pbx_builtin_setvar_helper() is too late.
No problem, I create an outgoing_helper structure and write the variable in
the vars structure pointer and use __ast_request_and_dial instead of
ast_request_and_dial:
snprintf(buf, sizeof(buf), "%i", lot);
memset(&oh, 0, sizeof(struct outgoing_helper));
oh.vars = ast_variable_new("PARKEDAT", buf);
dchan = __ast_request_and_dial(dialtech, AST_FORMAT_SLINEAR,
dialstr,30000, &outstate, chan->cid.cid_num, chan->cid.cid_name, &oh);
So now I'm creating the variable before the channel is connected to Dial, so I
should be able to see the PARKEDAT variable... Unfortunately this isn't
true.
This is truly baffling. Can anyone help?
-A.
More information about the asterisk-dev
mailing list