Hello, I'm using SIP realtime with MySQL DB. Is it possible to get the status of the SIP peer (free / calling) from this realtime DB ? If not, is there another way to obtain the call state of a SIP peer ? Kind regards, Jonas. -------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110413/24761f1e/attachment.htm>
On 13-04-11 10:15, Jonas Kellens wrote:> Hello, > > I'm using SIP realtime with MySQL DB. > > Is it possible to get the status of the SIP peer (free / calling) from > this realtime DB ? >NO> If not, is there another way to obtain the call state of a SIP peer ? >AMI (Asterisk Manager Interface)> > Kind regards, > Jonas. > > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110413/89892045/attachment.htm>
On Wed, 2011-04-13 at 10:15 +0200, Jonas Kellens wrote:> Hello, > > I'm using SIP realtime with MySQL DB. > > Is it possible to get the status of the SIP peer (free / calling) from > this realtime DB ? > > If not, is there another way to obtain the call state of a SIP peer ? > > > Kind regards, > Jonas. > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-usersYou could use core show channels in the console/via AMI to determine if any extensions are on a call or even making a call. -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062
Why not use hints instead? -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens Sent: 13 April 2011 10:09 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Realtime SIP & peer status On 04/13/2011 10:57 AM, Ishfaq Malik wrote:> On Wed, 2011-04-13 at 10:15 +0200, Jonas Kellens wrote: > >> Hello, >> >> I'm using SIP realtime with MySQL DB. >> >> Is it possible to get the status of the SIP peer (free / calling) >> from this realtime DB ? >> >> If not, is there another way to obtain the call state of a SIP peer ? >> > You could use core show channels in the console/via AMI to determine > if any extensions are on a call or even making a call. > >If this information is not available, then I'm thinking of writing an AGI and calling this AGI when a call is being answered. This AGI will then write to the MySQL-DB the state "busy" for this SIP peer. Off course when the call ends, I need another AGi in the h-exten which writes the state "free" for this SIP peer. You think this will work ? Or will it put too much load on my system ? Kind regards, Jonas. -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users If you have received this communication in error we would appreciate you advising us either by telephone or return of e-mail. The contents of this message, and any attachments, are the property of DataVox, and are intended for the confidential use of the named recipient only. If you are not the intended recipient, employee or agent responsible for delivery of this message to the intended recipient, take note that any dissemination, distribution or copying of this communication and its attachments is strictly prohibited, and may be subject to civil or criminal action for which you may be liable. Every effort has been made to ensure that this e-mail or any attachments are free from viruses. While the company has taken every reasonable precaution to minimise this risk, neither company, nor the sender can accept liability for any damage which you sustain as a result of viruses. It is recommended that you should carry out your own virus checks before opening any attachments. Registered in England. No. 27459085.
Maybe I should have asked 'why do you want to put the status in to a mySQL database'? BTW - extensions.conf has mySQL functions built in - so no external script is actually needed. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens Sent: 13 April 2011 10:25 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Realtime SIP & peer status On 04/13/2011 11:20 AM, Ishfaq Malik wrote:> On Wed, 2011-04-13 at 11:09 +0200, Jonas Kellens wrote: > >> On 04/13/2011 10:57 AM, Ishfaq Malik wrote: >> >>> On Wed, 2011-04-13 at 10:15 +0200, Jonas Kellens wrote: >>> >>> >>>> Hello, >>>> >>>> I'm using SIP realtime with MySQL DB. >>>> >>>> Is it possible to get the status of the SIP peer (free / calling) >>>> from this realtime DB ? >>>> >>>> If not, is there another way to obtain the call state of a SIP peer>>>> ? >>>> >>>> >>> You could use core show channels in the console/via AMI to determine>>> if any extensions are on a call or even making a call. >>> >>> >>> >> If this information is not available, then I'm thinking of writing an>> AGI and calling this AGI when a call is being answered. This AGI will>> then write to the MySQL-DB the state "busy" for this SIP peer. Off >> course when the call ends, I need another AGi in the h-exten which >> writes the state "free" for this SIP peer. >> >> You think this will work ? Or will it put too much load on my system >> ? >> >> >> Kind regards, >> Jonas. >> >> > You could write a shell script to do what you suggested and pop it on > a cron. The info wouldn't be 100% realtime that way though but I think> the load would be very low. > > Also, as someone else has suggested, you could use hints but you have > to add some of the code for hints directly into the extensions.conf > which sort of goes against the point of RealTime unless you use > scripts to handle that part as I myself have done. >Why should I use a cron ? I can just use an AGI in extensions.conf. That's the closest to "realtime" I think. How can I write information to a MySQL-DB using hints ? Please explain. Kind regards, Jonas. -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users If you have received this communication in error we would appreciate you advising us either by telephone or return of e-mail. The contents of this message, and any attachments, are the property of DataVox, and are intended for the confidential use of the named recipient only. If you are not the intended recipient, employee or agent responsible for delivery of this message to the intended recipient, take note that any dissemination, distribution or copying of this communication and its attachments is strictly prohibited, and may be subject to civil or criminal action for which you may be liable. Every effort has been made to ensure that this e-mail or any attachments are free from viruses. While the company has taken every reasonable precaution to minimise this risk, neither company, nor the sender can accept liability for any damage which you sustain as a result of viruses. It is recommended that you should carry out your own virus checks before opening any attachments. Registered in England. No. 27459085.
On Wed, 2011-04-13 at 10:28 +0100, Andrew Thomas wrote:> BTW - extensions.conf has mySQL functions built in - so no external > script is actually needed. > >Could you point me in the right direction for that? -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062
On Wed, 2011-04-13 at 10:32 +0100, Ishfaq Malik wrote:> On Wed, 2011-04-13 at 10:28 +0100, Andrew Thomas wrote: > > BTW - extensions.conf has mySQL functions built in - so no external > > script is actually needed. > > > > > Could you point me in the right direction for that? >Ignore that, I just realised what you meant... -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062
http://www.voip-info.org/wiki/view/Asterisk+cmd+MYSQL And yes, I meant "Asterisk has mySQL commands built in [that can be accessed via. extensions.conf]". Sorry if I mislead. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Ishfaq Malik Sent: 13 April 2011 10:33 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Realtime SIP & peer status On Wed, 2011-04-13 at 10:28 +0100, Andrew Thomas wrote:> BTW - extensions.conf has mySQL functions built in - so no external > script is actually needed. > >Could you point me in the right direction for that? -- Ishfaq Malik Software Developer PackNet Ltd Office: 0161 660 3062 -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users If you have received this communication in error we would appreciate you advising us either by telephone or return of e-mail. The contents of this message, and any attachments, are the property of DataVox, and are intended for the confidential use of the named recipient only. If you are not the intended recipient, employee or agent responsible for delivery of this message to the intended recipient, take note that any dissemination, distribution or copying of this communication and its attachments is strictly prohibited, and may be subject to civil or criminal action for which you may be liable. Every effort has been made to ensure that this e-mail or any attachments are free from viruses. While the company has taken every reasonable precaution to minimise this risk, neither company, nor the sender can accept liability for any damage which you sustain as a result of viruses. It is recommended that you should carry out your own virus checks before opening any attachments. Registered in England. No. 27459085.
Fair enough. Then if this is really what you want I guess an AGI is the best way to go. As for load - well, that depends on how many concurrent connections you figure on having [and of course the platform it's all on]. -----Original Message----- From: asterisk-users-bounces at lists.digium.com [mailto:asterisk-users-bounces at lists.digium.com] On Behalf Of Jonas Kellens Sent: 13 April 2011 10:39 To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Realtime SIP & peer status On 04/13/2011 11:28 AM, Andrew Thomas wrote:> Maybe I should have asked 'why do you want to put the status in to a > mySQL database'? > > BTW - extensions.conf has mySQL functions built in - so no external > script is actually needed.Well, I read out this information in a website which serves as a comprehensible GUI. I know I can use mysql-functions in the dialplan, but when I need to write something on answering, then I need the AGI-option of the Dial()-command. Kind regards, Jonas. -- _____________________________________________________________________ -- Bandwidth and Colocation Provided by http://www.api-digital.com -- New to Asterisk? Join us for a live introductory webinar every Thurs: http://www.asterisk.org/hello asterisk-users mailing list To UNSUBSCRIBE or update options visit: http://lists.digium.com/mailman/listinfo/asterisk-users If you have received this communication in error we would appreciate you advising us either by telephone or return of e-mail. The contents of this message, and any attachments, are the property of DataVox, and are intended for the confidential use of the named recipient only. If you are not the intended recipient, employee or agent responsible for delivery of this message to the intended recipient, take note that any dissemination, distribution or copying of this communication and its attachments is strictly prohibited, and may be subject to civil or criminal action for which you may be liable. Every effort has been made to ensure that this e-mail or any attachments are free from viruses. While the company has taken every reasonable precaution to minimise this risk, neither company, nor the sender can accept liability for any damage which you sustain as a result of viruses. It is recommended that you should carry out your own virus checks before opening any attachments. Registered in England. No. 27459085.
Rather than add extra overhead to your dialplan and the asterisk server, why not make use of the AMI and have a background process listening for the various events and updating your database accordingly ? See http://www.voip-info.org/wiki/view/asterisk+manager+events#ExtensionStatusEvent and http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.5/lib/Asterisk/AMI.pm#Events Regards, Rob On Wed, 13 Apr 2011 10:15:30 +0200, Jonas Kellens wrote:> Hello, > > I'm using SIP realtime with MySQL DB. > > Is itpossible to get the status of the SIP peer (free / calling) from this realtime DB ?> > If not, is there another way to obtain the call stateof a SIP peer ?> > Kind regards, > Jonas.-------------- next part -------------- An HTML attachment was scrubbed... URL: <http://lists.digium.com/pipermail/asterisk-users/attachments/20110413/07c9694e/attachment.htm>
On 04/13/2011 09:18 PM, Rob Coward wrote:> > Rather than add extra overhead to your dialplan and the asterisk > server, why not make use of the AMI and have a background process > listening for the various events and updating your database accordingly ? > > See > http://www.voip-info.org/wiki/view/asterisk+manager+events#ExtensionStatusEvent > and > http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.5/lib/Asterisk/AMI.pm#Events > > Regards, > > Rob >Hello, this event tells me something about an extension, but not about the SIP peer status. Kind regards, Jonas.
Registry type Event will give you information about your peer. Adolphe Cher-aime From my Iphone On Apr 15, 2011, at 1:15 AM, Jonas Kellens <jonas.kellens at telenet.be> wrote:> On 04/13/2011 09:18 PM, Rob Coward wrote: >> >> Rather than add extra overhead to your dialplan and the asterisk >> server, why not make use of the AMI and have a background process >> listening for the various events and updating your database >> accordingly ? >> >> See http://www.voip-info.org/wiki/view/asterisk+manager+events#ExtensionStatusEvent >> and http://search.cpan.org/~greenbean/Asterisk-AMI-v0.2.5/lib/Asterisk/AMI.pm#Events >> >> Regards, >> >> Rob >> > > Hello, > > this event tells me something about an extension, but not about the > SIP peer status. > > Kind regards, > Jonas. > > -- > _____________________________________________________________________ > -- Bandwidth and Colocation Provided by http://www.api-digital.com -- > New to Asterisk? Join us for a live introductory webinar every Thurs: > http://www.asterisk.org/hello > > asterisk-users mailing list > To UNSUBSCRIBE or update options visit: > http://lists.digium.com/mailman/listinfo/asterisk-users