call files

Home » Asterisk Users » call files
Asterisk Users 3 Comments

Hi.

Im having trouble setting variables in channel dialplan and re-using them in
Extension dialplan…

Im using the following call file:

Channel: Local/210332450@ZonNew-Outbound
CallerID: ZonNew-Outbound:49:210332450:
MaxRetries: 5
RetryTime: 10
WaitTime: 60
Account: Outbound210332450
Context: agents
Extension: 888210332450
Set: __PARTNER=ZonNew-Outbound
Set: NUMBER=210332450

In “Local/210332450@ZonNew-Outbound” I Set(bla=’blabla’);

It seems I cannot re-use this var in extension _888XXXXXXXXX in context
agents…

Basically the Channel dialplan has a Queue() and in _888XXXXXXXXX I would
like to know the peer (or interface) that answered it… What can I do?

Thanks in advance

3 thoughts on - call files

  • Hi,

    Using DumpChan(); Seems that Channel (where the call goes first) is a
    sub-channel of Context/Extension (where the call goes on CONNECT) ??

    first I have:
    Dumping Info For Channel: Local/210332450@ZonNew-Outbound-66c7;2:

    Then after:
    Dumping Info For Channel: Local/210332450@ZonNew-Outbound-66c7;1:

    Help ?

  • I’m a little confused by “It Seems I cannot re-use this var in extension
    _888XXXXXXXXXX in context agents”….Of course you can use it…but if you
    set bla to a different value in your code where your callfile is processed,
    Asterisk will (rightfully so) just set bla = to whatever you set it to….

    Now, if the callfile doesn’t send a channel “through” the context that
    you’re trying to set blah, that’s a little odd…

    Now, as far as retrieving the information about the interface that answered
    the call….look in queues.conf.sample….there’s a nifty configuration
    option:

    *setinterfacevar=no ; (the default is no)*

    That option, when set to yes, causes several variables to be created
    *just*prior to the caller being bridged with the queue member…

  • Hello,

    Thanks for replying.

    Answers below:

    MEMBERINTERFACE variable in dialplan _888XXXXXXXXX, and that is where I’m
    needing it.

    Also seems that its two channel legs and the only way would be to use
    IMPORT() o SHARED() and for that I would have to know the channel name…

    I am right now using IMPORT() like:

    Set(CALLERID(num)=${IMPORT(${CHANNEL:0:$[${LEN(${CHANNEL})} –
    1]}2,MEMBERNAME)});

    but I fee that it is a ugly fix. What if call leg changes from 2 to 3?