Re: [asterisk-users] Play a number of files to a caller

2010-08-30 Thread Elliot Otchet
-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Julian 
Lyndon-Smith
Sent: Monday, August 30, 2010 2:59 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Play a number of files to a caller

Hi Tilghman , thanks for the help.

ControlPlayback can't be used with ExternalIVR, can it ?

We use ControlPlayback in our current dialplan, what I am wanting (in
concept) is to have a meetme/conference room where one of the parties is a 
caller, and the other party a file to be controlplaybacked by the caller ;)

Best I have come up with so far is to start an attendant menu, get some curl 
data,  if blank WaitExten() loop back to start, if not ControlPlayback the 
data. If I also background() some music file, will that play while the loop is 
running ? I suspect that it will start again from the beginning.

Julian

On 29 August 2010 18:17, Tilghman Lesher  wrote:
> On Sunday 29 August 2010 03:32:07 Julian Lyndon-Smith wrote:
>> Still can't figure out how to fastforward / rewind the current file
>> being played.
>
> core show application ControlPlayback
>
Using the AGI approach, you can also control the start and stop of Music on 
Hold.  Using this approach, I was able to mix Music on Hold and a program I 
wrote to check for new mail (my event in this case was an IMAP NewMail notify 
event) - when new mail was identified, I was able to convert it using a TTS 
engine and play it back for the user using ControlPlayback.  The start and stop 
of Music on Hold was key for me.  It was non-blocking audio playback.

YMMV.

Regards,

Elliot

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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


Re: [asterisk-users] Connecting two calls with Originate

2010-08-09 Thread Elliot Otchet


-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Monday, August 09, 2010 7:13 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Connecting two calls with Originate

On Mon, 9 Aug 2010, Kathryn Jones wrote:

> I have been working on this for a while today, and still no luck. This is my 
> script:
>
> #!/usr/bin/php
>  $errno=0;
> $errstr=0;
> $fp = fsockopen ("localhost",5038,$errno,$errstr,20);
> if (!$fp) {
> echo "$errstr ($errno)\n"; } else {
>
>  fputs($fp, "Action: Login\r\n");
>  fputs($fp, "Username: \r\n");
>  fputs($fp, "Secret: \r\n");
>  fputs($fp, "Events: off\r\n");
> sleep(1);
>  fputs($fp, "Action: Originate\r\n");
>  fputs($fp, "Channel: SIP/trunk/1DIDNumber\r\n");
>  fputs($fp, "Context: CallContext\r\n\r\n");
>  fputs($fp, "Exten: NumberToCall\r\n");
>  fputs($fp, "Priority: 1\r\n");
>  fputs($fp, "Timeout: 3\r\n");
> sleep(2);
> fclose($fp);
> }
> ?>
>
> It seems simple enough, And I have no compilation errors. This is my output:
>
>  -- Launched AGI Script /var/lib/asterisk/agi-bin/MyScript.php
> AGI Tx >> agi_request: MyScript.php
> AGI Tx >> agi_channel:
> SIP/xx.xx.xxx.xx-0111 AGI Tx >>
> agi_language: en AGI Tx >> agi_type: SIP
> AGI Tx >> agi_uniqueid: 128139.000
> AGI Tx >> agi_version: 1.6.2.6
> AGI Tx >> agi_callerid: 1PhoneThatCalled
> The DID AGI Tx >> agi_calleridname: unknown
> AGI Tx >> agi_callingpres: 0
> AGI Tx >> agi_callingani2: 0
> AGI Tx >> agi_callington: 0
> AGI Tx >> agi_callingtns: 0
> AGI Tx >> agi_dnid: IncomingExt
> AGI Tx >> agi_rdnis: unknown
> AGI Tx >> agi_context: default
> AGI Tx >> agi_extension: incomingExt
> AGI Tx >> agi_priority: 3
> AGI Tx >> agi_enhanced: 0.0
> AGI Tx >> agi_accountcode:
> AGI Tx >> agi_threadid: -123700
> AGI Tx >>
>   == Manager 'Man' logged on from 127.0.0.1
>   == Manager 'Man' logged off from 127.0.0.1
> AGI Rx << AGI Tx
> >> 510 Invalid or unknown command [Aug  9 17:44:10] ERROR[25594]:
> utils.c:1128 ast_carefulwrite: write() returned error: Broken pipe
> [Aug  9 17:44:10] ERROR[25594]: utils.c:1128 ast_carefulwrite: write()
> returned error: Broken pipe
> -- AGI Script MyScript.php completed,
> returning 0
>
> Could someone please point me in the right direction?

This is not an AGI, this is an AMI :)

AGI is a protocol where Asterisk creates a process and sends it the "AGI 
environment" (all the "AGI Tx >> agi_xxx" cruft above") and then waits for your 
process to issue requests and read responses. This "request, response" is 
repeated as your process completes it's tasks and exits.

Are you expecting your script to execute within the "context" of a channel 
within Asterisk or as a process external to Asterisk?

I read your original request:

> I want to connect an open call with an extension. I call in with a
> DID, them redirect to the extension using AGI. Can I use agi's
> originate to make the second call without dropping the first DID call?
> How would I go about this?

as "I call in, I execute an AGI that looks up an extension based on some 
criteria, I want to dial that extension."

If this is close, the AGI should set a channel variable with the value of the 
extension and exit. Your dialplan would look something like:

exten = my-did,1,   verbose(${ext...@${context})
exten = my-did,n,   agi(lookup-extension)
exten = my-did,n,   dial{${LOOKED-UP-EXTENSION})
exten = my-did,n,   hangup()


If you are doing what Steve has described, and you require php, you should 
really check out PHPAGI (http://phpagi.sourceforge.net/).  It's a great 
framework for using both AGI and the AMI in PHP.  If you need just the AGI 
component and are going to be doing this on a large scale, google cagi 
(http://sourceforge.net/projects/cagi/).  It is structured similarly to PHPAGI.

--
Elliot Otchet
Calling Circles LLC

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that

Re: [asterisk-users] Poor-man's paging through multiple phones?

2010-07-23 Thread Elliot Otchet

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Peter Pauly
Sent: Friday, July 23, 2010 10:33 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Poor-man's paging through multiple phones?

We're mostly Cisco CallManager with some SIP and Asterisk.

I want someone at one of our locations to be able to dial and number and have 
Asterisk simultaneously dial several Call-Manager extensions which are set to 
auto-answer and talk into the phone creating a sort of paging system.

We have informacast, but it is too cumbersome for the users.

I know Asterisk can ring several phones at the same time... if one of them 
answers, the others stop right?

--
True, but you could have your paging app record the announcement and then play 
the recording out via an AGI/AMI Originate to each phone.

If you're looking more for a hoot-and-holler system, use the AGI/AMI Originate 
to dial the extensions and place the phones into a MeetMe/Conference bridge.

For the simultaneous dialing part, be sure to research the Async option on 
Originate.  The increased performance is quite noticeable in applications like 
this.

PERL/C/PHP/'Rails/Java, choose your weapon.  If you've got the CM set up 
already, each of the AGI/AMI frameworks should have examples on how to do 
Originate calls.

-Elliot





This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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


Re: [asterisk-users] browser pop-up on call ring

2010-07-12 Thread Elliot Otchet
Sanjay,

http://www.callingcircles.com

Check out the Browser Screen Pop feature.

Regards,

Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of RSCL Mumbai
Sent: Monday, July 12, 2010 3:59 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] browser pop-up on call ring

Hi,

I am looking for a Windows Desktop based application which will open a web 
browser with the below url upon CALL RING on the softphone.

http://192.168.1.4:3100/popup.php?did=DNID (where DNID is the called DID number)

Let me know for any help!!

Thank you.
Best regards,
Sanjay


This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.
-- 
_
-- 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

Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL function be used to retrieve info about OTHER channels?

2010-06-22 Thread Elliot Otchet
Get it via the AMI.  If you're already using PHPAGI, it is trivial to get this 
data.  You can even find an example of how to call "sip show peers" and output 
the resulting response.  You avoid using the (-rx) and you get the data you 
were looking for.

http://phpagi.sourceforge.net/phpagi2/docs/phpAGI/AGI_AsteriskManager.html

If you're already using PHPAGI often on a busy system, you 
might want to get more ram, use fastagi to move the PHP load to another system, 
or take Steve Edward's standard advice and rewrite it in C.  

-Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of bruce bruce
Sent: Tuesday, June 22, 2010 1:32 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Dialplan Gurus? Can Asterisk 1.4x CHANNEL 
function be used to retrieve info about OTHER channels?

Thanks Tiago and Tzafrir. I agree with the heavy load that Tzafrir mentioned. I 
already made a phpagi that does a system() for asterisk -rx and it's not very 
responsive at time.

So what is the solution guys?

You see, I only want to know if g729 is being used because I want to determine 
if a trunk is being used or not. Now, don't be hasty and suggest GROUP_COUNT to 
me as I can not use that because I can only see the calls by "sip show peers" 
or "core show channels" and "group show channels" doesn't show me any channels 
because I do not have control over the calls place as they are placed by 
A2Billing.

Any more Gurus want to weigh in more?

On Tue, Jun 22, 2010 at 6:42 AM, Tzafrir Cohen 
mailto:tzafrir.co...@xorcom.com>> wrote:
On Tue, Jun 22, 2010 at 11:25:29AM +0100, Tiago Geada wrote:
> Hi!
>
> If it was me, I would create a bash script calling asterisk -vrx "core show
> commands"
>
> something like:
>
> for chan in $(asterisk -vrx "core show channels concise");
> do
> asterisk -vrx "core show channel $(echo $chan|cut -d \! -f1)"|grep -i
> native;
> done
The overhead of each 'asterisk -rx' command is noticable. If you have 10
calls or more, this can have an odd effect.

Not to mention that the fact that it is so slow exposes its raciness[1].

>
> On 21 June 2010 16:08, bruce bruce 
> mailto:bruceb...@gmail.com>> wrote:
>
> > Hi Everyone,
> >
> > I want to know if a specific codec type is used at least one. For example,
> > I want to know if out of the 100 calls on the system if there is a 1 channel
> > that is running G.729 codec right now. If using dial-plan and I dial in, I
> > can use this to obtain information about CURRENT channel. But it won't allow
> > me to obtain information about OTHER channels and that is what I want to do.
> > I want a search for all channels and an output spit out as g729 or TRUE or
> > FALSE if there is a g729 channel.
> >
> > exten => s,1,Answer()
> > exten => s,n,Set(foo=${CHANNEL(audioreadformat)})
> > exten => s,n,NoOp(${foo})
> >
> > Above  NoOp spits out g729 if I call in with a g729 codec. But I want 
> > that to be about other channels and not the one I am calling into.
> >
> > Thanks,
> >
> > Bruce
[1] Which should naturally be fixed using locks :-)

--
  Tzafrir Cohen
icq#16849755  
jabber:tzafrir.co...@xorcom.com
+972-50-7952406   
mailto:tzafrir.co...@xorcom.com
http://www.xorcom.com  
iax:gu...@local.xorcom.com/tzafrir

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



This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.
-- 
_
-- 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

Re: [asterisk-users] ODP: Re: Changing labels on Phones

2009-11-16 Thread Elliot Otchet
You're right - this doesn't sound like VLAN problem (but maybe a VLAN issue is 
slowing the firmware download down, I can't tell.  Can you?).  This is a 
problem of trying to reproduce "extension mobility" like features in 
CallManager and the like.
You're right - rebooting does take a while.  In 2001 it was slow.  It is still 
slow today.
Yes - you can fake the user out (maybe) by updating images on the phone.  Yes 
you can push content to the phone, or push content that triggers a pull.  In 
2002, I demonstrated something similar to Ciptec's product at Cisco's IP 
Telephony Apps Showcase in 2002.  (I think I'm still on a DVD interview of that 
somewhere.  Yikes!!)  As others have stated, you can use fun features like 
idle_url, the services button, or push mechanisms to change the content on the 
screen at any given time.

If that was what the original post was about, we'd be done.  It wasn't.

Here's the original thread:

" We have several types of phones, Cisco 79xx, Aastra 9133i etc. We have a 
"hotdesk" type system where anyone can log on to an extension - however what I 
would love to do is relabel the phone with the current "owner" when this logon 
happens. I know that I can change the sip.conf and phones tftp file, however 
this is a big problem with the Cisco's as they take *forever* (ok, maybe 2 / 3 
minutes) to reboot (VLAN problem)

1) Has anyone actually solved this VLAN issue with the cisco ?
2) Is there any way of changing a label without rebooting the phone ?

TIA
Julian"

So for the archives, the prescribed method from Cisco to change the phone's 
configuration (e.g. the label) without  causing the phone 
to reboot [and take 3 minutes of productivity away from an employee] is to 
issue an "erase protflash" from the phone's telnet console.  This will allow 
the OP to change the label for the phone [line] for the end user without the 
painful reboot.  When a Cisco phone is running the SIP firmware, it erases the 
current SIP configuration and requests the configuration files from the TFTP 
server.  It does it rather quickly (at roughly 11 seconds).  You must have the 
telnet_level set to 2 and a phone_password already set in the configuration 
loaded on the phone.  If not, update the configuration files to on the TFTP 
server (either SipDefault.cnf or the SIP.cnf file) to set these settings 
and reboot the phone.  As long as the telnet_level is set to 2 and a 
phone_password is set and loaded into the phone's active configuration, you 
should be able set to update the configuration remotely without the need to 
reboot the phone.

Now - can we get more information about the VLAN issue you're having?

-Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jacek Blaschke
Sent: Monday, November 16, 2009 12:20 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] ODP: Re: Changing labels on Phones

It is not the VLAN problem. Simply reboot of the 79xx takes up to 3 minutes and 
we found no way to speed it up (phones works with Call Manager and VLAN's are 
not implemented).
There are some other methods to display content on the phone screen without 
editing local configs. Check http://www.ciptec.co.uk/ - commercial site but 
shows the way.

Jacek

- Wiadomość oryginalna -
Od:: Elliot Otchet 
Data:: Poniedziałek, 16 Listopad 2009 17:35
Temat: Re: [asterisk-users] Changing labels on Phones

> If you just want to change the SIP configuration on the phone
> remotely there are a few prerequisites:
>
> 1) Upgrade your phone's firmware to a recent release.
> In the phone's config file on the tftp server:
> 2) Set telnet_level set to 2.  Make sure it stays at 2 when you
> create your new config file for the phone, otherwise you won't be
> able to redo this via telnet.
> 3) You need a phone_password set.
> If the phone was not loaded with the telnet_level at 2, you will
> need to reboot the phone manually first for this method to work.
>
> With those two items out of the way, you (or your script/program)
> can telnet to the phone and issue an "erase protflash" which will
> cause the phone to erase the current SIP configuration and re-read
> the SIP config files only - without the painful reboot.  Takes
> about 11 seconds on my old 7960 to do.
>
> There are some security risk associated with the above, but if you
> understand them and live with them or can mitigate them in other
> ways, you're set.
>
> -Elliot
>
> -Original Message-
> From: asterisk-users-boun...@lists.digium.com [mailto:asterisk-
> users-boun...@lists.digium.com] On Behalf Of Jonathan Thurman
> Sent: Monday, November 16, 2009 10:20 AM
> To: Asterisk Us

Re: [asterisk-users] Changing labels on Phones

2009-11-16 Thread Elliot Otchet
If you just want to change the SIP configuration on the phone remotely there 
are a few prerequisites:

1) Upgrade your phone's firmware to a recent release.
In the phone's config file on the tftp server:
2) Set telnet_level set to 2.  Make sure it stays at 2 when you create your new 
config file for the phone, otherwise you won't be able to redo this via telnet.
3) You need a phone_password set.
If the phone was not loaded with the telnet_level at 2, you will need to reboot 
the phone manually first for this method to work.

With those two items out of the way, you (or your script/program) can telnet to 
the phone and issue an "erase protflash" which will cause the phone to erase 
the current SIP configuration and re-read the SIP config files only - without 
the painful reboot.  Takes about 11 seconds on my old 7960 to do.

There are some security risk associated with the above, but if you understand 
them and live with them or can mitigate them in other ways, you're set.

-Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jonathan Thurman
Sent: Monday, November 16, 2009 10:20 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Changing labels on Phones

> [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Julian
>
> We have several types of phones, Cisco 79xx, Aastra 9133i etc. We have a
> "hotdesk" type system where anyone can log on to an extension - however what
> I would love to do is relabel the phone with the current "owner" when this
> logon happens. I know that I can change the sip.conf and phones tftp file,
> however this is a big problem with the Cisco's as they take *forever* (ok,
> maybe 2 / 3 minutes) to reboot (VLAN problem)
> 1) Has anyone actually solved this VLAN issue with the cisco ?
> 2) Is there any way of changing a label without rebooting the phone ?
> TIA

I have not personally tried this, but I remember someone had posted a
way to script the change of the background image on Cisco 79x1 phones.
 You could create a dynamic image in PHP that had the user info on it,
then kick off the script to change the background image.  Might be a
little tricky, but no reboot required!

-Jonathan

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

___
-- 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] Queues with unavailable members

2009-10-15 Thread Elliot Otchet

That shouldn't be too hard to accomplish.  If you've got the addons (and mysql) 
installed you could store them in a MySQL table (timestamp, device) and have a 
cron job set to run at X frequency that un-pauses the queue members via AMI.  
Don't want to go to MySQL?  Use system() to 'touch' files named after devices.  
Then have your cron script go through the files by creation date.  Either way 
gets you there.

-Elliot

-Original Message-
From: Benny Amorsen [mailto:benny+use...@amorsen.dk]
Sent: Thursday, October 15, 2009 5:06 AM
To: Elliot Otchet
Cc: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: Queues with unavailable members

Elliot Otchet  writes:

> Have you tried autopause=yes in your queue configuration? You can then
> unpause the member by either the dialplan (e.g. having the cell phone
> user "log back in") or using an AMI based program to change the
> "paused" state.
>
> You can read more about the latter here:
> http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-F-30.html

That looks very interesting, thank you!

First of all though I need to avoid having them autopause just because
they don't answer their phone. It should only happen if the call to
their phone fails completely. I guess that could be done by not doing
autopause but instead pausing "manually" in the context that the Local
call passes through.

That would also solve my second problem, which is that I need to pause
it in all queues, not just one queue.

The last challenge is to somehow unpause them after a while. In
traditional programming that would be something like keeping a list of
timeout,queuemember ordered by timeout, and then when every call comes
in unpause and remove the ones where timeout expired... I'm not sure
that I can make an ordered list in the dialplan though. I may have to
resort to AGI, but I still need somewhere to actually store the list.
Tricky.


/Benny


This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Queues with unavailable members

2009-10-14 Thread Elliot Otchet
Have you tried autopause=yes in your queue configuration?  You can then unpause 
the member by either the dialplan (e.g. having the cell phone user "log back 
in") or using an AMI based program to change the "paused" state.

You can read more about the latter here:  
http://astbook.asteriskdocs.org/en/2nd_Edition/asterisk-book-html-chunk/asterisk-APP-F-30.html

-Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Benny Amorsen
Sent: Wednesday, October 14, 2009 7:58 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Queues with unavailable members

We have the possibly rather unique setup where we have cell phones
posing as SIP devices. The SIP registration for those unfortunately
doesn't go away just because the phone is off, since the registration is
done by our cell-phone<=>SIP gateway, and that gateway has no way of
knowing whether the phone is on or off.

This is usually ok, but it gets problematic if the cell phone is a
member of a queue. In that case Queue() keeps sending the call to the
phone, and the cell-phone<=>SIP gateway dutifully makes a call, which is
then rejected by the cellular network. A few seconds later, Queue()
tries again. This needlessly wastes resources both in Asterisk and in
the cellular network.

One idea is to run the call through chan_local (we do this anyway
because we need to format the caller-ID differently for different
phones) and then record if a call is rejected, and for the next
30 seconds just abort if we are asked to send a call to that particular
phone. The downside is that we are still running a call through part of
the dial plan, but at least it can be done in perhaps 3 lines of code.

I would very much like to hear about smarter ways to do it.


/Benny



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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Call Recording and Posting

2009-10-13 Thread Elliot Otchet
Steve's spot on about wanting to move the calls when they're available.  We're 
the instant gratification society.

Anytime I've linked multiple independent systems together I've always had to 
plan for one system being offline - either for maintenance, upgrades, etc. so 
please consider that in your solution.  Your successor will thank you for that 
too!  If you were only posting per call via AGI, then you might have some 
issues if the receiving server was unavailable.  Ivan's solution handles that 
cleanly (it would simply try moving the file again when the script is invoked 
again).  What to do?...Combine approaches!!

You could add some error checking to Ivan's script that tests if the file 
system is mounted (or another copy of the script is running) before invoking 
the other commands and exit if it is (e.g. look at the exit status code of 
curlftpfs, maybe?).

Doing so gives you three major benefits:
Prevents multiple copies of the script from running and trying to process the 
same file (low probability, but theoretical)
Lets you call the script more frequently without having to worry about multiple 
processes running simultaneously (the need to manage your concurrency).
Gives you a way to safely call this on a per call basis from the dialplan 
(right after the h,1,System(move the file to the upload directory)) to get the 
trigger for instant gratification.

To Steve's other point, you could put all of this into an AGI program/script, 
but you'll still also need a fallback mechanism to actually copy the files to 
the remote server in the event that it is unavailable/unreachable.  To me, 
having two lines in the dialplan versus one is no big deal.  Just make sure you 
add comments for it so your successors know the logic behind the code.

Just some more thoughts.

-Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Ivan Stepaniuk
Sent: Tuesday, October 13, 2009 3:01 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Call Recording and Posting

Steve Edwards wrote:
> On Tue, 13 Oct 2009, Dan Journo wrote:
>
>
>> To avoid the problem of deleting/copying calls that are still being
>> recorded, I could record the call into a temp directory. Then using the
>> dial plan, I could copy the temp recording into the ftp root directory
>> once the call has ended.
>>
>
> True, but if you need to execute a process at the end of the call, why not
> make it an AGI and hide all the ugly details and keep your dialplan nice
> and clean and shiny and maintainable?
>
> Your recordings will be "instantly" available and the correct operation of
> your system does not depend on an externally scheduled external process
> involving clear-text passwords and obscure packages. Your successor will
> thank you :)
>
This is true, doing everything from inside an AGI script would be nicer,
the ugly part comes if you are tied to an old and ugly FTP server,
specially if its from a hosting provider that limits the connection
count to 2, or so. AGI+sshfs/scp/nfs/whateverfs... would be much more
clean&shiny (tm).

--
Iván Stepaniuk
Alba Fotónica S. L.
www.albafotonica.com


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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Call Recording and Posting

2009-10-11 Thread Elliot Otchet
Dan,

You can do this directly in the dialplan.  See the System command.  It allows 
you to call any program on the system (ftp, scp, mv, etc).  Keep in mind that 
depending on the volume of calls you're handling, you might run into I/O issues 
on the disk side.  If you're talking about a machine under enough load, you 
might need another alternative.

-Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Dan Journo
Sent: Sunday, October 11, 2009 7:15 PM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Call Recording and Posting

Hello,

I'm working on a call recording solution. I would like recordings to either be 
automatically uploaded via FTP, or posted to a URL for processing by our main 
server.

Is Asterisk capable of doing this or will I have to create a separate 
application that monitors a temp directory for new recordings?

I ask because I don't have any experience in Linux programming, so I won't be 
able to create a monitoring program on my own.

Many thanks
Dan Journo



This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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

Re: [asterisk-users] Server-side scripting when SIP phones register

2009-10-08 Thread Elliot Otchet
H Oliver,

You may be able use AMI to catch the Register event (PeerStatus or Registry - 
depending on what you're trying to do and how often you need to do it) and 
SIPpeers to get the device address.
YMMV.

For example, when a SIP device "registers" to asterisk for the first time, you 
see the following event from AMI:
Event: PeerStatus
Privilege: system,all
Peer: SIP/
PeerStatus: Registered

The SIPpeers request will give you entries that look like this:
Event: PeerEntry
Channeltype: SIP
ObjectName: 
ChanObjectType: peer
IPaddress: 10.10.X.Y
IPport: 5060
Dynamic: yes
Natsupport: no
VideoSupport: yes
ACL: no
Status: OK (96 ms)
RealtimeDevice: no

With some manipulation, you can match the Peer in the PeerStatus event with the 
ObjectName in the PeerEntry event.  Now you have the notice of the registration 
and the IP address of the device.

Keep in mind that you may also see the events like below in the natural course 
of business as a result of a vendor's implementation of the SIP specification:
Event: PeerStatus
Privilege: system,all
Peer: SIP/
PeerStatus: Unregistered
Cause: Expired

Quickly followed by:
Event: PeerStatus
Privilege: system,all
Peer: SIP/
PeerStatus: Registered

These are due to registrations expiring and the device registering again.  The 
frequency of this is largely controlled by the device and you'll have to check 
with your vendor(s) on how often you'll see those.  This may have an impact on 
your design, but it's important to note that the device doesn't just register 
once and go away.

Once you've captured that, there are a variety of ways to send the SIP MESSAGE 
back to the phone.  Sipsak and some other tools do a fairly good job, but 
you'll need to evaluate if they meet your scaling needs.

Regards,

Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Olivier
Sent: Thursday, October 08, 2009 10:30 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Server-side scripting when SIP phones register

Hi,

Some IP Phones (Aastra) are able to send a custom HTTP request just after 
registration completion.
Using this, it is possible to update phone's screen with messages like "Do Not 
Disturb" or "Forwarded To VM".

RFC 3680 (http://www.faqs.org/rfcs/rfc3680.html) provides a mecanism to support 
these interactions.

To my knowledge, this RFC is not implemented yet in Asterisk.
Has someone found a workaround to that some scripting could be run whenever a 
SIP phones registers ?

Regards


This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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

Re: [asterisk-users] Multiple user registration ...

2009-08-26 Thread Elliot Otchet
Your first example illustrates why having multiple devices registered as the 
same entity is a bad idea.  It is impossible to differentiate between each 
device when you have multiple registering as the same entity.

My users also really like setting up rules per device/per caller.  When you 
treat a group of devices as one, you make it really hard to do that.

On your theoretical "virtual" devices in Asterisk - you either have a device or 
you don't.  The device will need to register in order to receive a call, so if 
you're expecting to do some magic on the registration to have a user who 
registers with the credentials of user 101 and be assigned to user 101-001, 
you'll be disappointed in the results.

Also, you'll want to steer away from using hyphens in your sip device names.  
Hyphens are used in the SIP channel driver for a special purpose and using them 
in your device names may cause problems.  See 
http://www.digium.com/handbook-draft.pdf page 19 for more info.  If you're 
looking for a good separator, try using the underscore (_) character instead.

All that being said, if you want to register multiple devices with a single set 
of credentials, you might want to check out a SIP Proxy instead of Asterisk's 
SIP B2BUA.  Some can handle multiple registrations with a single set of 
credentials quite nicely.

Regards,

Elliot


-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Mauro Sergio 
Ferreira Brasil
Sent: Wednesday, August 26, 2009 12:19 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Multiple user registration ...

Hi Elliot, and thanks for the reply.

I'm not completely sure you've considered that the SIP users registered
on all devices are the same.
Have you ?

I mean...
How will I use "Dial" command with a sequence of same devices, like:
Dial(SIP/101&SIP/101&SIP/101), for example ?

That's why we are testing the possibility to create "virtual" devices on
subsequent registrations, so we can at the end make something like:
Dial(SIP/101&SIP/101-001&SIP/101-002) if someone dials to SIP/101.
Note: SIP/101-001 and SIP/101-002 don't really exist. They will be
provided by our ARA driver to allow the multiple device ringing.

Thanks and best regards,
Mauro.



Elliot Otchet escreveu:
> Is your goal here to have multiple devices ring when an extension is dialed 
> and the first one to answer take the call?
>
> If so, see the Dial command 
> Dial(Technology/resource&Technology/resource&Technology/resource...[|timeout][|options][|URL]).
>   When multiple technology/resource entries are listed, the first one to 
> answer will take the call.  That accomplishes your goal, if I understand you 
> correctly.
>
> The nice part about doing it this way (with each device independently 
> registered) is that you gain a substantial amount of granularity in 
> controlling where calls go and you don't have to find creative ways (read: 
> unsupported) to trick Asterisk or endpoints.
>
> If you're developing your own GUI to have people set up their devices, you 
> can easily create a wizard that walks them through setting up each device and 
> associating them together through either channel variables or other tables in 
> a database.
>
> I use this methodology in 1.4 and it works quite reliably.  For a good 
> reference, check out http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial or 
> from your Asterisk console try: 'core show application dial'
>
> It's not perfect because you can have devices that do funny things with a SIP 
> INVITE, but in most cases it works very well.
>
> Regards,
>
> Elliot
>
> ___
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
>
> AstriCon 2009 - October 13 - 15 Phoenix, Arizona
> Register Now: http://www.astricon.net
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
>http://lists.digium.com/mailman/listinfo/asterisk-users
>
>
>

--
__At.,
   _

*Technology and Quality on Information*
Mauro Sérgio Ferreira Brasil
Coordenador de Projetos e Analista de Sistemas
+ mauro.bra...@tqi.com.br <mailto:@tqi.com.br>
: www.tqi.com.br <http://www.tqi.com.br>
( + 55 (34)3291-1700
( + 55 (34)9971-2572


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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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

This message is intended only for the use of the individual (s) or entity to 
whi

Re: [asterisk-users] Multiple user registration ...

2009-08-26 Thread Elliot Otchet
Is your goal here to have multiple devices ring when an extension is dialed and 
the first one to answer take the call?

If so, see the Dial command 
Dial(Technology/resource&Technology/resource&Technology/resource...[|timeout][|options][|URL]).
  When multiple technology/resource entries are listed, the first one to answer 
will take the call.  That accomplishes your goal, if I understand you correctly.

The nice part about doing it this way (with each device independently 
registered) is that you gain a substantial amount of granularity in controlling 
where calls go and you don't have to find creative ways (read: unsupported) to 
trick Asterisk or endpoints.

If you're developing your own GUI to have people set up their devices, you can 
easily create a wizard that walks them through setting up each device and 
associating them together through either channel variables or other tables in a 
database.

I use this methodology in 1.4 and it works quite reliably.  For a good 
reference, check out http://www.voip-info.org/wiki/view/Asterisk+cmd+Dial or 
from your Asterisk console try: 'core show application dial'

It's not perfect because you can have devices that do funny things with a SIP 
INVITE, but in most cases it works very well.

Regards,

Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Mauro Sergio 
Ferreira Brasil
Sent: Wednesday, August 26, 2009 10:08 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: [asterisk-users] Multiple user registration ...

Hello there!

We are planning to use Asterisk on our VoIP platform, and we are
spending some brains on a way to provide the following facility: let
some SIP user (extension) registrate with more than one client (ATA,
SoftPhone, VoipCelular, etc) - what isn't a problem at all -, initiate
calls from any of this devices that are registrated with the same user -
no problems on tests too -, but also receive INVITE requests on "all"
devices if someone calls this user - yeah... here the thing gets creepy.
The demand is quite simple: let a user registrate with multiple devices
using the same SIP user on such way that if someone call him, all these
registered devices will ring and the first to take the call will be "the
lucky one".
The demand, as I've said, is quite simple and logical (translated to our
living world), but the reality is a very different history.

On our tests, always is the last registered application/device that
receives the call indication.
And only the last one.

We are making some tests trying to "kind of deceive" Asterisk on second,
third, and additional, registrations so it receives from Realtime "fake"
extensions numbers on such a way that we can use all these fake
extensions to build a queue dinamicaly (through ARA) and provide the
desired "ring on all" functionality.
I think this will lead us to lots of SIP sinalization and multi user
registration problems, but that was the best shot we had here until now.

I would like to know if anyone had the same demand and, maybe, have
found any viable solution to it.

Thanks and best regards,

--
__At.,
   _

*Technology and Quality on Information*
Mauro Sérgio Ferreira Brasil
Coordenador de Projetos e Analista de Sistemas
+ mauro.bra...@tqi.com.br 
: www.tqi.com.br 
( + 55 (34)3291-1700
( + 55 (34)9971-2572


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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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

AstriCon 2009 - October 13 - 15 Phoenix, Arizona
Register Now: http://www.astricon.net

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


Re: [asterisk-users] Web Browser Pop-up

2009-07-24 Thread Elliot Otchet
We'll soon be releasing a second beta.  Contact me off list for more 
information.

It will do both screen pop and enable dialing with Internet Explorer.

Regards,

Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Vincent Renaville
Sent: Friday, July 24, 2009 5:04 AM
To: asterisk-users@lists.digium.com
Subject: [asterisk-users] Web Browser Pop-up

Heelo,

I currently search a program that can make a web browser Pop-up on an incoming 
call on a specific URL like : http://directorie.ch?CALLNUMBER:00451849799

I have found ADM, but it's a bit more complex for my purpose an it's not very 
stable.

Do you know a simple software for that ?

An other part of my project is to eneable click-to-call from a web page, do you 
know a kind of project that implement callto protocol, at this time I use 
Noojee click but It only work with Firefox.

Thanks for your help,

Vincent



This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.
___
-- 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] broken pipe in perl agi

2009-06-05 Thread Elliot Otchet
Scratch that - my bad.  I had a modified version responding.

Nothing like starting a Friday off on the wrong foot.  At least it is happy 
hour somewhere.

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Elliot Otchet
Sent: Friday, June 05, 2009 9:59 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

FYI - It works fine under perl 5.8.8 on RHEL5.2 w/ Asterisk 1.4.24.1

You might want to check your perl modules to see if they're up to date.

Regards,

Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Danny Nicholas
Sent: Friday, June 05, 2009 9:43 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] broken pipe in perl agi

You're on the right track, Steve but that didn't do it either.  Here is the
Perl snippet:
use strict;
use warnings;
my $towatch = $ARGV[0];
my $a=0;
my $retval=undef;
# show hints will get hint information from the dialplan
while ($a<1) {
   my $cmda = '/usr/sbin/asterisk -rx "core show hints"|';
     Get Trunk Information 
   my %lines;
   my $lineseq=0;
   $SIG{'PIPE'} = 'IGNORE';
   open (my $trunk_info,$cmda) or print STDOUT "Broken pipe\n";
   if ($trunk_info) {
  while (<$trunk_info>) {
 if ($_ =~ /internal/) {
if ($_ =~ /$towatch/) {
   $lines{$lineseq} = $_;
   $lineseq++;
   }
}
 }
  close $trunk_info;
  }
   sleep 2;

   for (my $i=0;$i<=$lineseq;$i++) {
  if ($lines{$i}) {
 my $c = unpack("x74 a16", $lines{$i});
 $c =~ s/\s//gx;
 $retval=1;
 print STDOUT "SET VARIABLE LINESTAT \"$c\" \r\n";
 ;
 }
  }
   $a++;
   }
# if /var/run/asterisk.ctl is not mod 777, no result so we return a dummy
Idle
if (! $retval) {
   my $c = "Idle";
   print STDOUT "SET VARIABLE LINESTAT \"$c\" \r\n";
   ;
   }
exit;

If there is an active call on the extension, it works.  If not, the "broken
pipe" message is returned.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Thursday, June 04, 2009 6:37 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

On Thu, 4 Jun 2009, Danny Nicholas wrote:

> Here's what I got from agi debug:
> agi debug
> AGI Debugging Enabled
> *CLI> AGI Tx >> agi_request: hintcheck.agi

[snip]

> AGI Rx << SET VARIABLE LINESTAT="Idle"
> AGI Tx >> 200 result=1
> [Jun  4 13:33:42] ERROR[28261]: utils.c:979 ast_carefulwrite: write()
> returned error: Broken pipe

I'm guessing you're not reading the last "200 result=1" before exiting or
closing the pipe.

Thanks in advance,

Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the 

Re: [asterisk-users] broken pipe in perl agi

2009-06-05 Thread Elliot Otchet
FYI - It works fine under perl 5.8.8 on RHEL5.2 w/ Asterisk 1.4.24.1

You might want to check your perl modules to see if they're up to date.

Regards,

Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Danny Nicholas
Sent: Friday, June 05, 2009 9:43 AM
To: 'Asterisk Users Mailing List - Non-Commercial Discussion'
Subject: Re: [asterisk-users] broken pipe in perl agi

You're on the right track, Steve but that didn't do it either.  Here is the
Perl snippet:
use strict;
use warnings;
my $towatch = $ARGV[0];
my $a=0;
my $retval=undef;
# show hints will get hint information from the dialplan
while ($a<1) {
   my $cmda = '/usr/sbin/asterisk -rx "core show hints"|';
     Get Trunk Information 
   my %lines;
   my $lineseq=0;
   $SIG{'PIPE'} = 'IGNORE';
   open (my $trunk_info,$cmda) or print STDOUT "Broken pipe\n";
   if ($trunk_info) {
  while (<$trunk_info>) {
 if ($_ =~ /internal/) {
if ($_ =~ /$towatch/) {
   $lines{$lineseq} = $_;
   $lineseq++;
   }
}
 }
  close $trunk_info;
  }
   sleep 2;

   for (my $i=0;$i<=$lineseq;$i++) {
  if ($lines{$i}) {
 my $c = unpack("x74 a16", $lines{$i});
 $c =~ s/\s//gx;
 $retval=1;
 print STDOUT "SET VARIABLE LINESTAT \"$c\" \r\n";
 ;
 }
  }
   $a++;
   }
# if /var/run/asterisk.ctl is not mod 777, no result so we return a dummy
Idle
if (! $retval) {
   my $c = "Idle";
   print STDOUT "SET VARIABLE LINESTAT \"$c\" \r\n";
   ;
   }
exit;

If there is an active call on the extension, it works.  If not, the "broken
pipe" message is returned.

-Original Message-
From: asterisk-users-boun...@lists.digium.com
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Steve Edwards
Sent: Thursday, June 04, 2009 6:37 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] broken pipe in perl agi

On Thu, 4 Jun 2009, Danny Nicholas wrote:

> Here's what I got from agi debug:
> agi debug
> AGI Debugging Enabled
> *CLI> AGI Tx >> agi_request: hintcheck.agi

[snip]

> AGI Rx << SET VARIABLE LINESTAT="Idle"
> AGI Tx >> 200 result=1
> [Jun  4 13:33:42] ERROR[28261]: utils.c:979 ast_carefulwrite: write()
> returned error: Broken pipe

I'm guessing you're not reading the last "200 result=1" before exiting or
closing the pipe.

Thanks in advance,

Steve Edwards  sedwa...@sedwards.com  Voice: +1-760-468-3867 PST
Newline Fax: +1-760-731-3000

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

___
-- 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] Asterisk AGI issues (at high load)

2009-06-04 Thread Elliot Otchet
Are you using freetds?  Is it a recent version or something that is a few years 
old?  Are you using a freetds connection pool? 
http://www.freetds.org/userguide/tdspool.htm

Is unixODBC pooling turned on?  See: http://www.unixodbc.org/doc/conn_pool.html 
to understand why this doesn't work with AGI type applications.

Are the AGI's running for the entire duration of the call?   If so, are DB 
open/closes performed immediately before and after each SQL statement?  If not, 
and your AGI is in play during the entire call (which sounds like the case), 
your DB connections are probably timing out.

Does your SQL server have enough CALs to support one (or more depending on your 
logic) or more connections per AGI?  In your fully loaded model, you may be 
hitting a CAL limit.  Are you running server or processor licenses? MSSQL 
"Server" licenses have CALS, "Processor" licenses do not (generally speaking).  
For SQL2008 see: 
http://download.microsoft.com/download/1/e/6/1e68f92c-f334-4517-b610-e4dee946ef91/2008%20SQL%20Licensing%20Overview%20final.docx

Possible ways to move forward:
Re-engineer the application with the current language to only be an AGI when an 
AGI feature is needed.  Make use of DeadAGI or dialplan ODBC extensions (with 
channel variables) if you need to do post call processing (e.g. update the 
hangup time to deduct minutes).

Build your own PHP and optimize it for what you need to do AGI to get the 
memory usage down (if needed).  Yes you really do use significant amounts of 
memory on a vanilla php install per process if you use stock PHP.  If you can 
get away with moving to C, it is orders of magnitude more scalable.  Keep in 
mind though, you may be able to reduce (by significant amounts) the amount of 
system memory you're using by re-engineering the application.  You should also 
consider moving this off your call processing system so AGI processing (with 
scripting languages that use large amounts of memory) can impact your call 
quality.

Regards,

Elliot

From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Deepak
Sent: Thursday, June 04, 2009 1:18 PM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] Asterisk AGI issues (at high load)

BTW,we are using an ODBC connection to Microsoft SQL Server.
We are not using MySQL.

Would that be a possible cause?

Thanks



On Thu, Jun 4, 2009 at 12:31 PM, David Backeberg 
mailto:dbackeb...@gmail.com>> wrote:
On Thu, Jun 4, 2009 at 12:15 PM, Deepak 
mailto:dlal...@gmail.com>> wrote:
> Hi, we are experiencing a strange issue and I am hoping someone can point me
> to the right direction or help out with some pointers.
>
> We have asterisk 1.6.0.6 with a sangome a104DE card. We have basically 4
> T1's for a total of DAHDI 96 channels.
>
> We have an agi application (php) that acts as a kind of a calling card
> application.
>
> All users are SIP users that make calls and asterisk then bridges the calls
> over T1 to the PSTN (after running agi script). Codec between SIP clients
> and Asterisk is G729 (96 G729 licenses installed on Asterisk).
> System has 12 GB of RAM.
>
>
> What we are seeing is the following:
>
> 1) All is fine till about 70 calls (70 active calls as displayed by core
> show channels). But as soon as traffic increases, we see the the a lot of
> AGI Processes are running and the number of active calls keeps on GROWING to
> 120, 130, ... . THis makes no sense since we can have a maximum of 96 active
> calls (4 T1). People calling start experiencing delays (10-15 seconds before
> calls are answered or connected, etc.). Upon doing a "ps -ef" we see a lot
> of AGI processes running that seem to keep growing
There could be a number of external constraints that are causing this.
One that comes to mind to is something waiting for a database
connection, then all the other processes that are waiting for the
database pile up and can't exit until they get their turn.

Do you have a max number of connections on your database? How does the
AGI know what to do based on the 'calling card information'? I'm
guessing you store all that in a database, then deduct what the caller
uses, etc.

You may also enjoy http://us3.php.net/set_time_limit

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



This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without

Re: [asterisk-users] stucked calls in asterisk 1.4

2009-05-28 Thread Elliot Otchet
Stefan,

I'm not sure if you've considered the underlying hardware, firmware, and device 
drivers yet, but I was brought in to evaluate a site under heavy load and was 
able to stabilize things by applying vendor supplied drivers and firmware to 
the system.

What is the underlying hardware (E.g. Dell PowerEdge 2950 Series 3, HP DL380G5, 
etc.) and OS distribution?

I've seen plenty of timing issues (and resulting kernel panics) due to outdated 
firmware or unsupported/inappropriate drivers.  To be clear, in most cases of 
brand named hardware, these will come from the manufacturer's repository (or 
website), not the OS distribution's.

For example, if you're on HP hardware with RHEL 5.X, you might want to check 
HP's website for the latest firmware and kernel modules (e.g. drivers) for your 
system.

Just a thought.

Regards,

Elliot

-Original Message-
From: asterisk-users-boun...@lists.digium.com 
[mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Stefan Schmidt
Sent: Thursday, May 28, 2009 4:50 AM
To: Asterisk Users Mailing List - Non-Commercial Discussion
Subject: Re: [asterisk-users] stucked calls in asterisk 1.4


David Backeberg schrieb:
> On Wed, May 27, 2009 at 1:49 PM, Stefan Schmidt  wrote:
>> all server are in one rack in our datacenter and are connected to an HP
>> Procurve 2650 switch, which has been setup around 3 months ago, cause of
>> the old switch died silent in the night.
>>
>> all server had two interfaces and i have allready tried to route the
>> traffic between the pbx and the routing server over the second
>> interface, where database requests normally run. But this didnt solved
>> the problem too.
>>
>> i will try to increase the UDP buffer size in the linux kernel, maybe
>> this will take some affect.
>
> I will say that asterisk-1.6 is supposed to have a better SIP stack
> than 1.4. Perhaps the difference in performance will help you.
> Specifically, check out:
>
> http://svn.digium.com/svn/asterisk/branches/1.6.0/CHANGES
> http://svn.digium.com/svn/asterisk/branches/1.6.1/CHANGES
>
> I'd recommend you go to at least 1.6.1.* series

i will have a look at 1.6.1 version but the problem is a network/kernel
problem.

i´ve tried to set the udp rcv buffer to 1mb but that didnt change the
problem.

what i can see is that the asterisk itself sometimes lag so no call can
be started, but running calls wont be broken.

in netstat -su i see a big amount of udp packet receive errors when it
lags. Like 600 to 800 pakets per second.

in syslog i cant see anything that would cause asterisk to react like this.

anyone an idea what can cause this problem?

best regards

steve

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

This message is intended only for the use of the individual (s) or entity to 
which it is addressed and may contain information that is privileged, 
confidential, and/or proprietary to Calling Circles LLC and its affiliates. If 
the reader of this message is not the intended recipient, you are hereby 
notified that any dissemination, distribution, forwarding or copying of this 
communication is prohibited without the express permission of the sender. If 
you have received this communication in error, please notify the sender 
immediately and delete the original message.

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