Re: [asterisk-users] update DB on ringing/ catch ringing event

2008-05-17 Thread Benjamin Jacob

Update on this one.

I finally went back to AMI only for implementing this particular feature, but 
ofcourse I had to make an addition of a couple of lines for my particular 
requirement.

On Dial, the 'dial' event is sent over AMI which I capture. Unfortunately the 
event didn't have any field identifying the account/or other user settable data 
for that particular call. So, I added lines in app_dial.c to send even the CDR 
userfield in the event.
So, before doing the 'Dial' I set CDR userfield with my own data, which is 
captured by the AMI user and populates/updates the correct row in my DB with 
the dialed channel, etc. 
From this point on, I can hangup the required channel, even before it has been 
answered/ even before it has started ringing. 


static void senddialevent(struct ast_channel *src, struct ast_channel *dst)
{
manager_event(EVENT_FLAG_CALL, Dial,
Source: %s\r\n
Destination: %s\r\n
CallerID: %s\r\n
CallerIDName: %s\r\n
SrcUniqueID: %s\r\n
DestUniqueID: %s\r\n
CDRUserfield: %s\r\n,
 src-name, dst-name, src-cid.cid_num ? src-cid.cid_num : unknown,
 src-cid.cid_name ? src-cid.cid_name : unknown, src-uniqueid,
 dst-uniqueid,
 (dst-cdr)?(dst-cdr-userfield):);
}

I am writing this mail from home, so don't really have the exact field names.

cheers
- Ben.


--- On Thu, 5/8/08, Tzafrir Cohen [EMAIL PROTECTED] wrote:

 From: Tzafrir Cohen [EMAIL PROTECTED]
 Subject: Re: [asterisk-users] update DB on ringing/ catch ringing event
 To: asterisk-users@lists.digium.com
 Date: Thursday, May 8, 2008, 12:00 AM
 On Thu, May 08, 2008 at 12:19:52AM +0300, Atis Lezdins
 wrote:
  On Wed, May 7, 2008 at 5:43 PM, Philipp Kempgen
  [EMAIL PROTECTED] wrote:
   Benjamin Jacob schrieb:
  
  
 Anyway in Asterisk to update a DB/ do some
 action on
 events like ringing.
 The issue is I need to be able to
 hangup/cancel a
 call, if it's ringing(decided by the
 admin). This is
 independant of the timeout that we can
 specify in the
 Dial command.

 If I could somehow update a DB with the
 channel name
 on ringing, it would solve my problem.

 I assume NVlinedetect is one way to do it,
 but that
 isn't visible anymore, more so for
 Asterisk 1.4 and
 above.

 Any bright ideas on this one?
  
I think there is no other solution but to listen
 to events on
the Asterisk manager interface.
  
  
  For now, not really.
  
  You could try Realtime Channels patch I just mentioned
 here:
 
 http://lists.digium.com/pipermail/asterisk-users/2008-May/211136.html
  
  This should give you up-to-date list of channels in
 database, so you can use
  
  SELECT * FROM channels WHERE state=Ring;
  
  to get currently ringing channels.
  
  If You find this patch useful, please add a comment to
 issue
  http://bugs.digium.com/view.php?id=12556
  that you would like to see Realtime status implemented
 in future
  versions of Asterisk.
 
 So you constantly poll the status of all channels? Waiting
 on manager
 interface event sounds more effective to me.
 
 But what exact ringing is it? Isn't the
 call by then already in the
 dialplan (and could be hung up before answered?)
 
 -- 
Tzafrir Cohen
 icq#16849755  jabber:[EMAIL PROTECTED]
 +972-50-7952406   mailto:[EMAIL PROTECTED]
 http://www.xorcom.com  iax:[EMAIL PROTECTED]/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


  


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


[asterisk-users] update DB on ringing/ catch ringing event

2008-05-07 Thread Benjamin Jacob

Hello ppl,

Anyway in Asterisk to update a DB/ do some action on
events like ringing. 
The issue is I need to be able to hangup/cancel a
call, if it's ringing(decided by the admin). This is
independant of the timeout that we can specify in the
Dial command.

If I could somehow update a DB with the channel name
on ringing, it would solve my problem.

I assume NVlinedetect is one way to do it, but that
isn't visible anymore, more so for Asterisk 1.4 and
above.

Any bright ideas on this one?

cheers
- Ben.



  

Be a better friend, newshound, and 
know-it-all with Yahoo! Mobile.  Try it now.  
http://mobile.yahoo.com/;_ylt=Ahu06i62sR8HDtDypao8Wcj9tAcJ


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


Re: [asterisk-users] update DB on ringing/ catch ringing event

2008-05-07 Thread Philipp Kempgen
Benjamin Jacob schrieb:

 Anyway in Asterisk to update a DB/ do some action on
 events like ringing. 
 The issue is I need to be able to hangup/cancel a
 call, if it's ringing(decided by the admin). This is
 independant of the timeout that we can specify in the
 Dial command.
 
 If I could somehow update a DB with the channel name
 on ringing, it would solve my problem.
 
 I assume NVlinedetect is one way to do it, but that
 isn't visible anymore, more so for Asterisk 1.4 and
 above.
 
 Any bright ideas on this one?

I think there is no other solution but to listen to events on
the Asterisk manager interface.

Regards,
  Philipp Kempgen

-- 
amooma GmbH - Bachstr. 126 - 56566 Neuwied - http://www.amooma.de
Let's use IT to solve problems and not to create new ones.
  Asterisk? - http://www.das-asterisk-buch.de

Geschäftsführer: Stefan Wintermeyer
Handelsregister: Neuwied B 14998

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


Re: [asterisk-users] update DB on ringing/ catch ringing event

2008-05-07 Thread Atis Lezdins
On Wed, May 7, 2008 at 5:43 PM, Philipp Kempgen
[EMAIL PROTECTED] wrote:
 Benjamin Jacob schrieb:


   Anyway in Asterisk to update a DB/ do some action on
   events like ringing.
   The issue is I need to be able to hangup/cancel a
   call, if it's ringing(decided by the admin). This is
   independant of the timeout that we can specify in the
   Dial command.
  
   If I could somehow update a DB with the channel name
   on ringing, it would solve my problem.
  
   I assume NVlinedetect is one way to do it, but that
   isn't visible anymore, more so for Asterisk 1.4 and
   above.
  
   Any bright ideas on this one?

  I think there is no other solution but to listen to events on
  the Asterisk manager interface.


For now, not really.

You could try Realtime Channels patch I just mentioned here:
http://lists.digium.com/pipermail/asterisk-users/2008-May/211136.html

This should give you up-to-date list of channels in database, so you can use

SELECT * FROM channels WHERE state=Ring;

to get currently ringing channels.

If You find this patch useful, please add a comment to issue
http://bugs.digium.com/view.php?id=12556
that you would like to see Realtime status implemented in future
versions of Asterisk.

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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


Re: [asterisk-users] update DB on ringing/ catch ringing event

2008-05-07 Thread Philipp Kempgen
Atis Lezdins schrieb:
 On Wed, May 7, 2008 at 5:43 PM, Philipp Kempgen
 [EMAIL PROTECTED] wrote:
 Benjamin Jacob schrieb:


   Anyway in Asterisk to update a DB/ do some action on
   events like ringing.
   The issue is I need to be able to hangup/cancel a
   call, if it's ringing(decided by the admin). This is
   independant of the timeout that we can specify in the
   Dial command.
  
   If I could somehow update a DB with the channel name
   on ringing, it would solve my problem.
  
   I assume NVlinedetect is one way to do it, but that
   isn't visible anymore, more so for Asterisk 1.4 and
   above.
  
   Any bright ideas on this one?

  I think there is no other solution but to listen to events on
  the Asterisk manager interface.

 
 For now, not really.
 
 You could try Realtime Channels patch I just mentioned here:
 http://lists.digium.com/pipermail/asterisk-users/2008-May/211136.html

Yeah, of course you can do almost anything with a patch.


Grüße,
Philipp Kempgen
-- 
Asterisk-Tag.org 2008, May 26th/27th  - http://www.asterisk-tag.org
amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998

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


Re: [asterisk-users] update DB on ringing/ catch ringing event

2008-05-07 Thread Atis Lezdins
On Thu, May 8, 2008 at 12:34 AM, Philipp Kempgen
[EMAIL PROTECTED] wrote:
 Atis Lezdins schrieb:

  On Wed, May 7, 2008 at 5:43 PM, Philipp Kempgen
   [EMAIL PROTECTED] wrote:
   Benjamin Jacob schrieb:
  
  
 Anyway in Asterisk to update a DB/ do some action on
 events like ringing.
 The issue is I need to be able to hangup/cancel a
 call, if it's ringing(decided by the admin). This is
 independant of the timeout that we can specify in the
 Dial command.

 If I could somehow update a DB with the channel name
 on ringing, it would solve my problem.

 I assume NVlinedetect is one way to do it, but that
 isn't visible anymore, more so for Asterisk 1.4 and
 above.

 Any bright ideas on this one?
  
I think there is no other solution but to listen to events on
the Asterisk manager interface.
  
  
   For now, not really.
  
   You could try Realtime Channels patch I just mentioned here:
   http://lists.digium.com/pipermail/asterisk-users/2008-May/211136.html

  Yeah, of course you can do almost anything with a patch.


Well, this wasn't specifically written for this requirement. I just
want to add some general usage realtime status in Asterisk, and I need
user support there :)

Regards,
Atis

-- 
Atis Lezdins,
VoIP Project Manager / Developer,
[EMAIL PROTECTED]
Skype: atis.lezdins
Cell Phone: +371 28806004
Cell Phone: +1 800 7300689
Work phone: +1 800 7502835

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


Re: [asterisk-users] update DB on ringing/ catch ringing event

2008-05-07 Thread Tzafrir Cohen
On Thu, May 08, 2008 at 12:19:52AM +0300, Atis Lezdins wrote:
 On Wed, May 7, 2008 at 5:43 PM, Philipp Kempgen
 [EMAIL PROTECTED] wrote:
  Benjamin Jacob schrieb:
 
 
Anyway in Asterisk to update a DB/ do some action on
events like ringing.
The issue is I need to be able to hangup/cancel a
call, if it's ringing(decided by the admin). This is
independant of the timeout that we can specify in the
Dial command.
   
If I could somehow update a DB with the channel name
on ringing, it would solve my problem.
   
I assume NVlinedetect is one way to do it, but that
isn't visible anymore, more so for Asterisk 1.4 and
above.
   
Any bright ideas on this one?
 
   I think there is no other solution but to listen to events on
   the Asterisk manager interface.
 
 
 For now, not really.
 
 You could try Realtime Channels patch I just mentioned here:
 http://lists.digium.com/pipermail/asterisk-users/2008-May/211136.html
 
 This should give you up-to-date list of channels in database, so you can use
 
 SELECT * FROM channels WHERE state=Ring;
 
 to get currently ringing channels.
 
 If You find this patch useful, please add a comment to issue
 http://bugs.digium.com/view.php?id=12556
 that you would like to see Realtime status implemented in future
 versions of Asterisk.

So you constantly poll the status of all channels? Waiting on manager
interface event sounds more effective to me.

But what exact ringing is it? Isn't the call by then already in the
dialplan (and could be hung up before answered?)

-- 
   Tzafrir Cohen
icq#16849755  jabber:[EMAIL PROTECTED]
+972-50-7952406   mailto:[EMAIL PROTECTED]
http://www.xorcom.com  iax:[EMAIL PROTECTED]/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