Sponsor: VoiceMeUp - Corporate & Wholesale VoIP Services

VoIP Mailing List Archives
Mailing list archives for the VoIP community
 SearchSearch 

[asterisk-users] Manager API - Setvar not working


 
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users
View previous topic :: View next topic  
Author Message
tzafrir.cohen at xorco...
Guest





PostPosted: Thu May 08, 2008 10:43 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:
Quote:
Hi all,
I am using a simple perl script to connect with ast manager api. the script
tries to set a channel variable. It extracts the channel name from the
events it recieves after dial command. When i try to set the channel
variable, asterisk responses with an error saying that the channel does not
exist. Can anybody tell me why its doing so, coz i can see on cli that the
channel exists. If i try to set the variable without stating the channel
then it sets the global variable, but i want to set the channel variable.
Anybody has a solution to this problem?

In 1.6 you can set a channel variable from a diferent context. I don't
think you can do that in 1.4 .

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir
Back to top
rizwanhasham at gmail.com
Guest





PostPosted: Fri May 09, 2008 6:02 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

same is the case in 1.6, i cant set the variable still.

On Thu, May 8, 2008 at 8:43 PM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>
wrote:

Quote:
On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:
Quote:
Hi all,
I am using a simple perl script to connect with ast manager api. the
script
Quote:
tries to set a channel variable. It extracts the channel name from the
events it recieves after dial command. When i try to set the channel
variable, asterisk responses with an error saying that the channel does
not
Quote:
exist. Can anybody tell me why its doing so, coz i can see on cli that
the
Quote:
channel exists. If i try to set the variable without stating the channel
then it sets the global variable, but i want to set the channel variable.
Anybody has a solution to this problem?

In 1.6 you can set a channel variable from a diferent context. I don't
think you can do that in 1.4 .

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com<jabber%3Atzafrir.cohen at xorcom.com>
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--
Best Regards
Rizwan Hisham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080509/b3613965/attachment.htm
Back to top
tony at softins.clara....
Guest





PostPosted: Fri May 09, 2008 6:31 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

In article <4809880c0805090402o77001c79ne7cacec0c7dacf89 at mail.gmail.com>,
Rizwan Hisham <rizwanhasham at gmail.com> wrote:
Quote:

same is the case in 1.6, i cant set the variable still.

My guess would be that you have a problem with line endings.

All lines received from the manager interface are terminated with \r\n,
not just \n. If you only strip the \n off, the channel name you received
will contain \r at the end. If you then send that back in the setvar
command with a further \r\n to terminate the line, then Asterisk will
probably not find a matching channel.

Make sure you strip both \r and \n from incoming lines.

Cheers
Tony

Quote:
On Thu, May 8, 2008 at 8:43 PM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>
wrote:

Quote:
On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:
Quote:
Hi all,
I am using a simple perl script to connect with ast manager api. the
script
Quote:
tries to set a channel variable. It extracts the channel name from the
events it recieves after dial command. When i try to set the channel
variable, asterisk responses with an error saying that the channel does
not
Quote:
exist. Can anybody tell me why its doing so, coz i can see on cli that
the
Quote:
channel exists. If i try to set the variable without stating the channel
then it sets the global variable, but i want to set the channel variable.
Anybody has a solution to this problem?

In 1.6 you can set a channel variable from a diferent context. I don't
think you can do that in 1.4 .

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com<jabber%3Atzafrir.cohen at xorcom.com>
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users




--
Best Regards
Rizwan Hisham

-=-=-=-=-=-
[Alternative: text/html]
-=-=-=-=-=-
-=-=-=-=-=-

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-=-=-=-=-=-
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
Back to top
rizwanhasham at gmail.com
Guest





PostPosted: Fri May 09, 2008 6:58 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

Thanx a lot.........that was it. will never forget to remove the new
character again. Now its working fine.

On Fri, May 9, 2008 at 4:31 PM, Tony Mountifield <tony at softins.clara.co.uk>
wrote:

Quote:
In article <4809880c0805090402o77001c79ne7cacec0c7dacf89 at mail.gmail.com>,
Rizwan Hisham <rizwanhasham at gmail.com> wrote:
Quote:

same is the case in 1.6, i cant set the variable still.

My guess would be that you have a problem with line endings.

All lines received from the manager interface are terminated with \r\n,
not just \n. If you only strip the \n off, the channel name you received
will contain \r at the end. If you then send that back in the setvar
command with a further \r\n to terminate the line, then Asterisk will
probably not find a matching channel.

Make sure you strip both \r and \n from incoming lines.

Cheers
Tony

Quote:
On Thu, May 8, 2008 at 8:43 PM, Tzafrir Cohen <tzafrir.cohen at xorcom.com>
wrote:

Quote:
On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:
Quote:
Hi all,
I am using a simple perl script to connect with ast manager api. the
script
Quote:
tries to set a channel variable. It extracts the channel name from
the
Quote:
Quote:
Quote:
events it recieves after dial command. When i try to set the channel
variable, asterisk responses with an error saying that the channel
does
Quote:
Quote:
not
Quote:
exist. Can anybody tell me why its doing so, coz i can see on cli
that
Quote:
Quote:
the
Quote:
channel exists. If i try to set the variable without stating the
channel
Quote:
Quote:
Quote:
then it sets the global variable, but i want to set the channel
variable.
Quote:
Quote:
Quote:
Anybody has a solution to this problem?

In 1.6 you can set a channel variable from a diferent context. I don't
think you can do that in 1.4 .

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com<jabber%3Atzafrir.cohen at xorcom.com>
<jabber%3Atzafrir.cohen at xorcom.com <jabber%253Atzafrir.cohen at xorcom.com>>
Quote:
Quote:
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users




--
Best Regards
Rizwan Hisham

-=-=-=-=-=-
[Alternative: text/html]
-=-=-=-=-=-
-=-=-=-=-=-

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users
-=-=-=-=-=-


--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--
Best Regards
Rizwan Hisham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080509/6743f5ea/attachment.htm
Back to top
gunars.grundans at lig...
Guest





PostPosted: Fri May 09, 2008 7:07 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

On 5/8/08, Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
Quote:

On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:
Quote:
Hi all,
I am using a simple perl script to connect with ast manager api. the
script
Quote:
tries to set a channel variable. It extracts the channel name from the
events it recieves after dial command. When i try to set the channel
variable, asterisk responses with an error saying that the channel does
not
Quote:
exist. Can anybody tell me why its doing so, coz i can see on cli that
the
Quote:
channel exists. If i try to set the variable without stating the channel
then it sets the global variable, but i want to set the channel variable.
Anybody has a solution to this problem?


In 1.6 you can set a channel variable from a diferent context. I don't
think you can do that in 1.4 .

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com<jabber%3Atzafrir.cohen at xorcom.com>
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

My guess that Setvar was deprecated in Asterisk 1.4. Use Set instead if you
are trying to use it in 1.6
--
Gunars Grundans

http://freight.lv
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080509/f018987e/attachment.htm
Back to top
rizwanhasham at gmail.com
Guest





PostPosted: Fri May 09, 2008 8:52 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

Can anybody help in parsing the manager events efficiently? Any ideas?

On Fri, May 9, 2008 at 5:07 PM, Gun?rs Grund?ns <
gunars.grundans at lighthouse.lv> wrote:

Quote:


On 5/8/08, Tzafrir Cohen <tzafrir.cohen at xorcom.com> wrote:
Quote:

On Thu, May 08, 2008 at 07:39:39PM +0500, Rizwan Hisham wrote:
Quote:
Hi all,
I am using a simple perl script to connect with ast manager api. the
script
Quote:
tries to set a channel variable. It extracts the channel name from the
events it recieves after dial command. When i try to set the channel
variable, asterisk responses with an error saying that the channel does
not
Quote:
exist. Can anybody tell me why its doing so, coz i can see on cli that
the
Quote:
channel exists. If i try to set the variable without stating the channel
then it sets the global variable, but i want to set the channel
variable.
Quote:
Anybody has a solution to this problem?


In 1.6 you can set a channel variable from a diferent context. I don't
think you can do that in 1.4 .

--
Tzafrir Cohen
icq#16849755 jabber:tzafrir.cohen at xorcom.com<jabber%3Atzafrir.cohen at xorcom.com>
+972-50-7952406 mailto:tzafrir.cohen at xorcom.com
http://www.xorcom.com iax:guest at local.xorcom.com/tzafrir

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users



My guess that Setvar was deprecated in Asterisk 1.4. Use Set instead if you
are trying to use it in 1.6
--
Gunars Grundans

http://freight.lv

_______________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users


--
Best Regards
Rizwan Hisham
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.digium.com/pipermail/asterisk-users/attachments/20080509/d857f35e/attachment.htm
Back to top
tony at softins.clara....
Guest





PostPosted: Fri May 09, 2008 9:18 am    Post subject: [asterisk-users] Manager API - Setvar not working Reply with quote

In article <4809880c0805090652y26ed1d30p22688eaee4b078f7 at mail.gmail.com>,
Rizwan Hisham <rizwanhasham at gmail.com> wrote:
Quote:
Can anybody help in parsing the manager events efficiently? Any ideas?

Since you're using perl, have a look at POE-Component-Client-Asterisk-Manager
here: http://search.cpan.org/~xantus/POE-Component-Client-Asterisk-Manager/

You would need to use the POE event-driven framework.

Or you could try Asterisk::Manager in asterisk-perl-0.10

I haven't tried either of them - most of my Manager stuff is in C.

Cheers
Tony
--
Tony Mountifield
Work: tony at softins.co.uk - http://www.softins.co.uk
Play: tony at mountifield.org - http://tony.mountifield.org
Back to top
Display posts from previous:   
Post new topic   Reply to topic    VoIP Mailing List Archives Forum Index -> Asterisk Users All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

VoiceMeUp - Corporate & Wholesale VoIP Services