<div dir="ltr"><div class="gmail_extra">Guys, seems I found the solution with ARI.</div><div class="gmail_extra">Great.</div><div class="gmail_extra">I was mislead by similarity of originate parameters in AMI and ARI.</div>
<div class="gmail_extra">In AMI we either specify context, extention and priority OR application and application data.</div><div class="gmail_extra">In ARI we have also parameters 'app' and 'appArgs'.</div>
<div class="gmail_extra">But! Thery are not for calling dialplan application insted of context/exten/prio.</div><div class="gmail_extra">Let see what documentation tells:</div><div class="gmail_extra"><br></div><div class="gmail_extra">
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">POST /channels<br>Create a new channel (originate). The new channel is created immediately and a snapshot of it returned. If a Stasis application is provided it will be automatically subscribed to the originated channel for further events and updates.<br>
Query parameters<br>endpoint: string - (required) Endpoint to call.<br>extension: string - The extension to dial after the endpoint answers<br>context: string - The context to dial after the endpoint answers. If omitted, uses 'default'<br>
priority: long - The priority to dial after the endpoint answers. If omitted, uses 1<br><b>app: string - The application that is subscribed to the originated channel, and passed to the Stasis application.<br>appArgs: string - The application arguments to pass to the Stasis application.</b><br>
callerId: string - CallerID to use when dialing the endpoint or extension.<br>timeout: int = 30 - Timeout (in seconds) before giving up dialing, or -1 for no timeout.<br>channelId: string - The unique id to assign the channel on creation.<br>
otherChannelId: string - The unique id to assign the second channel when using local channels</blockquote></div><div class="gmail_extra"><br></div><div class="gmail_extra">So when I change parameters to the following:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">data = {</div><div class="gmail_extra"> 'endpoint': 'SIP/%s' % provider,</div><div class="gmail_extra"> 'extension': DIALER_EXTENSION,</div>
<div class="gmail_extra"> 'context': DIALER_CONTEXT,</div><div class="gmail_extra"> 'priority': '1',</div><div class="gmail_extra"> 'channelId': channel_id,</div>
<div class="gmail_extra"> 'timeout': '60',</div><div class="gmail_extra"> <b> 'app': 'dialer',</b></div><div class="gmail_extra"><b> 'appArgs': 'originated',</b></div>
<div class="gmail_extra"> }</div><div class="gmail_extra"> ret = ari_post('channels', data=data)<br></div><div class="gmail_extra"><br></div><div class="gmail_extra">I start to receive the following event on websocket:</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">{u'application': u'dialer', <b>u'cause': 18</b>, u'channel': {u'accountcode': u'', u'name': u'SIP/provider1-0000032b', u'caller': {u'name': u'', u'number': u''}, u'creationtime': u'2014-06-05T13:41:25.613+0400', u'state': u'Down', u'connected': {u'name': u'', u'number': u''}, u'dialplan': {u'priority': 1, u'exten': u'', u'context': u'no'}, u'id': u'1401961285.6_provider1_1'}, u'timestamp': u'2014-06-05T13:41:57.614+0400', u'type': <b>u'ChannelHangupRequest</b>'}</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">{u'timestamp': u'2014-06-05T13:41:57.614+0400', u'application': u'dialer', u'type': <b>u'ChannelDestroyed</b>', u'cause': 18, <b>u'cause_txt': u'No user responding'</b>, u'channel': {u'accountcode': u'', u'name': u'SIP/provider1-0000032b', u'caller': {u'name': u'', u'number': u''}, u'creationtime': u'2014-06-05T13:41:25.613+0400', u'state': u'Down', u'connected': {u'name': u'', u'number': u''}, u'dialplan': {u'priority': 1, u'exten': u'', u'context': u'no'}, u'id': u'1401961285.6_provider1_1'}}</div>
<div class="gmail_extra"><br></div><div class="gmail_extra"><br></div><div class="gmail_extra">And everyting is easily matched on channel id.</div><div class="gmail_extra">Great!</div><div class="gmail_extra">Sorry for taking your time :-)</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">P.S. But anyway I don't see <b>appArgs </b>anywhere in websocket messages :-)</div></div></div></div>