[asterisk-app-dev] Local channel identification in ARI

Joshua Colp jcolp at digium.com
Tue Oct 14 18:11:00 CDT 2014


Jan Svoboda wrote:
> Hi,

Kia ora,

> I have a question regarding local channel identification in ARI.
>
> In my ARI app I am using local channels to route calls back to the app
> in certain conditions.
>
> The process is as follows:
> 1. Channel (phone) calls an extension and enters into stasis
> 2. Based on channel variables, extension, accountcode, … it is
> determined what to do with the channel
> 3. New channel is created (endpoint: LOCAL/123, appArgs: ‘abc')
> 4. App receives StasisStart event with channel
> Local/123 at default-000000b0;2 and empty args.
>
> The problem is identifying those (local) channels when they arrive in
> Stasis, since passed appArgs to the originate action for local channel
> don’t appear in the StasisStart event. Is this the expected behaviour ?

Yes - You've actually got 2 legs. When you specify the appArgs that only 
controls the leg which executes the Stasis application upon the outgoing 
leg being answered. It is not passed on to the outgoing leg. To 
accomplish what you want though you can either use inherited channel 
variables to pass this information on to the other leg OR you can 
specify the identifier for each leg when originating and store that 
information in your application. When your application is invoked on 
each channel you can check using the identifier and know to do something 
else.

Cheers,

-- 
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



More information about the asterisk-app-dev mailing list