VoiceOps
By thread
voiceops@voiceops.org
By month
Messages by month
- ----- 2026 -----
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2025 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2024 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2023 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2022 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2021 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2020 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2019 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2018 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2017 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2016 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2015 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2014 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2013 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2012 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2011 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2010 -----
- December
- November
- October
- September
- August
- July
- June
- May
- April
- March
- February
- January
- ----- 2009 -----
- December
- November
- October
- September
- August
- July
August 2009
- 77 participants
- 440 messages
Broadworks upgrade security issue
by David_Hiers@adp.com
Yep.
David
-----Original Message-----
From: Justin Ream [mailto:justin.ream at gmail.com]
Sent: Tuesday, August 04, 2009 9:37 AM
To: Hiers, David; voiceops at voiceops.org
Subject: Re: [VoiceOps] Broadworks upgrade security issue
Was this an R14 sp upgrade?
-justin
On 8/4/09, Hiers, David <David_Hiers at adp.com> wrote:
> If you upgrade BW to a new SP or major version, check this setting
> before and after:
>
> WS_CLI/System/ClientSession/LoginAuthLevel
>
> Its reverted to default upon upgrade a couple of times, which was
> really no fun at all.
>
>
>
>
>
> David Hiers
>
> CCIE (R/S, V), CISSP
> ADP Dealer Services
> 2525 SW 1st Ave.
> Suite 300W
> Portland, OR 97201
> o: 503-205-4467
> f: 503-402-3277
>
>
>
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an
> authorized representative of the intended recipient, you are hereby
> notified that any dissemination of this communication is strictly
> prohibited. If you have received this communication in error, please
> notify us immediately by e-mail and delete the message and any attachments from your system.
> _______________________________________________
> VoiceOps mailing list
> VoiceOps at voiceops.org
> https://puck.nether.net/mailman/listinfo/voiceops
>
--
Sent from my mobile device
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Aug. 4, 2009
Broadworks upgrade security issue
by justin.ream@gmail.com
Was this an R14 sp upgrade?
-justin
On 8/4/09, Hiers, David <David_Hiers at adp.com> wrote:
> If you upgrade BW to a new SP or major version, check this setting before
> and after:
>
> WS_CLI/System/ClientSession/LoginAuthLevel
>
> Its reverted to default upon upgrade a couple of times, which was really no
> fun at all.
>
>
>
>
>
> David Hiers
>
> CCIE (R/S, V), CISSP
> ADP Dealer Services
> 2525 SW 1st Ave.
> Suite 300W
> Portland, OR 97201
> o: 503-205-4467
> f: 503-402-3277
>
>
>
> This message and any attachments are intended only for the use of the
> addressee and may contain information that is privileged and confidential.
> If the reader of the message is not the intended recipient or an authorized
> representative of the intended recipient, you are hereby notified that any
> dissemination of this communication is strictly prohibited. If you have
> received this communication in error, please notify us immediately by e-mail
> and delete the message and any attachments from your system.
> _______________________________________________
> VoiceOps mailing list
> VoiceOps at voiceops.org
> https://puck.nether.net/mailman/listinfo/voiceops
>
--
Sent from my mobile device
Aug. 4, 2009
Any subscribers from the UK?
by David_Hiers@adp.com
>From what I recall, the likes of Google, E-Bay, MSN, etc have all gone through several major architecture and implementation phases. Not knowing what they did not know, they built something that was thought to be adequate for the known requirements, and ran it until they started to see smoke. Then they re-built using the lessons learned, and started the whole iterative cycle over again.
Google alone has gone through, what, three different file systems already?
The big guys seem to play by the rules of "You catch the first horse you can, ride it to death, then run off and catch another one to ride to death. You don't get to act surpsised when your horse dies".
David Hiers
CCIE (R/S, V), CISSP
ADP Dealer Services
2525 SW 1st Ave.
Suite 300W
Portland, OR 97201
o: 503-205-4467
f: 503-402-3277
-----Original Message-----
From: voiceops-bounces at voiceops.org [mailto:voiceops-bounces at voiceops.org] On Behalf Of Alex Balashov
Sent: Tuesday, August 04, 2009 4:00 AM
To: Peter Beckman
Cc: voiceops at voiceops.org
Subject: Re: [VoiceOps] Any subscribers from the UK?
Peter Beckman wrote:
>> There is a considerable body of evidence suggesting that although PHP
>> does expose a socket API, using it to do sockets is a terrible idea
>> because it just doesn't perform well at all. I don't know why anyone
>> would write a server - FastAGI or otherwise - in PHP.
>
> I haven't done any tests to see how well or badly PHP does sockets
I haven't either; I suppose there are so many points of view from which doing a serious server in PHP is considered preposterous and misguided that I couldn't find anyone interested in commissioning a study to measure the precise degree to which it is so.
My evidence is anecdotal, and for that reason difficult to relate or cite. I see people trying to do this stuff - for the reasons you mention - and I see it 1) falling over and 2) becoming untenably complex / impossible to maintain / experiencing internally degenerative motion as a codebase.
>> Besides, PHP does not really have the appropriate low-level dimension
>> for heavyweight or nuanced system calls; that's not what it was
>> designed for. Then again, I suppose people make that argument for
>> Java, too.
>
> Untrue: http://us.php.net/manual/en/intro.sockets.php
>
> "The socket extension implements a low-level interface to the socket
> communication functions based on the popular BSD sockets, providing
> the possibility to act as a socket server as well as a client."
I was talking about PHP's character as a rather abstract, application-level runtime environment, not the ability of the interpreter-makers to clunkily expose a low-level system call API somehow. That's done in a lot of languages.
> PHP is more versatile than many people think. It's not as deep zen
> as Perl can be, and there are some frustrating inconsistencies in how
> PHP operates, but it can be powerful in a knowledgable programmer's hands.
The same can be said of almost any language and runtime environment; it is possible to implement almost anything in a language that has a sufficiently broad library, and it is possible to follow better or worse architectural and programming practices in ColdFusion and Bash, too.
I do not know that the capabilities technically present in the runtime interpreter - which are dictated to a fairly large extent by a combination of user demands and the developers' own sense of creativity
- are really a reflection of PHP's "versatility" paradigmatically. As I said, you can write a VM hypervisor in it if the right system calls and API hooks were just available. I think I once read an article about someone that stringed a primitive SSH server out of components all defined and invoked inline from a Bash script; are you moved to say that the fact that it can be done is a testament to Bash's immense power and versatility in the right hands?
It's a fair statement in that context, to be sure, but is it versatile in the sort of way that leads to a viable recommendation as an implementational language for an SSH server? Perhaps the example is incommensurable because Bash certainly doesn't make it easier or more terse to implement one than in a language like Perl or PHP, but even if it did, by code volume, through various improvements to the interpreter's capabilities (much as in PHP): Is that trait the defining one, the only thing holding you back from saying, "Let's write our SSH server in PHP?"
> I think that maybe PHP has improved since you last used it (or so it
> seems). Again, I'm sure there are better ways, but using PHP for
> FastAGI is not as bad as you make it seem. Then again, I'm not doing
> 1,200,000 minutes per day.
I don't know how bad I'm making it seem. I am not suggesting that it is outside the realm of feasibility, especially from a basically functional perspective.
>> It's a qualitative issue -- "just because you can, doesn't mean you
>> should."
>
> Maybe, but if you are a small mom-and-pop and just need it to work,
> reusing already written code for both your web and VoIP applications
> makes a lot of sense. And if they do it right, by using a PHP-based
> FastAGI vs straight AGI(), it can scale fairly well.
It's a fair economic point, although personally, to me, that just says that the business logic that is shared between web and VoIP needs to reside in a common place that still allows the right approaches to be taken on both sides and can be called. Stored procedures, triggers and the like are a common candidate for this in my work; a database call can both figure out which rate center destination a call should be routed to from the call router, and calculate that rate center and cost dynamically for various UI functionality, for example. Or, if the technical argument is there - stemming from the complexity and real-time character of the data needed to make the decisions - perhaps even a real middleware layer of some sort.
Seems to me that the code reuse argument goes so far. Saying that using the same technology on both sides of a very large abstraction and performance domain divide is the most efficient way to lever existing code fails to take into account that maybe you just shouldn't have done the business layer in PHP either, or otherwise have put the code in the wrong place.
What *are* business layers for something like an ITSP call processing platform doing in PHP, anyway PHP is largely a presentation language.
To reiterate in the most emphatic terms, that is not a description of the capabilities of its (phenomenally large) API - as far as I can tell there is little that PHP doesn't technically "have" - but rather a judgment about the "sort of thing that it is" or was intended to be, a genus.
Bash was intended to be a shell and to provide a scripting environment for simple batching of the sort of stuff you'd often do in a shell (complete with very rudimentary flow control and data primitives), even though you could certainly augment its, er, versatility by hacking in more plumbing to the outside (system) world.
Was PHP designed to be a language for standalone scripts and processes?
Does much of the work that goes on in PHP exist to further that particular aim? It's pretty convincing from a cursory survey of the way PHP is progressing that it is - and always has been - about the web. It seems to me that its use for standalone scripts really is an accident of someone deciding it would be nifty to let people run the interpreter from the CLI, which I guess is formally required anyway in order to allow PHP to run in a CGI-style way (not with mod_php) if that is desired.
>> It is within the realm of conception that you could write a virtual
>> machine container/hypervisor in PHP, if only the interpreter exposed
>> the system calls and other primitives you'd need to pull it off. But
>> it's not done for a reason--surely you can agree. (Except perhaps for
>> the novelty/Slashdot factor by someone with far too much time on
>> their
>> hands.)
>
> Given a programmer talented in all languages, absolutely.
It still comes down to the fact that PHP is a very slow layer of interpreted fat and high-level abstraction, and furthermore that its virtues and strengths - of which there are many - have absolutely zero imaginable correlation to the goal of writing a reasonably performing hypervisor. It dimensions well to web applications, not low-level, back-end system processes.
We aren't going to agree on this, although I think we largely agree in the breadth of the overall context. The bottom line really comes down to what you value in the craft. The values of the commercial world often dictate that you should do something in the simplest and cheapest way possible, with no attention paid to the quality, density or longevity of the final product nor the erudition that is brought to bear on the problem. To the extent that one shares those values, one can PHP-AGI one's way out of this problem, sure. Actually, with the amount of call setups and burst volume objectively required in most cottage-industry ITSP operations, you could probably do the whole thing in Bash:
ACCT_ROUTE_VAR=$(echo \
"SELECT id, rt FROM rt_tbl WHERE account = $ACCT LIMIT 1" \
| mysql -u user --password=blah -D database \
| head -n 3 | tail -n 1 | awk -F '|' '{print $2}')
It'll end up on TheDailyWTF.com, but it does work, and will probably continue to work for reasonably large "values of n" that the provider will experience in the near/foreseeable future.
On the other side, there's considerable value to be reaped in the technical excellence of a little overengineering - not excessive, of course, there's always a balance to find. The value is both qualitative to those that value the aesthetic dimension of good programmatic craftsmanship and economic in that the system can grow to meet your needs, including both needs themselves and magnitudes of needs that cannot be reasonably anticipated.
If you and I were charged with developing an integrated technology stack as a competitor to say, BroadWorks or Metaswitch, and the requirement was that it be able to process bursts of, say, 6500 call setups per minute, and you used PHP-AGI and I used something that I find to avoid the pitfalls of that approach, my implementation would win and yours would lose, per given unit of hardware capacity. That issue is completely academic and largely moot because other limitations will be encountered long before that becomes a concern, since Asterisk is in use. :-) Secondly, neither of us is actually building a system that has to handle very bulky logic for 100+ CPS--that's considerably more than most commercial softswitch gear will reliably do. But if we were, I don't think you'd use PHP.
It is not so much more difficult to use the right tool for the right job to begin with; it's not a night or day issue in terms of capital requirements. Even if you'll never need it, it's nice to know that you can rest easy at a lower threshold because you went for the right architecture, as opposed to what many of my customers worry about, which is that doubling their traffic next year will render their architecture completely unusable because it was built with this kind of crap, and is already starting to crack.
I don't make my living by selling customers a geostationary satellite guidance system when they need a horse--there's plenty of that out there, much of it in enterprise-size environments. I know, I know, ITSPs are small companies that have to take the most pragmatic route to achieve anything. But I think that appreciating the long-term benefits of good (perhaps even a little excessive) engineering, as opposed to just putting out today's fire today, is critical to any field of commercial endeavour in technology, regardless.
I realise you don't disagree with me on most of this. I just think that these premises lead to the conclusion that there's no way something like PHP can be the ticket, whereas you clearly don't.
> I like Net::Server::Fork because it allows me to HUP to restart
> (reload new code) the parent process without touching the child
> processes, which means I can put new FastAGI code into production
> without waiting for no calls or worrying about disconnecting existing
> active calls. It is also stable and have not had problems with it in years.
Good to know; I had not considered the soft reload angle. Thanks!
-- Alex
--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775
_______________________________________________
VoiceOps mailing list
VoiceOps at voiceops.org
https://puck.nether.net/mailman/listinfo/voiceops
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Aug. 4, 2009
Broadworks upgrade security issue
by David_Hiers@adp.com
If you upgrade BW to a new SP or major version, check this setting before and after:
WS_CLI/System/ClientSession/LoginAuthLevel
Its reverted to default upon upgrade a couple of times, which was really no fun at all.
David Hiers
CCIE (R/S, V), CISSP
ADP Dealer Services
2525 SW 1st Ave.
Suite 300W
Portland, OR 97201
o: 503-205-4467
f: 503-402-3277
This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system.
Aug. 4, 2009
Any subscribers from the UK?
by abalashov@evaristesys.com
Peter Beckman wrote:
>> There is a considerable body of evidence suggesting that although PHP
>> does expose a socket API, using it to do sockets is a terrible idea
>> because it just doesn't perform well at all. I don't know why anyone
>> would write a server - FastAGI or otherwise - in PHP.
>
> I haven't done any tests to see how well or badly PHP does sockets
I haven't either; I suppose there are so many points of view from which
doing a serious server in PHP is considered preposterous and misguided
that I couldn't find anyone interested in commissioning a study to
measure the precise degree to which it is so.
My evidence is anecdotal, and for that reason difficult to relate or
cite. I see people trying to do this stuff - for the reasons you
mention - and I see it 1) falling over and 2) becoming untenably complex
/ impossible to maintain / experiencing internally degenerative motion
as a codebase.
>> Besides, PHP does not really have the appropriate low-level dimension
>> for heavyweight or nuanced system calls; that's not what it was
>> designed for. Then again, I suppose people make that argument for
>> Java, too.
>
> Untrue: http://us.php.net/manual/en/intro.sockets.php
>
> "The socket extension implements a low-level interface to the socket
> communication functions based on the popular BSD sockets, providing the
> possibility to act as a socket server as well as a client."
I was talking about PHP's character as a rather abstract,
application-level runtime environment, not the ability of the
interpreter-makers to clunkily expose a low-level system call API
somehow. That's done in a lot of languages.
> PHP is more versatile than many people think. It's not as deep zen as
> Perl can be, and there are some frustrating inconsistencies in how PHP
> operates, but it can be powerful in a knowledgable programmer's hands.
The same can be said of almost any language and runtime environment; it
is possible to implement almost anything in a language that has a
sufficiently broad library, and it is possible to follow better or worse
architectural and programming practices in ColdFusion and Bash, too.
I do not know that the capabilities technically present in the runtime
interpreter - which are dictated to a fairly large extent by a
combination of user demands and the developers' own sense of creativity
- are really a reflection of PHP's "versatility" paradigmatically. As I
said, you can write a VM hypervisor in it if the right system calls and
API hooks were just available. I think I once read an article about
someone that stringed a primitive SSH server out of components all
defined and invoked inline from a Bash script; are you moved to say
that the fact that it can be done is a testament to Bash's immense power
and versatility in the right hands?
It's a fair statement in that context, to be sure, but is it versatile
in the sort of way that leads to a viable recommendation as an
implementational language for an SSH server? Perhaps the example is
incommensurable because Bash certainly doesn't make it easier or more
terse to implement one than in a language like Perl or PHP, but even if
it did, by code volume, through various improvements to the
interpreter's capabilities (much as in PHP): Is that trait the defining
one, the only thing holding you back from saying, "Let's write our SSH
server in PHP?"
> I think that maybe PHP has improved since you last used it (or so it
> seems). Again, I'm sure there are better ways, but using PHP for FastAGI
> is not as bad as you make it seem. Then again, I'm not doing 1,200,000
> minutes per day.
I don't know how bad I'm making it seem. I am not suggesting that it is
outside the realm of feasibility, especially from a basically functional
perspective.
>> It's a qualitative issue -- "just because you can, doesn't mean you
>> should."
>
> Maybe, but if you are a small mom-and-pop and just need it to work,
> reusing already written code for both your web and VoIP applications makes
> a lot of sense. And if they do it right, by using a PHP-based FastAGI vs
> straight AGI(), it can scale fairly well.
It's a fair economic point, although personally, to me, that just says
that the business logic that is shared between web and VoIP needs to
reside in a common place that still allows the right approaches to be
taken on both sides and can be called. Stored procedures, triggers and
the like are a common candidate for this in my work; a database call
can both figure out which rate center destination a call should be
routed to from the call router, and calculate that rate center and cost
dynamically for various UI functionality, for example. Or, if the
technical argument is there - stemming from the complexity and real-time
character of the data needed to make the decisions - perhaps even a real
middleware layer of some sort.
Seems to me that the code reuse argument goes so far. Saying that using
the same technology on both sides of a very large abstraction and
performance domain divide is the most efficient way to lever existing
code fails to take into account that maybe you just shouldn't have done
the business layer in PHP either, or otherwise have put the code in the
wrong place.
What *are* business layers for something like an ITSP call processing
platform doing in PHP, anyway PHP is largely a presentation language.
To reiterate in the most emphatic terms, that is not a description of
the capabilities of its (phenomenally large) API - as far as I can tell
there is little that PHP doesn't technically "have" - but rather a
judgment about the "sort of thing that it is" or was intended to be, a
genus.
Bash was intended to be a shell and to provide a scripting environment
for simple batching of the sort of stuff you'd often do in a shell
(complete with very rudimentary flow control and data primitives), even
though you could certainly augment its, er, versatility by hacking in
more plumbing to the outside (system) world.
Was PHP designed to be a language for standalone scripts and processes?
Does much of the work that goes on in PHP exist to further that
particular aim? It's pretty convincing from a cursory survey of the way
PHP is progressing that it is - and always has been - about the web. It
seems to me that its use for standalone scripts really is an accident of
someone deciding it would be nifty to let people run the interpreter
from the CLI, which I guess is formally required anyway in order to
allow PHP to run in a CGI-style way (not with mod_php) if that is desired.
>> It is within the realm of conception that you could write a virtual
>> machine container/hypervisor in PHP, if only the interpreter exposed
>> the system calls and other primitives you'd need to pull it off. But
>> it's not done for a reason--surely you can agree. (Except perhaps for
>> the novelty/Slashdot factor by someone with far too much time on their
>> hands.)
>
> Given a programmer talented in all languages, absolutely.
It still comes down to the fact that PHP is a very slow layer of
interpreted fat and high-level abstraction, and furthermore that its
virtues and strengths - of which there are many - have absolutely zero
imaginable correlation to the goal of writing a reasonably performing
hypervisor. It dimensions well to web applications, not low-level,
back-end system processes.
We aren't going to agree on this, although I think we largely agree in
the breadth of the overall context. The bottom line really comes down
to what you value in the craft. The values of the commercial world
often dictate that you should do something in the simplest and cheapest
way possible, with no attention paid to the quality, density or
longevity of the final product nor the erudition that is brought to bear
on the problem. To the extent that one shares those values, one can
PHP-AGI one's way out of this problem, sure. Actually, with the amount
of call setups and burst volume objectively required in most
cottage-industry ITSP operations, you could probably do the whole thing
in Bash:
ACCT_ROUTE_VAR=$(echo \
"SELECT id, rt FROM rt_tbl WHERE account = $ACCT LIMIT 1" \
| mysql -u user --password=blah -D database \
| head -n 3 | tail -n 1 | awk -F '|' '{print $2}')
It'll end up on TheDailyWTF.com, but it does work, and will probably
continue to work for reasonably large "values of n" that the provider
will experience in the near/foreseeable future.
On the other side, there's considerable value to be reaped in the
technical excellence of a little overengineering - not excessive, of
course, there's always a balance to find. The value is both qualitative
to those that value the aesthetic dimension of good programmatic
craftsmanship and economic in that the system can grow to meet your
needs, including both needs themselves and magnitudes of needs that
cannot be reasonably anticipated.
If you and I were charged with developing an integrated technology stack
as a competitor to say, BroadWorks or Metaswitch, and the requirement
was that it be able to process bursts of, say, 6500 call setups per
minute, and you used PHP-AGI and I used something that I find to avoid
the pitfalls of that approach, my implementation would win and yours
would lose, per given unit of hardware capacity. That issue is
completely academic and largely moot because other limitations will be
encountered long before that becomes a concern, since Asterisk is in
use. :-) Secondly, neither of us is actually building a system that
has to handle very bulky logic for 100+ CPS--that's considerably more
than most commercial softswitch gear will reliably do. But if we were,
I don't think you'd use PHP.
It is not so much more difficult to use the right tool for the right job
to begin with; it's not a night or day issue in terms of capital
requirements. Even if you'll never need it, it's nice to know that you
can rest easy at a lower threshold because you went for the right
architecture, as opposed to what many of my customers worry about, which
is that doubling their traffic next year will render their architecture
completely unusable because it was built with this kind of crap, and is
already starting to crack.
I don't make my living by selling customers a geostationary satellite
guidance system when they need a horse--there's plenty of that out
there, much of it in enterprise-size environments. I know, I know,
ITSPs are small companies that have to take the most pragmatic route to
achieve anything. But I think that appreciating the long-term benefits
of good (perhaps even a little excessive) engineering, as opposed to
just putting out today's fire today, is critical to any field of
commercial endeavour in technology, regardless.
I realise you don't disagree with me on most of this. I just think that
these premises lead to the conclusion that there's no way something like
PHP can be the ticket, whereas you clearly don't.
> I like Net::Server::Fork because it allows me to HUP to restart (reload
> new code) the parent process without touching the child processes, which
> means I can put new FastAGI code into production without waiting for no
> calls or worrying about disconnecting existing active calls. It is also
> stable and have not had problems with it in years.
Good to know; I had not considered the soft reload angle. Thanks!
-- Alex
--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775
Aug. 4, 2009
Global Crossing Tollfree Inbound
by paul@timmins.net
Anyone else off Global's Sonus in Chicago having TF inbound problems?
Aug. 3, 2009
Any subscribers from the UK?
by beckman@angryox.com
On Mon, 3 Aug 2009, Alex Balashov wrote:
> Peter Beckman wrote:
>
>> First off, calling AGI(somescript.php) is awful.
>
> It is, but most of the broken implementations I am brought in to fix do
> exactly ... that! :-)
I meant to say "I completely agree that ..."
> There is a considerable body of evidence suggesting that although PHP does
> expose a socket API, using it to do sockets is a terrible idea because it
> just doesn't perform well at all. I don't know why anyone would write a
> server - FastAGI or otherwise - in PHP.
I haven't done any tests to see how well or badly PHP does sockets, but
one of my friends and past coworkers who worked with some Zend folk
directly (Zeev, the original author of PHP) said that he wrote some pretty
amazingly fast socket-related tools in PHP. I don't know how many
calls-setups-per-second that might translate to, but I think there is the
possibility that neither of us really knows how best to build a
socket-based long-running PHP daemon that has the stability and
performance that we demand. I suspect it is possible to do at a level
on-par with other FastAGI implementations in other interpreted (not
compiled) languages.
> Besides, PHP does not really have the appropriate low-level dimension for
> heavyweight or nuanced system calls; that's not what it was designed for.
> Then again, I suppose people make that argument for Java, too.
Untrue: http://us.php.net/manual/en/intro.sockets.php
"The socket extension implements a low-level interface to the socket
communication functions based on the popular BSD sockets, providing the
possibility to act as a socket server as well as a client."
PHP is more versatile than many people think. It's not as deep zen as
Perl can be, and there are some frustrating inconsistencies in how PHP
operates, but it can be powerful in a knowledgable programmer's hands.
> Maybe. I suppose it's just hard for me to see, as someone with a programming
> background that almost entirely consists of socket-layer programming and
> network protocol implementation (in C), how PHP - given its architecture -
> can do those things in a scalable fashion even if it does bother to publish
> APIs for the underlying system calls. Managing large amounts of I/O-bound
> processing just isn't what it was built for at all. Even my curl_*() calls
> out of PHP are dog-slow.
I think that maybe PHP has improved since you last used it (or so it
seems). Again, I'm sure there are better ways, but using PHP for FastAGI
is not as bad as you make it seem. Then again, I'm not doing 1,200,000
minutes per day.
> It's a qualitative issue -- "just because you can, doesn't mean you should."
Maybe, but if you are a small mom-and-pop and just need it to work,
reusing already written code for both your web and VoIP applications makes
a lot of sense. And if they do it right, by using a PHP-based FastAGI vs
straight AGI(), it can scale fairly well.
> The real answer lies in robust performance studies and in the details of
> PHP's runtime implementation. I have neither of these annals at my ready
> disposal in order to illustrate that point. There's just a general principle
> that high-level, non-typed web languages aren't designed to participate in
> the same problem domain as general-purpose programming languages and/or
> languages on which systems are built at that lower level of abstraction.
>
> It is within the realm of conception that you could write a virtual machine
> container/hypervisor in PHP, if only the interpreter exposed the system calls
> and other primitives you'd need to pull it off. But it's not done for a
> reason--surely you can agree. (Except perhaps for the novelty/Slashdot factor
> by someone with far too much time on their hands.)
Given a programmer talented in all languages, absolutely.
> Interesting. I've tended to use Asterisk::FastAGI in the past, but it never
> seems to obey my bind port parameter on the initial invocation.
I like Net::Server::Fork because it allows me to HUP to restart (reload
new code) the parent process without touching the child processes, which
means I can put new FastAGI code into production without waiting for no
calls or worrying about disconnecting existing active calls. It is also
stable and have not had problems with it in years.
---------------------------------------------------------------------------
Peter Beckman Internet Guy
beckman at angryox.com http://www.angryox.com/
---------------------------------------------------------------------------
Aug. 3, 2009
Any subscribers from the UK?
by abalashov@evaristesys.com
Peter Beckman wrote:
> Before I start, I strongly disagree that PHP is bad for handling Asterisk
> dialplan logic. You want to write your business logic in code once, then
> reuse it. We happen to expose our business logic via a PHP API that our
> Perl FastAGI uses, but not everyone has the talent/ability/forethought to
> build it that way. The easiest way to reuse that business logic code you
> wrote for the website is to build libraries you can reuse elsewhere. In
> this case, a PHP that talks to Asterisk in an AGI sort of way (not
> directly).
I suppose that if the rationale were so intricately bound up in the
benign and understandable motive of code re-use, that is logical and
forgivable. No argument there, given that premise.
There are various observations one might make about PHP runtime
performance that suggest that it really doesn't work well at all outside
of mod_php and should not ever be used in standalone processes, but I'll
stay away from that because that really does have the tendency to
degenerate into a religious debate, and your point is fundamentally
sound and cogent.
> First off, calling AGI(somescript.php) is awful.
It is, but most of the broken implementations I am brought in to fix do
exactly ... that! :-)
> We implemented it as a FastAGI script, running as a TCP service
> that asterisk connects to on a listening local port. It handles all
> of our database connections, forks new processes off for each call,
> and does everything we need the way we want it done, not having to
> add on a bunch of hacked-together scripts and modules in Asterisk.
That sounds very workable. I suppose there might be something to be
said in favour of non-blocking I/O / synchronous I/O multiplexing in a
unitary process versus forking a new process or thread for every call,
but that only becomes a concern with very, very large amounts of call
setups. The mere fact that you have a FastAGI server versus invoking
local AGI puts you like 1000% ahead of people who don't.
I've built many FastAGI services - whether for call routing or more
esoteric business logic - in Perl as well.
> Second, if you know PHP and nothing else, it is definitely easy to get it
> done in PHP, especially if your business logic is in neat libraries you
> can include and make calls to. If you call it directly via AGI(), it can
> and likely will hurt or kill your resources, but using it as a long
> running FastAGI daemon it can be managed and connections to the DB can be
> shared.
There is a considerable body of evidence suggesting that although PHP
does expose a socket API, using it to do sockets is a terrible idea
because it just doesn't perform well at all. I don't know why anyone
would write a server - FastAGI or otherwise - in PHP.
Besides, PHP does not really have the appropriate low-level dimension
for heavyweight or nuanced system calls; that's not what it was
designed for. Then again, I suppose people make that argument for Java,
too.
On the other hand, I have no trouble believing it still works better
than local AGI() script invocations.
> Last, if all of your business logic is already done in PHP for your
> website, it's really easy to simply re-use this existing code in your AGI.
> And if you do it right and well, it may even scale fairly well.
True, very true.
> Your point however is still very valid: most customers do NOT do it right
> and well, and they should be motivated to learn how to do it better. I do
> think your downplay of PHP as an AGI language is simply misdirected. PHP
> can do FastAGI, and you can pool connections, fork processes, do things
> elegantly, same as with a Perl or C++ compiled FastAGI script. Of course
> we all know C++ will run faster, but we also know good C++ folk are hard
> to find, and once they build it, it's hard to find them again to update
> it. PHP programmers are easier to find, and if we simply educate them
> about how to build a FastAGI written in PHP reusing business logic already
> build into their website, well, it seems like a pretty good path to me.
Maybe. I suppose it's just hard for me to see, as someone with a
programming background that almost entirely consists of socket-layer
programming and network protocol implementation (in C), how PHP - given
its architecture - can do those things in a scalable fashion even if it
does bother to publish APIs for the underlying system calls. Managing
large amounts of I/O-bound processing just isn't what it was built for
at all. Even my curl_*() calls out of PHP are dog-slow.
It's a qualitative issue -- "just because you can, doesn't mean you
should."
The real answer lies in robust performance studies and in the details of
PHP's runtime implementation. I have neither of these annals at my
ready disposal in order to illustrate that point. There's just a
general principle that high-level, non-typed web languages aren't
designed to participate in the same problem domain as general-purpose
programming languages and/or languages on which systems are built at
that lower level of abstraction.
It is within the realm of conception that you could write a virtual
machine container/hypervisor in PHP, if only the interpreter exposed the
system calls and other primitives you'd need to pull it off. But it's
not done for a reason--surely you can agree. (Except perhaps for the
novelty/Slashdot factor by someone with far too much time on their hands.)
> For my Perl FastAGI, I use Net::Server::Fork and Asterisk::AGI (with a few
> fixes and modifications) and it works great.
Interesting. I've tended to use Asterisk::FastAGI in the past, but it
never seems to obey my bind port parameter on the initial invocation.
-- Alex
--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775
Aug. 3, 2009
Any subscribers from the UK?
by abalashov@evaristesys.com
Daryl G. Jurbala wrote:
> On Aug 1, 2009, at 7:12 PM, Alex Balashov wrote:
>
>> I don't mean to sound derogatory, but what is this enormous fixation
>> that people have with building AGI scripts in PHP-AGI?
>>
>
> Familiarity with web programming. Again, this is an inherited setup,
> not how I would design it from a clean slate.
Understood. I didn't mean it personally; I was sort of rhetorically
inquiring as to the avenue of thinking taken by the folks preceding you
who designed the setup that way, not indicting your willingness to
maintain it in that state.
> The rest of your post just makes you seem like you have a chip on your
> shoulder, and that there are only certain ways to do thing, and those
> are what you deem appropriate.
On a qualitative level, it certainly irritates me, but no, it's not
really a chip on my shoulder as much as a very starkly significant trend
I've identified in the course of my work.
I'd say about 90% of my business comes from helping ITSPs who started
off on naive, mostly (but not necessarily) Asterisk-based approaches
scale upward once they hit the point where that approach - easy and
low-barrier as it may be - has severely diminishing returns.
Everyone who does that sort of thing - especially on a programmatic
level - identifies certain "anti-patterns" that they then register as a
common engineering pitfall and discourage others from doing. The
anti-pattern I see here is that using PHP solves the wrong problem by
answering the wrong question the wrong way. There are many other such
patterns I constantly run into; I think the most common one is using
the database as an IPC (interprocess communication) mechanism for high
volumes of delay-sensitive, real-time data--the kind of stuff that
should be passed around in shared memory, pipes, domain sockets, network
sockets, semaphores, etc. ViciDIAL takes that to an absurd, ghastly
extreme.
Once again, I wasn't attacking you, and I apologise if that is the
perception. I was just wondering aloud why people do this kind of stuff.
> In the end, the technology isn't for its own sake. Its to make money.
> I'm in the back (for over 2 years), and growing over 10% per month, even
> through the downturn. How about you?
I'm not an ITSP, so I can't answer that on an apples-to-apples basis.
What I can say is that until a certain point, there is a high
correlation between good engineering and making more money, for reasons
that are fairly self-evident; it eliminates various additional external
costs down the road, it reduces brand destruction through declining
performance (and the ensuing scramble to bandage it), and better design
allows you to better and more efficiently develop scalable, reusable
business processes that can be replicated at decreasing marginal cost
better and faster. So, it's not a purely aesthetic issue; there is an
objective weight to one methodology over another, and it has everything
to do with making money.
On a practical level, the way I see this playing out is that I'm the
bomb technician that has to go in and defuse an ITSP that has grown to
have lots of call setups per second (whether from dialer traffic or what
have you) and finds that their large farm of Asterisk boxes - and all
call flows intermediated by extensive PHP-AGI calls - is falling over
once or more daily, and that this just isn't tenable from a business
perspective because the whole architecture is flawed from the very
beginning.
That has a huge price tag.
-- Alex
--
Alex Balashov
Evariste Systems
Web : http://www.evaristesys.com/
Tel : (+1) (678) 954-0670
Direct : (+1) (678) 954-0671
Mobile : (+1) (678) 237-1775
Aug. 3, 2009
Any subscribers from the UK?
by beckman@angryox.com
On Sat, 1 Aug 2009, Alex Balashov wrote:
> I don't mean to sound derogatory, but what is this enormous fixation that
> people have with building AGI scripts in PHP-AGI?
>
> PHP is a language designed for serving dynamic web pages; of all the runtime
> environments suitable for the development of standalone utilities, it is
> absolutely the worst and most perverse one you could use.
You have some very valid points, and some ones I disagree with. Here's
why we do it, and how we do it better.
Before I start, I strongly disagree that PHP is bad for handling Asterisk
dialplan logic. You want to write your business logic in code once, then
reuse it. We happen to expose our business logic via a PHP API that our
Perl FastAGI uses, but not everyone has the talent/ability/forethought to
build it that way. The easiest way to reuse that business logic code you
wrote for the website is to build libraries you can reuse elsewhere. In
this case, a PHP that talks to Asterisk in an AGI sort of way (not
directly).
First off, calling AGI(somescript.php) is awful. We decided to do it in
Perl, but we could have done it in PHP. We implemented it as a FastAGI
script, running as a TCP service that asterisk connects to on a listening
local port. It handles all of our database connections, forks new
processes off for each call, and does everything we need the way we want
it done, not having to add on a bunch of hacked-together scripts and
modules in Asterisk.
Second, if you know PHP and nothing else, it is definitely easy to get it
done in PHP, especially if your business logic is in neat libraries you
can include and make calls to. If you call it directly via AGI(), it can
and likely will hurt or kill your resources, but using it as a long
running FastAGI daemon it can be managed and connections to the DB can be
shared.
Last, if all of your business logic is already done in PHP for your
website, it's really easy to simply re-use this existing code in your AGI.
And if you do it right and well, it may even scale fairly well.
Your point however is still very valid: most customers do NOT do it right
and well, and they should be motivated to learn how to do it better. I do
think your downplay of PHP as an AGI language is simply misdirected. PHP
can do FastAGI, and you can pool connections, fork processes, do things
elegantly, same as with a Perl or C++ compiled FastAGI script. Of course
we all know C++ will run faster, but we also know good C++ folk are hard
to find, and once they build it, it's hard to find them again to update
it. PHP programmers are easier to find, and if we simply educate them
about how to build a FastAGI written in PHP reusing business logic already
build into their website, well, it seems like a pretty good path to me.
Are there better ways to do it? I'm certain. But most buseinsses don't
have access to really and truly talented Asterisk admins who also know SQL
and really can manage the full dialplan on a regular basis, who also know
PHP well and can work on the web side of things too, and that's why they
use PHP.
Now go teach them to use a FastAGI written in PHP (it's not that hard) and
they'll be a long way along.
For my Perl FastAGI, I use Net::Server::Fork and Asterisk::AGI (with a few
fixes and modifications) and it works great.
Beckman
References:
http://www.packtpub.com/article/asterisk-gateway-interface-scripting-with-p… (Nir!)
http://us2.php.net/manual/en/function.socket-listen.php
http://phpagi.sourceforge.net/ (not maintained)
http://gattolino.blogspot.com/2009/03/asterisk-fastagi-server-in-php.html (incomplete)
---------------------------------------------------------------------------
Peter Beckman Internet Guy
beckman at angryox.com http://www.angryox.com/
---------------------------------------------------------------------------
Aug. 3, 2009