Thanx a lot.........that was it. will never forget to remove the new character again. Now its working fine.<br><br><div class="gmail_quote">On Fri, May 9, 2008 at 4:31 PM, Tony Mountifield <<a href="mailto:tony@softins.clara.co.uk">tony@softins.clara.co.uk</a>> wrote:<br>
<blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">In article <<a href="mailto:4809880c0805090402o77001c79ne7cacec0c7dacf89@mail.gmail.com">4809880c0805090402o77001c79ne7cacec0c7dacf89@mail.gmail.com</a>>,<br>
<div class="Ih2E3d">Rizwan Hisham <<a href="mailto:rizwanhasham@gmail.com">rizwanhasham@gmail.com</a>> wrote:<br>
><br>
> same is the case in 1.6, i cant set the variable still.<br>
<br>
</div>My guess would be that you have a problem with line endings.<br>
<br>
All lines received from the manager interface are terminated with \r\n,<br>
not just \n. If you only strip the \n off, the channel name you received<br>
will contain \r at the end. If you then send that back in the setvar<br>
command with a further \r\n to terminate the line, then Asterisk will<br>
probably not find a matching channel.<br>
<br>
Make sure you strip both \r and \n from incoming lines.<br>
<br>
Cheers<br>
Tony<br>
<div class="Ih2E3d"><br>
> On Thu, May 8, 2008 at 8:43 PM, Tzafrir Cohen <<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.com</a>><br>
> wrote:<br>
><br>
> > On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:<br>
> > > Hi all,<br>
> > > I am using a simple perl script to connect with ast manager api. the<br>
> > script<br>
> > > tries to set a channel variable. It extracts the channel name from the<br>
> > > events it recieves after dial command. When i try to set the channel<br>
> > > variable, asterisk responses with an error saying that the channel does<br>
> > not<br>
> > > exist. Can anybody tell me why its doing so, coz i can see on cli that<br>
> > the<br>
> > > channel exists. If i try to set the variable without stating the channel<br>
> > > then it sets the global variable, but i want to set the channel variable.<br>
> > > Anybody has a solution to this problem?<br>
> ><br>
> > In 1.6 you can set a channel variable from a diferent context. I don't<br>
> > think you can do that in 1.4 .<br>
> ><br>
> > --<br>
> > Tzafrir Cohen<br>
</div>> > icq#16849755 <a href="mailto:jabber%3Atzafrir.cohen@xorcom.com">jabber:tzafrir.cohen@xorcom.com</a><<a href="mailto:jabber%253Atzafrir.cohen@xorcom.com">jabber%3Atzafrir.cohen@xorcom.com</a>><br>
<div class="Ih2E3d">> > +972-50-7952406 mailto:<a href="mailto:tzafrir.cohen@xorcom.com">tzafrir.cohen@xorcom.com</a><br>
> > <a href="http://www.xorcom.com" target="_blank">http://www.xorcom.com</a> <a href="http://iax:guest@local.xorcom.com/tzafrir" target="_blank">iax:guest@local.xorcom.com/tzafrir</a><br>
> ><br>
> > _______________________________________________<br>
> > -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
> ><br>
> > asterisk-users mailing list<br>
> > To UNSUBSCRIBE or update options visit:<br>
> > <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
> ><br>
><br>
><br>
><br>
> --<br>
> Best Regards<br>
> Rizwan Hisham<br>
><br>
</div>> -=-=-=-=-=-<br>
> [Alternative: text/html]<br>
> -=-=-=-=-=-<br>
> -=-=-=-=-=-<br>
<div class="Ih2E3d">><br>
> _______________________________________________<br>
> -- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
><br>
> asterisk-users mailing list<br>
> To UNSUBSCRIBE or update options visit:<br>
> <a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div>> -=-=-=-=-=-<br>
<font color="#888888"><br>
<br>
--<br>
Tony Mountifield<br>
Work: <a href="mailto:tony@softins.co.uk">tony@softins.co.uk</a> - <a href="http://www.softins.co.uk" target="_blank">http://www.softins.co.uk</a><br>
Play: <a href="mailto:tony@mountifield.org">tony@mountifield.org</a> - <a href="http://tony.mountifield.org" target="_blank">http://tony.mountifield.org</a><br>
</font><div><div></div><div class="Wj3C7c"><br>
_______________________________________________<br>
-- Bandwidth and Colocation Provided by <a href="http://www.api-digital.com" target="_blank">http://www.api-digital.com</a> --<br>
<br>
asterisk-users mailing list<br>
To UNSUBSCRIBE or update options visit:<br>
<a href="http://lists.digium.com/mailman/listinfo/asterisk-users" target="_blank">http://lists.digium.com/mailman/listinfo/asterisk-users</a><br>
</div></div></blockquote></div><br><br clear="all"><br>-- <br>Best Regards<br>Rizwan Hisham<br>