<div class="gmail_quote">
<div>thanks for your reply but i did not meant that. ${CALLERID(DNID)} will return then number which i don&#39;t want. what i want is channel-id like if we have a user named &quot;nasir&quot;, then we dial it as follows</div>

<div> </div>
<div>Dial(SIP/nasir)</div>
<div> </div>
<div>but actual channel-id that asterisk uses is something like &quot; nasir-2b487e9&quot;. and on the asterisk cli we can check this when call is answered or hangup, asterisk attaches some random id with username.</div>

<div> </div>
<div>i am dialing sip uri using &quot;Dial(SIP/<a href="http://119.26.18.235:5062">119.26.18.235:5062</a>)&quot; which causes changed INVITE adn TO headers, so i want to get the channel-id that asterisk internally uses do dial it.</div>

<div> </div>
<div>if we use ChanIsAvail(SIP/nasir) or ChanIsAvail(SIP/<a href="http://192.168.0.10:5062">192.168.0.10:5062</a>) this works on Local LAN and it returns &quot;SIP/192.168.0.10:5062-3fe934f4&quot; , but when asterisk is on Live Ip and users are behind Router then this function gives error of unknow host. so i want to know if there is any other function that does this job.</div>

<div> </div>
<div>so what is want is to get this channel-id ( like nasir-2487e9) and dial it like</div>
<div> </div>
<div>
<div>Dial(SIP/nasir-2487e9) or Dial(SIP/119.26.18.235:5062-34e984b)&quot; </div>
<div> </div>
<div>hope this clears what i wanna do.</div>
<div> </div>
<div> </div></div>
<div> </div>
<blockquote style="BORDER-LEFT: #ccc 1px solid; MARGIN: 0px 0px 0px 0.8ex; PADDING-LEFT: 1ex" class="gmail_quote">Message: 8<br>Date: Thu, 29 Jul 2010 10:37:07 -0500<br>From: &quot;Danny Nicholas&quot; &lt;<a href="mailto:danny@debsinc.com">danny@debsinc.com</a>&gt;<br>
Subject: Re: [asterisk-users] How to extract channel-id of a user or<br>       peer<br>To: &quot;&#39;Asterisk Users Mailing List - Non-Commercial Discussion&#39;&quot;<br>       &lt;<a href="mailto:asterisk-users@lists.digium.com">asterisk-users@lists.digium.com</a>&gt;<br>
Message-ID: &lt;<a href="mailto:201007291515.o6TFFv8t025793@mail.debsinc.com">201007291515.o6TFFv8t025793@mail.debsinc.com</a>&gt;<br>Content-Type: text/plain; charset=&quot;us-ascii&quot;<br><br>From: <a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a><br>
[mailto:<a href="mailto:asterisk-users-bounces@lists.digium.com">asterisk-users-bounces@lists.digium.com</a>] On Behalf Of Nasir Javaid<br>Subject: [asterisk-users] How to extract channel-id of a user or peer<br><br>my question is how can i get channel-id of a user or peer. I tried using<br>
ChanIsAvail(username). this works correctly when user and asterisk are on<br>Local LAN. But my asterisk server is on public ip and users are behind nat,<br>and so this method says unknow host when used on public asterisk server.<br>
I also tried built-in variable ${CHANNEL}, but this returns the channel-id<br>of the calling channel. but i want channel-id of called user.<br><br><br>--------------------------------------<br>perhaps ${CALLERID(DNID)}<br>
<br></blockquote></div>