TOS - Type of service é um campo do cabeçalho IP utilizado para definir o tipo de pacote a ser transportado. Seguem algumas configurações possíveis.
Veja a seguir os valores que podem ser usados no campo TOS:
Valor Descrição
0x08 Minimizar atraso
0x04 Maximizar rendimento
0x02 Maximizar confiabilidade
0x01 Minimizar custo monetário
0x00 Serviço normal
Pesquisar este blog
sexta-feira, 28 de outubro de 2011
segunda-feira, 18 de julho de 2011
MOS - Mean Opinion Score
What is Mean Opinion Score?
In voice and video communication, quality usually dictates whether the experience is a good or bad one. Besides the qualitative description we hear, like 'quite good' or 'very bad', there is a numerical method of expressing voice and video quality. It is called Mean Opinion Score (MOS). MOS gives a numerical indication of the perceived quality of the media received after being transmitted and eventually compressed using codecs.
MOS is expressed in one number, from 1 to 5, 1 being the worst and 5 the best. MOS is quite subjective, as it is based figures that result from what is perceived by people during tests. However, there are software applications that measure MOS on networks, as we see below.
The Mean Opinion Score Values
Taken in whole numbers, the numbers are quite easy to grade.
5 - Perfect. Like face-to-face conversation or radio reception.
4 - Fair. Imperfections can be perceived, but sound still clear. This is (supposedly) the range for cell phones.
3 - Annoying.
2 - Very annoying. Nearly impossible to communicate.
1 - Impossible to communicate
The values do not need to be whole numbers. Certain thresholds and limits are often expressed in decimal values from this MOS spectrum. For instance, a value of 4.0 to 4.5 is referred to as toll-quality and causes complete satisfaction. This is the normal value of PSTN and many VoIP services aim at it, often with success. Values dropping below 3.5 are termed unacceptable by many users.
How Are MOS Tests Conducted?
A certain number of people are sat and are made to hear some audio. Each one of them gives a rating from within 1 to 5. Then an artihmetic mean (average) is calculated, giving the Mean Opinion Score. When conducting MOS test, there are certain phrases that are recommended to be used by the ITU-T. They are:
You will have to be very quiet.
There was nothing to be seen.
They worshipped wooden idols.
I want a minute with the inspector.
Did he need any money?
Factors Affecting Mean Opinion Score
MOS can simply be used to compare between VoIP services and providers. But more importantly, they are used to assess the work of codecs, which compress audio and video to save on bandwidth utilization but with a certain amount of drop in quality. MOS tests are then made for codecs in a certain environment.
There are however certain other factors that affect the quality of audio and video transferred, as mentioned in that article. These factors are not supposed to be accounted for in MOS values, so when determining the MOS for a certain codec, service or network, it is important that all the other factors are favorable to the maximum for a good quality, for MOS values are assumed to be obtained under ideal conditions.
Software Automated Mean Opinion Score Tests
Since the manual/human MOS tests are quite subjective and less than productive in many ways, there are nowadays a number of software tools that carry out automated MOS testing in a VoIP deployment. Although they lack the human touch, the good thing with these tests is that they take into account all the network dependency conditions that could influence voice quality. Some examples are AppareNet Voice, Brix VoIP Measurement Suite, NetAlly, PsyVoIP and VQmon/EP.
Text from voip.about.com, all rights to the author.
In voice and video communication, quality usually dictates whether the experience is a good or bad one. Besides the qualitative description we hear, like 'quite good' or 'very bad', there is a numerical method of expressing voice and video quality. It is called Mean Opinion Score (MOS). MOS gives a numerical indication of the perceived quality of the media received after being transmitted and eventually compressed using codecs.
MOS is expressed in one number, from 1 to 5, 1 being the worst and 5 the best. MOS is quite subjective, as it is based figures that result from what is perceived by people during tests. However, there are software applications that measure MOS on networks, as we see below.
The Mean Opinion Score Values
Taken in whole numbers, the numbers are quite easy to grade.
5 - Perfect. Like face-to-face conversation or radio reception.
4 - Fair. Imperfections can be perceived, but sound still clear. This is (supposedly) the range for cell phones.
3 - Annoying.
2 - Very annoying. Nearly impossible to communicate.
1 - Impossible to communicate
The values do not need to be whole numbers. Certain thresholds and limits are often expressed in decimal values from this MOS spectrum. For instance, a value of 4.0 to 4.5 is referred to as toll-quality and causes complete satisfaction. This is the normal value of PSTN and many VoIP services aim at it, often with success. Values dropping below 3.5 are termed unacceptable by many users.
How Are MOS Tests Conducted?
A certain number of people are sat and are made to hear some audio. Each one of them gives a rating from within 1 to 5. Then an artihmetic mean (average) is calculated, giving the Mean Opinion Score. When conducting MOS test, there are certain phrases that are recommended to be used by the ITU-T. They are:
You will have to be very quiet.
There was nothing to be seen.
They worshipped wooden idols.
I want a minute with the inspector.
Did he need any money?
Factors Affecting Mean Opinion Score
MOS can simply be used to compare between VoIP services and providers. But more importantly, they are used to assess the work of codecs, which compress audio and video to save on bandwidth utilization but with a certain amount of drop in quality. MOS tests are then made for codecs in a certain environment.
There are however certain other factors that affect the quality of audio and video transferred, as mentioned in that article. These factors are not supposed to be accounted for in MOS values, so when determining the MOS for a certain codec, service or network, it is important that all the other factors are favorable to the maximum for a good quality, for MOS values are assumed to be obtained under ideal conditions.
Software Automated Mean Opinion Score Tests
Since the manual/human MOS tests are quite subjective and less than productive in many ways, there are nowadays a number of software tools that carry out automated MOS testing in a VoIP deployment. Although they lack the human touch, the good thing with these tests is that they take into account all the network dependency conditions that could influence voice quality. Some examples are AppareNet Voice, Brix VoIP Measurement Suite, NetAlly, PsyVoIP and VQmon/EP.
Text from voip.about.com, all rights to the author.
Marcadores:
voip quality qos voice codec asterisk mos
quarta-feira, 27 de abril de 2011
List Of SIP response codes
SIP responses are the codes used by Session Initiation Protocol for communication. They complement the SIP Requests, which are used to initiate action such as a phone conversation. Note that the Reason Phrases of the responses listed below are only the recommended examples, and can be replaced with local equivalents without affecting the protocol.
Contents
* 1 1xx—Informational Responses
* 2 2xx—Successful Responses
* 3 3xx—Redirection Responses
* 4 4xx—Client Failure Responses
* 5 5xx—Server Failure Responses
* 6 6xx—Global Failure Responses
* 7 External links
1xx—Informational Responses
* 100 Trying
extended search being performed may take a significant time so a forking proxy must send a 100 Trying response
* 180 Ringing
* 181 Call Is Being Forwarded
* 182 Queued
* 183 Session Progress
2xx—Successful Responses
* 200 OK
* 202 accepted: It Indicates that the request has been understood but actually can't be processed
3xx—Redirection Responses
* 300 Multiple Choices
* 301 Moved Permanently
* 302 Moved Temporarily
* 305 Use Proxy
* 380 Alternative Service
4xx—Client Failure Responses
* 400 Bad Request
* 401 Unauthorized (Used only by registrars or user agents. Proxies should use proxy authorization 407)
* 402 Payment Required (Reserved for future use)
* 403 Forbidden
* 404 Not Found (User not found)
* 405 Method Not Allowed
* 406 Not Acceptable
* 407 Proxy Authentication Required
* 408 Request Timeout (Couldn't find the user in time)
* 409 Conflict
* 410 Gone (The user existed once, but is not available here any more.)
* 412 Conditional Request Failed
* 413 Request Entity Too Large
* 414 Request-URI Too Long
* 415 Unsupported Media Type
* 416 Unsupported URI Scheme
* 417 Unknown Resource-Priority
* 420 Bad Extension (Bad SIP Protocol Extension used, not understood by the server)
* 421 Extension Required
* 422 Session Interval Too Small
* 423 Interval Too Brief
* 424 Bad Location Information
* 428 Use Identity Header
* 429 Provide Referrer Identity
* 433 Anonymity Disallowed
* 436 Bad Identity-Info
* 437 Unsupported Certificate
* 438 Invalid Identity Header
* 480 Temporarily Unavailable
* 481 Call/Transaction Does Not Exist
* 482 Loop Detected
* 483 Too Many Hops
* 484 Address Incomplete
* 485 Ambiguous
* 486 Busy Here
* 487 Request Terminated
* 488 Not Acceptable Here
* 489 Bad Event
* 491 Request Pending
* 493 Undecipherable (Could not decrypt S/MIME body part)
* 494 Security Agreement Required
5xx—Server Failure Responses
* 500 Server Internal Error
* 501 Not Implemented: The SIP request method is not implemented here
* 502 Bad Gateway
* 503 Service Unavailable
* 504 Server Time-out
* 505 Version Not Supported: The server does not support this version of the SIP protocol
* 513 Message Too Large
* 580 Precondition Failure
6xx—Global Failure Responses
* 600 Busy Everywhere
* 603 Decline
* 604 Does Not Exist Anywhere
* 606 Not Acceptable
From Wikipedia, the free encyclopedia
Contents
* 1 1xx—Informational Responses
* 2 2xx—Successful Responses
* 3 3xx—Redirection Responses
* 4 4xx—Client Failure Responses
* 5 5xx—Server Failure Responses
* 6 6xx—Global Failure Responses
* 7 External links
1xx—Informational Responses
* 100 Trying
extended search being performed may take a significant time so a forking proxy must send a 100 Trying response
* 180 Ringing
* 181 Call Is Being Forwarded
* 182 Queued
* 183 Session Progress
2xx—Successful Responses
* 200 OK
* 202 accepted: It Indicates that the request has been understood but actually can't be processed
3xx—Redirection Responses
* 300 Multiple Choices
* 301 Moved Permanently
* 302 Moved Temporarily
* 305 Use Proxy
* 380 Alternative Service
4xx—Client Failure Responses
* 400 Bad Request
* 401 Unauthorized (Used only by registrars or user agents. Proxies should use proxy authorization 407)
* 402 Payment Required (Reserved for future use)
* 403 Forbidden
* 404 Not Found (User not found)
* 405 Method Not Allowed
* 406 Not Acceptable
* 407 Proxy Authentication Required
* 408 Request Timeout (Couldn't find the user in time)
* 409 Conflict
* 410 Gone (The user existed once, but is not available here any more.)
* 412 Conditional Request Failed
* 413 Request Entity Too Large
* 414 Request-URI Too Long
* 415 Unsupported Media Type
* 416 Unsupported URI Scheme
* 417 Unknown Resource-Priority
* 420 Bad Extension (Bad SIP Protocol Extension used, not understood by the server)
* 421 Extension Required
* 422 Session Interval Too Small
* 423 Interval Too Brief
* 424 Bad Location Information
* 428 Use Identity Header
* 429 Provide Referrer Identity
* 433 Anonymity Disallowed
* 436 Bad Identity-Info
* 437 Unsupported Certificate
* 438 Invalid Identity Header
* 480 Temporarily Unavailable
* 481 Call/Transaction Does Not Exist
* 482 Loop Detected
* 483 Too Many Hops
* 484 Address Incomplete
* 485 Ambiguous
* 486 Busy Here
* 487 Request Terminated
* 488 Not Acceptable Here
* 489 Bad Event
* 491 Request Pending
* 493 Undecipherable (Could not decrypt S/MIME body part)
* 494 Security Agreement Required
5xx—Server Failure Responses
* 500 Server Internal Error
* 501 Not Implemented: The SIP request method is not implemented here
* 502 Bad Gateway
* 503 Service Unavailable
* 504 Server Time-out
* 505 Version Not Supported: The server does not support this version of the SIP protocol
* 513 Message Too Large
* 580 Precondition Failure
6xx—Global Failure Responses
* 600 Busy Everywhere
* 603 Decline
* 604 Does Not Exist Anywhere
* 606 Not Acceptable
From Wikipedia, the free encyclopedia
quinta-feira, 17 de março de 2011
segunda-feira, 28 de fevereiro de 2011
Novas Rides - Tarifação telefonica no Brasil.
Novas regras para DDD entre cidades próximas passam a valer em 120 dias (27/01/2011)
Regulamento foi publicado no Diário Oficial da União (27/01/2011).
Entram em vigor em até 120 dias as novas regras que permitirão realizar chamadas telefônicas a custo de ligação local entre municípios de uma mesma região metropolitana ou de região integrada de desenvolvimento que contenham continuidade geográfica e o mesmo código nacional de área (DDD), de acordo com informações da Agência Nacional de Telecomunicações (Anatel).
O novo Regulamento sobre Áreas Locais para o Serviço Telefônico Fixo Comutado destinado ao Uso do Público em Geral (STFC) foi publicado na quinta-feira (27/01) no Diário Oficial da União, e, por isso, o prazo começará a ser contado a partir dessa data.
Cerca de 68 milhões de consumidores serão beneficiados com uma decisão aprovada na última quinta-feira (20) pelo Conselho Diretor da Anatel, que converte ligação de longa distância (DDD) em ligação local para cerca de 560 municípios brasileiros, o que reduzirá o valor da conta de telefone para os usuários de telefonia que vivem nessas áreas.
A proposta faz parte do novo regulamento sobre áreas locais para o Serviço Telefônico Fixo Comutado (STFC), que amplia os critérios de definição de áreas locais, que passa a abranger o conjunto de municípios pertencentes a uma região metropolitana ou região integrada de desenvolvimento (Ride) que tenham continuidade geográfica e pertençam a um mesmo código nacional de área (DDD).
Como região metropolitana, a Anatel considerou o agrupamento de municípios limítrofes, instituída legalmente, que tem como finalidade integrar a organização, o planejamento e a execução de funções públicas de interesse comum. O conceito de Ride adotado pela agência foi o de complexo geoeconômico e social, instituído legalmente, que tem o objetivo de articular a ação administrativa da União visando seu desenvolvimento e a redução das desigualdades regionais. Como áreas com continuidade urbana, a Anatel considerou o resultado da fusão de duas ou mais localidades, que constitui um todo urbanizado, podendo, entretanto, ocorrer descontinuidades de mil metros ou por motivo de acidente aquático, como rio, lago, baía ou braço oceânico.
Depois do prazo de adequação de até 120 dias, contados a partir da data da publicação do regulamento, a nova configuração permitirá a realização de chamadas telefônicas a custo de ligação local entre todos os municípios de uma mesma região metropolitana ou de região integrada de desenvolvimento que contenham continuidade geográfica e o mesmo código nacional de área (DDD). O regulamento contempla 39 regiões metropolitanas e 3 três regiões integradas de desenvolvimento.
O novo regulamento também estabelece que as novas situações que se enquadrem na definição de áreas com continuidade urbana ou em decorrência de solicitação fundamentada por parte da concessionária de telefonia fixa na modalidade do serviço local serão revistas anualmente. As revisões de configuração da área local resultante da criação ou da alteração de regiões metropolitanas ou de Rides ocorrerão junto com as revisões quinquenais dos contratos de concessão.
Veja relação de regiões:
RM Agreste (AL):
Arapiraca, Belém, Campo Grande, Coité do Nóia, Craíbas, Estrela de Alagoas, Feira Grande, Girau do Ponciano, Igaci, Jaramataia, Junqueiro, Lagoa da Canoa, Limoeiro de Anadia, Olho D’Água Grande, Palmeira dos Índios, São Brás, São Sebastião, Tanque D’Arca, Taquarana, Traipu
RM Maceió (AL):
Barra de Santo Antonio, Barra de São Miguel, Coqueiro Seco, Maceió, Marechal Deodoro, Messias, Paripueira, Pilar, Rio Largo, Santa Luzia do Norte, Satuba
RM Manaus (AM):
Autazes, Careiro, Careiro da Várzea, Iranduba, Itacoatiara, Itapiranga, Manacapuru, Manaquiri, Manaus, Novo Airão, Presidente Figueiredo, Rio Preto da Eva, Silves
RM Macapá (AP):
Macapá, Santana
Ride Petrolina/Juazeiro (BA):
Casa Nova, Curaçá, Juazeiro, Sobradinho
RM Salvador (BA):
Camaçari, Candeias, Dias D’Ávila, Itaparica, Lauro de Freitas, Madre de Deus, Mata de São João, Pojuca, Salvador, São Francisco do Conde, São Sebastião do Passé, Simões Filhos, Vera Cruz
RM Fortaleza (CE):
Aquiraz, Cascavel, Caucaia, Chorozinho, Eusébio, Fortaleza, Guaiúba, Horizonte, Itaitinga, Maracanaú, Maranguape, Pacajus, Pacatuba, Pindoretama, São Gonçalo do Amarante
RM Cariri (CE):
Barbalha, Caririaçu, Crato, Farias Brito, Jardim, Juazeiro do Norte, Missão Velha, Nova Olinda, Santana do Cariri
Ride DF/Entorno (DF):
Brasília (localidades: Brasília, Brazlândia, Ceilândia, Condomínio Asa Branca, Condomínio Morado Nobre, Cruzeiro, Gama, Guará, Núcleo Bandeirante, Núcleo Rural Capão Seco, Núcleo Rural DVO, Paranoá, Planaltina, Rajadinha II, Rajadinha III, Recanto das Emas, Riacho Fundo, Samambaia, Santa Rita, São Sebastião, Sobradinho, Taguatinga)
RM Grande Vitória (ES):
Cariacica, Fundão, Guarapari, Serra, Viana, Vila Velha, Vitória
Ride DF/Entorno (GO):
Água Fria de Goiás, Mimoso de Goiás, Águas Lindas de Goiás, Cabeceiras, Cidade Ocidental, Cristalina, Formosa, Luziânia, Novo Gama, Padre Bernardo, Planaltina, Santo Antônio do Descoberto, Valparaíso de Goiás
RM Goiânia (GO):
Abadia de Goiás, Aparecida de Goiânia, Aragoiânia, Bela Vista de Goiás, Bonfinópolis, Brazabrantes, Caldazinha, Caturaí, Goianápolis, Goiânia, Goianira, Guapó, Hidrolândia, Inhumas, Nerópolis, Nova Veneza, Santo Antônio de Goiás, Senador Canedo, Terezópolis de Goiás, Trindade
Ride DF/Entorno (GO):
Abadiânia, Alexânia, Cocalzinho de Goiás, Corumbá de Goiás, Pirenópolis
RM Sudoeste Maranhense (MA):
Buritirana, Davinópolis, Governador Edison Lobão, Imperatriz, João Lisboa, Montes Altos, Ribamar Fiquene, Senador La Rocque
RM Belo Horizonte (MG):
Baldim, Belo Horizonte, Betim, Brumadinho, Caeté, Capim Branco, Confins, Contagem, Esmeraldas, Florestal, Ibirité, Igarapé, Itatiaiuçu, Jaboticatubas, Juatuba, Lagoa Santa, Mário Campos, Mateus Leme, Matozinhos, Nova Lima, Nova União, Pedro Leopoldo, Raposos, Ribeirão das Neves, Rio Acima, Rio Manso, Sabará, Santa Luzia, São Joaquim de Bicas, São José da Lapa, Sarzedo, Taquaraçu de Minas, Vespasiano
RM Vale do Aço (MG):
Coronel Fabriciano, Ipatinga, Timóteo
Ride DF/Entorno (MG):
Buritis, Cabeceira Grande, Unaí
RM Vale do Rio Cuiabá (MT):
Cuiabá, Nossa Senhora do Livramento, Santo Antonio do Leverger, Várzea Grande
RM Belém (PA):
Ananindeua, Belém, Benevides, Marituba, Santa Bárbara do Pará, Santa Isabel do Pará
RM Campina Grande (PB):
Alagoa Nova, Areial, Aroeiras, Barra de Santana, Boa Vista, Boqueirão, Campina Grande, Caturité, Esperança, Fagundes, Gado Bravo, Ingá, Itatuba, Lagoa Seca, Massaranduba, Matinhas, Montadas, Pocinhos, Puxinanã, Queimadas, Riachão do Bacamarte, Roça, Serra Redonda
RM João Pessoa (PB):
Alhandra, Bayeux, Caaporã, Cabedelo, Conde, Cruz do Espírito Santo, João Pessoa, Lucena, Mamanguape, Pitimbu, Rio Tinto, Santa Rita
Ride Petrolina/Juazeiro (PE):
Lagoa Grande, Orocó, Petrolina, Santa Maria da Boa Vista
RM Recife (PE):
Abreu e Lima, Araçoiaba, Cabo de Santo Agostinho, Camaragibe, Igarassu, Ilha de Itamaracá, Ipojuca, Itapissuma, Jaboatão dos Guararapes, Moreno, Paulista, Recife, São Lourenço da Mata
Ride Grande Teresina (PI):
Altos, Beneditinos, Coivaras, Curralinhos, Demerval Lobão, José de Freitas, Lagoa Alegre, Lagoa do Piauí, Miguel Leão, Monsenhor Gil, Teresina, União
RM Curitiba (PR):
Adrianópolis, Agudos do Sul, Almirante Tamandaré, Araucária, Balsa Nova, Bocaiúva do Sul, Campina Grande do Sul, Campo Largo, Campo Magro, Cerro Azul, Colombo, Contenda, Curitiba, Doutor Ulysses, Fazenda Rio Grande, Itaperuçu, Lapa, Mandirituba, Pinhais, Piraquara, Quatro Barras, Quitandinha, Rio Branco do Sul, São José dos Pinhais, Tijucas do Sul, Tunas do Paraná
RM Maringá (PR):
Bom Sucesso, Cambira, Jandaia do Sul
RM Londrina (PR):
Bela Vista do Paraíso, Cambé, Ibiporã, Jataizinho, Londrina, Rolândia, Sertanópolis,Tamara
RM Maringá (PR):
Ângulo, Astorga, Atalaia, Doutor Camargo, Floraí, Floresta, Flórida, Iguaraçu, Itambém, Ivatuba, Lobato, Mandaguaçu, Marialva, Maringá, Munhoz de Melo, Ourizona, Paiçandu, Presidente Castelo Branco, Santa Fé, São Jorge do Ivaí, Sarandi
RM Rio de Janeiro (RJ):
Belford Roxo, Duque de Caxias, Guapimirim, Itaboraí, Itaguaí, Japeri, Magé, Maricá, Mesquita, Nilópolis, Niterói, Nova Iguaçu, Paracambi, Queimados, Rio de Janeiro, São Gonçalo, São João de Meriti, Seropédica, Tanguá
RM Natal (RN):
Ceará-Mirim, Extremoz, Macaíba, Monte Alegre, Natal, Nísia Floresta, Parnamirim, São Gonçalo do Amarante, São José de Mipibu, Vera Cruz
RM da Capital – Roraima (RR):
Boa Vista, Cantá
RM Central – Roraima (RR):
Caracaraí, Iracema
RM do Sul do Estado – Roraima (RR):
Caroebe, São João da Baliza, São Luiz
RM Porto Alegre (RS):
Alvorada, Araricá, Arroio dos Ratos, Cachoeirinha, Campo Bom, Canoas, Capela de Santana, Charqueadas, Dois Irmãos, Eldorado do Sul, Estância Velha, Esteio, Glorinha, Gravataí, Guaíba, Ivoti, Montenegro, Nova Hartz, Nova Santa Rita, Novo Hamburgo, Parobé, Portão, Porto Alegre, Santo Antonio da Patrulha, São Jerônimo, São Leopoldo, Sapiranga, Sapucaia do Sul, Taquara, Triunfo, Viamão
RM Vale do Itajaí (SC):
Apiúna, Ascurra, Benedito Novo, Blumenau, Botuverá, Brusque, Doutor Pedrinho, Gaspar, Guabiruba, Ilhota, Indaial, Luiz Alves, Pomerode, Rio dos Cedros, Rodeio, Timbó
RM Chapecó (SC):
Águas de Chapecó, Águas Frias, Arvoredo, Caxambu do Sul, Chapecó, Coronel Freitas, Cunhataí, Faxinal dos Guedes, Guatambú, Itá, Marema, Nova Erechim, Nova Itaberaba, Paial , Palmitos, Pinhalzinho, Planalto Alegre, Quilombo, São Carlos, Saudades, Seara, União do Oeste, Xanxerê, Xavantina, Xaxim
RM Carbonífera (SC):
Araranguá, Balneário Arroio do Silva, Balneário Gaivota, Cocal do Sul, Criciúma, Ermo, Forquilhinha, Içara, Jacinto Machado, Lauro Muller, Maracajá, Meleiro, Morro da Fumaça, Morro Grande, Nova Veneza, Passo de Torres, Praia Grande, Santa Rosa do Sul, São João do Sul, Siderópolis, Sombrio, Timbé do Sul, Treviso, Turvo, Urussanga
RM Florianópolis (SC):
Águas Mornas, Alfredo Wagner, Angelina, Anitápolis, Antônio Carlos, Biguaçu, Canelinha, Florianópolis, Garopaba, Governador Celso Ramos, Leooberto Leal, Major Gercino, Nova Trento, Palhoça, Paulo Lopes, Rancho Queimado, Santo Amaro da Imperatriz, São Bonifácio, São João Batista, São José, São Pedro de Alcântara, Tijucas
RM Norte/Nordeste Catarinense (SC):
Araquari, Balneário Barra do Sul, Barra Velha, Campo Alegre, Corupá, Garuva, Guaramirim, Itaiópolis, Itapoá, Jaraguá do Sul, Joinville, Mafra, Massaranduba, Monte Castelo, Papanduva, Rio Negrinho, São Bento do Sul, São Francisco do Sul, São João do Itaperiú, Schroeder
RM Lages (SC):
Anita Garibaldi, Bocaina do Sul, Bom Jardim da Serra, Bom Retiro, Campo Belo do Sul, Capão Alto, Cerro Negro, Correia Pinto, Curitibanos, Frei Rogério, Lages, Otacílio Costa, Painel, Palmeira, Ponte Alta, Ponte Alta do Norte, Rio Rufino, Santa Cecília, São Cristovão do Sul, São Joaquim, São José do Cerrito, Urubici, Urupema
RM Tubarão (SC):
Armazém, Braço do Norte, Capivari de Baixo, Grão Pará, Gravatal, Imaruí, Imbituba, Jaguaruna, Laguna, Orleans, Pedras Grandes, Rio Fortuna, Sangão, Santa Rosa de Lima, São Ludgero, São Martinho, Treze de Maio, Tubarão
RM Aracaju (SE):
Aracaju, Barra dos Coqueiros, Nossa Senhora do Socorro, São Cristóvão
RM Campinas (SP):
Americana, Artur Nogueira, Campinas, Cosmópolis, Engenheiro Coelho, Holambra, Hortolândia, Indaiatuba, Jaguariúna, Monte Mor, Nova Odessa, Paulínia, Pedreira, Santa Bárbara D’Oeste, Santo Antônio de Posse, Sumaré, Valinhos, Vinhedo
RM Baixada Santista (SP):
Bertioga, Cubatão, Guarujá, Itanhaém, Mongaguá, Peruíbe, Praia Grande, Santos, São Vicente
Regulamento foi publicado no Diário Oficial da União (27/01/2011).
Entram em vigor em até 120 dias as novas regras que permitirão realizar chamadas telefônicas a custo de ligação local entre municípios de uma mesma região metropolitana ou de região integrada de desenvolvimento que contenham continuidade geográfica e o mesmo código nacional de área (DDD), de acordo com informações da Agência Nacional de Telecomunicações (Anatel).
O novo Regulamento sobre Áreas Locais para o Serviço Telefônico Fixo Comutado destinado ao Uso do Público em Geral (STFC) foi publicado na quinta-feira (27/01) no Diário Oficial da União, e, por isso, o prazo começará a ser contado a partir dessa data.
Cerca de 68 milhões de consumidores serão beneficiados com uma decisão aprovada na última quinta-feira (20) pelo Conselho Diretor da Anatel, que converte ligação de longa distância (DDD) em ligação local para cerca de 560 municípios brasileiros, o que reduzirá o valor da conta de telefone para os usuários de telefonia que vivem nessas áreas.
A proposta faz parte do novo regulamento sobre áreas locais para o Serviço Telefônico Fixo Comutado (STFC), que amplia os critérios de definição de áreas locais, que passa a abranger o conjunto de municípios pertencentes a uma região metropolitana ou região integrada de desenvolvimento (Ride) que tenham continuidade geográfica e pertençam a um mesmo código nacional de área (DDD).
Como região metropolitana, a Anatel considerou o agrupamento de municípios limítrofes, instituída legalmente, que tem como finalidade integrar a organização, o planejamento e a execução de funções públicas de interesse comum. O conceito de Ride adotado pela agência foi o de complexo geoeconômico e social, instituído legalmente, que tem o objetivo de articular a ação administrativa da União visando seu desenvolvimento e a redução das desigualdades regionais. Como áreas com continuidade urbana, a Anatel considerou o resultado da fusão de duas ou mais localidades, que constitui um todo urbanizado, podendo, entretanto, ocorrer descontinuidades de mil metros ou por motivo de acidente aquático, como rio, lago, baía ou braço oceânico.
Depois do prazo de adequação de até 120 dias, contados a partir da data da publicação do regulamento, a nova configuração permitirá a realização de chamadas telefônicas a custo de ligação local entre todos os municípios de uma mesma região metropolitana ou de região integrada de desenvolvimento que contenham continuidade geográfica e o mesmo código nacional de área (DDD). O regulamento contempla 39 regiões metropolitanas e 3 três regiões integradas de desenvolvimento.
O novo regulamento também estabelece que as novas situações que se enquadrem na definição de áreas com continuidade urbana ou em decorrência de solicitação fundamentada por parte da concessionária de telefonia fixa na modalidade do serviço local serão revistas anualmente. As revisões de configuração da área local resultante da criação ou da alteração de regiões metropolitanas ou de Rides ocorrerão junto com as revisões quinquenais dos contratos de concessão.
Veja relação de regiões:
RM Agreste (AL):
Arapiraca, Belém, Campo Grande, Coité do Nóia, Craíbas, Estrela de Alagoas, Feira Grande, Girau do Ponciano, Igaci, Jaramataia, Junqueiro, Lagoa da Canoa, Limoeiro de Anadia, Olho D’Água Grande, Palmeira dos Índios, São Brás, São Sebastião, Tanque D’Arca, Taquarana, Traipu
RM Maceió (AL):
Barra de Santo Antonio, Barra de São Miguel, Coqueiro Seco, Maceió, Marechal Deodoro, Messias, Paripueira, Pilar, Rio Largo, Santa Luzia do Norte, Satuba
RM Manaus (AM):
Autazes, Careiro, Careiro da Várzea, Iranduba, Itacoatiara, Itapiranga, Manacapuru, Manaquiri, Manaus, Novo Airão, Presidente Figueiredo, Rio Preto da Eva, Silves
RM Macapá (AP):
Macapá, Santana
Ride Petrolina/Juazeiro (BA):
Casa Nova, Curaçá, Juazeiro, Sobradinho
RM Salvador (BA):
Camaçari, Candeias, Dias D’Ávila, Itaparica, Lauro de Freitas, Madre de Deus, Mata de São João, Pojuca, Salvador, São Francisco do Conde, São Sebastião do Passé, Simões Filhos, Vera Cruz
RM Fortaleza (CE):
Aquiraz, Cascavel, Caucaia, Chorozinho, Eusébio, Fortaleza, Guaiúba, Horizonte, Itaitinga, Maracanaú, Maranguape, Pacajus, Pacatuba, Pindoretama, São Gonçalo do Amarante
RM Cariri (CE):
Barbalha, Caririaçu, Crato, Farias Brito, Jardim, Juazeiro do Norte, Missão Velha, Nova Olinda, Santana do Cariri
Ride DF/Entorno (DF):
Brasília (localidades: Brasília, Brazlândia, Ceilândia, Condomínio Asa Branca, Condomínio Morado Nobre, Cruzeiro, Gama, Guará, Núcleo Bandeirante, Núcleo Rural Capão Seco, Núcleo Rural DVO, Paranoá, Planaltina, Rajadinha II, Rajadinha III, Recanto das Emas, Riacho Fundo, Samambaia, Santa Rita, São Sebastião, Sobradinho, Taguatinga)
RM Grande Vitória (ES):
Cariacica, Fundão, Guarapari, Serra, Viana, Vila Velha, Vitória
Ride DF/Entorno (GO):
Água Fria de Goiás, Mimoso de Goiás, Águas Lindas de Goiás, Cabeceiras, Cidade Ocidental, Cristalina, Formosa, Luziânia, Novo Gama, Padre Bernardo, Planaltina, Santo Antônio do Descoberto, Valparaíso de Goiás
RM Goiânia (GO):
Abadia de Goiás, Aparecida de Goiânia, Aragoiânia, Bela Vista de Goiás, Bonfinópolis, Brazabrantes, Caldazinha, Caturaí, Goianápolis, Goiânia, Goianira, Guapó, Hidrolândia, Inhumas, Nerópolis, Nova Veneza, Santo Antônio de Goiás, Senador Canedo, Terezópolis de Goiás, Trindade
Ride DF/Entorno (GO):
Abadiânia, Alexânia, Cocalzinho de Goiás, Corumbá de Goiás, Pirenópolis
RM Sudoeste Maranhense (MA):
Buritirana, Davinópolis, Governador Edison Lobão, Imperatriz, João Lisboa, Montes Altos, Ribamar Fiquene, Senador La Rocque
RM Belo Horizonte (MG):
Baldim, Belo Horizonte, Betim, Brumadinho, Caeté, Capim Branco, Confins, Contagem, Esmeraldas, Florestal, Ibirité, Igarapé, Itatiaiuçu, Jaboticatubas, Juatuba, Lagoa Santa, Mário Campos, Mateus Leme, Matozinhos, Nova Lima, Nova União, Pedro Leopoldo, Raposos, Ribeirão das Neves, Rio Acima, Rio Manso, Sabará, Santa Luzia, São Joaquim de Bicas, São José da Lapa, Sarzedo, Taquaraçu de Minas, Vespasiano
RM Vale do Aço (MG):
Coronel Fabriciano, Ipatinga, Timóteo
Ride DF/Entorno (MG):
Buritis, Cabeceira Grande, Unaí
RM Vale do Rio Cuiabá (MT):
Cuiabá, Nossa Senhora do Livramento, Santo Antonio do Leverger, Várzea Grande
RM Belém (PA):
Ananindeua, Belém, Benevides, Marituba, Santa Bárbara do Pará, Santa Isabel do Pará
RM Campina Grande (PB):
Alagoa Nova, Areial, Aroeiras, Barra de Santana, Boa Vista, Boqueirão, Campina Grande, Caturité, Esperança, Fagundes, Gado Bravo, Ingá, Itatuba, Lagoa Seca, Massaranduba, Matinhas, Montadas, Pocinhos, Puxinanã, Queimadas, Riachão do Bacamarte, Roça, Serra Redonda
RM João Pessoa (PB):
Alhandra, Bayeux, Caaporã, Cabedelo, Conde, Cruz do Espírito Santo, João Pessoa, Lucena, Mamanguape, Pitimbu, Rio Tinto, Santa Rita
Ride Petrolina/Juazeiro (PE):
Lagoa Grande, Orocó, Petrolina, Santa Maria da Boa Vista
RM Recife (PE):
Abreu e Lima, Araçoiaba, Cabo de Santo Agostinho, Camaragibe, Igarassu, Ilha de Itamaracá, Ipojuca, Itapissuma, Jaboatão dos Guararapes, Moreno, Paulista, Recife, São Lourenço da Mata
Ride Grande Teresina (PI):
Altos, Beneditinos, Coivaras, Curralinhos, Demerval Lobão, José de Freitas, Lagoa Alegre, Lagoa do Piauí, Miguel Leão, Monsenhor Gil, Teresina, União
RM Curitiba (PR):
Adrianópolis, Agudos do Sul, Almirante Tamandaré, Araucária, Balsa Nova, Bocaiúva do Sul, Campina Grande do Sul, Campo Largo, Campo Magro, Cerro Azul, Colombo, Contenda, Curitiba, Doutor Ulysses, Fazenda Rio Grande, Itaperuçu, Lapa, Mandirituba, Pinhais, Piraquara, Quatro Barras, Quitandinha, Rio Branco do Sul, São José dos Pinhais, Tijucas do Sul, Tunas do Paraná
RM Maringá (PR):
Bom Sucesso, Cambira, Jandaia do Sul
RM Londrina (PR):
Bela Vista do Paraíso, Cambé, Ibiporã, Jataizinho, Londrina, Rolândia, Sertanópolis,Tamara
RM Maringá (PR):
Ângulo, Astorga, Atalaia, Doutor Camargo, Floraí, Floresta, Flórida, Iguaraçu, Itambém, Ivatuba, Lobato, Mandaguaçu, Marialva, Maringá, Munhoz de Melo, Ourizona, Paiçandu, Presidente Castelo Branco, Santa Fé, São Jorge do Ivaí, Sarandi
RM Rio de Janeiro (RJ):
Belford Roxo, Duque de Caxias, Guapimirim, Itaboraí, Itaguaí, Japeri, Magé, Maricá, Mesquita, Nilópolis, Niterói, Nova Iguaçu, Paracambi, Queimados, Rio de Janeiro, São Gonçalo, São João de Meriti, Seropédica, Tanguá
RM Natal (RN):
Ceará-Mirim, Extremoz, Macaíba, Monte Alegre, Natal, Nísia Floresta, Parnamirim, São Gonçalo do Amarante, São José de Mipibu, Vera Cruz
RM da Capital – Roraima (RR):
Boa Vista, Cantá
RM Central – Roraima (RR):
Caracaraí, Iracema
RM do Sul do Estado – Roraima (RR):
Caroebe, São João da Baliza, São Luiz
RM Porto Alegre (RS):
Alvorada, Araricá, Arroio dos Ratos, Cachoeirinha, Campo Bom, Canoas, Capela de Santana, Charqueadas, Dois Irmãos, Eldorado do Sul, Estância Velha, Esteio, Glorinha, Gravataí, Guaíba, Ivoti, Montenegro, Nova Hartz, Nova Santa Rita, Novo Hamburgo, Parobé, Portão, Porto Alegre, Santo Antonio da Patrulha, São Jerônimo, São Leopoldo, Sapiranga, Sapucaia do Sul, Taquara, Triunfo, Viamão
RM Vale do Itajaí (SC):
Apiúna, Ascurra, Benedito Novo, Blumenau, Botuverá, Brusque, Doutor Pedrinho, Gaspar, Guabiruba, Ilhota, Indaial, Luiz Alves, Pomerode, Rio dos Cedros, Rodeio, Timbó
RM Chapecó (SC):
Águas de Chapecó, Águas Frias, Arvoredo, Caxambu do Sul, Chapecó, Coronel Freitas, Cunhataí, Faxinal dos Guedes, Guatambú, Itá, Marema, Nova Erechim, Nova Itaberaba, Paial , Palmitos, Pinhalzinho, Planalto Alegre, Quilombo, São Carlos, Saudades, Seara, União do Oeste, Xanxerê, Xavantina, Xaxim
RM Carbonífera (SC):
Araranguá, Balneário Arroio do Silva, Balneário Gaivota, Cocal do Sul, Criciúma, Ermo, Forquilhinha, Içara, Jacinto Machado, Lauro Muller, Maracajá, Meleiro, Morro da Fumaça, Morro Grande, Nova Veneza, Passo de Torres, Praia Grande, Santa Rosa do Sul, São João do Sul, Siderópolis, Sombrio, Timbé do Sul, Treviso, Turvo, Urussanga
RM Florianópolis (SC):
Águas Mornas, Alfredo Wagner, Angelina, Anitápolis, Antônio Carlos, Biguaçu, Canelinha, Florianópolis, Garopaba, Governador Celso Ramos, Leooberto Leal, Major Gercino, Nova Trento, Palhoça, Paulo Lopes, Rancho Queimado, Santo Amaro da Imperatriz, São Bonifácio, São João Batista, São José, São Pedro de Alcântara, Tijucas
RM Norte/Nordeste Catarinense (SC):
Araquari, Balneário Barra do Sul, Barra Velha, Campo Alegre, Corupá, Garuva, Guaramirim, Itaiópolis, Itapoá, Jaraguá do Sul, Joinville, Mafra, Massaranduba, Monte Castelo, Papanduva, Rio Negrinho, São Bento do Sul, São Francisco do Sul, São João do Itaperiú, Schroeder
RM Lages (SC):
Anita Garibaldi, Bocaina do Sul, Bom Jardim da Serra, Bom Retiro, Campo Belo do Sul, Capão Alto, Cerro Negro, Correia Pinto, Curitibanos, Frei Rogério, Lages, Otacílio Costa, Painel, Palmeira, Ponte Alta, Ponte Alta do Norte, Rio Rufino, Santa Cecília, São Cristovão do Sul, São Joaquim, São José do Cerrito, Urubici, Urupema
RM Tubarão (SC):
Armazém, Braço do Norte, Capivari de Baixo, Grão Pará, Gravatal, Imaruí, Imbituba, Jaguaruna, Laguna, Orleans, Pedras Grandes, Rio Fortuna, Sangão, Santa Rosa de Lima, São Ludgero, São Martinho, Treze de Maio, Tubarão
RM Aracaju (SE):
Aracaju, Barra dos Coqueiros, Nossa Senhora do Socorro, São Cristóvão
RM Campinas (SP):
Americana, Artur Nogueira, Campinas, Cosmópolis, Engenheiro Coelho, Holambra, Hortolândia, Indaiatuba, Jaguariúna, Monte Mor, Nova Odessa, Paulínia, Pedreira, Santa Bárbara D’Oeste, Santo Antônio de Posse, Sumaré, Valinhos, Vinhedo
RM Baixada Santista (SP):
Bertioga, Cubatão, Guarujá, Itanhaém, Mongaguá, Peruíbe, Praia Grande, Santos, São Vicente
Marcadores:
ddd cidades anatel conurbadas lei regulamento
terça-feira, 15 de fevereiro de 2011
Asterisk Security
How to make your asterisk safer:
Asterisk Security
Quick Start
Hardware Firewall
Most Asterisk boxes should be located behind a hardware firewall. Configure the firewall to block traffic from anyone that doesn't need to connect to you. Allow your VoIP provider, any remote phones/users, and others that may need to connect, but keep the restrictions as tight as possible. If you do have remote users, lock your firewall down to only allow those users to connect if possible, rather than opening it to the entire internet. If you have mobile users this may not be an option however.
Other services, such as SSH should be blocked by the hardware firewall.
Software Firewall
Implement a software firewall if possible, using Linux IP Chains. The rules should be similar to the hardware firewall, with the possible addition of additional rules to protect against attacks originating on the local LAN.
Fail2Ban
Implement Fail2Ban to prevent denial of service attacks (password guessing can cause excessive CPU utilization).
Strong Passwords
All remote users should have strong, alpha-numeric passwords. These should be long. They should NEVER be the same as the username or based on the user's extension.
Default Context
Your default context in extensions.conf should be empty. This context is used when other contexts might not match a peer. You should explicitly refer to a non-default context for remote SIP calls.
sip.conf configuration
In the general section, define:
[general]
...
context=bogus
allowguest=no
alwaysauthreject=no
...
The context line will refer to a context (which you *must define* in extensions.conf!) that should handle "default" SIP calls. This should go to a context with nothing in it (unless you want to play with them - then, if you have the bandwidth, feel free to play a recording or such!). Obviously if you want to accept anonymous SIP calls, send them to the proper context (but *never* a context that can dial out!).
The "allowguest" line disables anonymous SIP calls to your PBX. Some SIP providers connect as a guest user, however, so this may be inappropriate for your situation. Also, if you want to accept anonymous SIP calls, this line would block them, so you wouldn't want that. But it is listed here because it is the safest configuration.
The "alwaysauthreject" line is important. This causes a hacker to get the same response from your PBX when they try to guess passwords whether or not they guessed a valid username. This also has the side-effect of making poorly written scanning scripts (the vast majority of hacker scripts seem to be poorly written) take less resources on your Asterisk box, as even if they scan a valid username, they'll think it doesn't exist.
In addition to these, verify that all peers listed in sip.conf are valid and have strong passwords.
iax.conf
(I'm hoping others will fill in this section - I block IAX)
Dialplan
Do your users need to be able to dial internationally? If not, make sure your dialplan blocks international calls (in the US, these calls start with a 011 typically, although some countries "look like" US numbers - so also block calls to area codes that don't correspond to areas you call). You may be able to request your provider also blocks international calls. If you only have SOME users that need to call internationally, place them in a different context than the rest of your users.
Logs, CDR
Review your logs and CDR at least daily. Even one day of illegitimate calls can add up to tons of money quickly.
Asterisk Security
Quick Start
Hardware Firewall
Most Asterisk boxes should be located behind a hardware firewall. Configure the firewall to block traffic from anyone that doesn't need to connect to you. Allow your VoIP provider, any remote phones/users, and others that may need to connect, but keep the restrictions as tight as possible. If you do have remote users, lock your firewall down to only allow those users to connect if possible, rather than opening it to the entire internet. If you have mobile users this may not be an option however.
Other services, such as SSH should be blocked by the hardware firewall.
Software Firewall
Implement a software firewall if possible, using Linux IP Chains. The rules should be similar to the hardware firewall, with the possible addition of additional rules to protect against attacks originating on the local LAN.
Fail2Ban
Implement Fail2Ban to prevent denial of service attacks (password guessing can cause excessive CPU utilization).
Strong Passwords
All remote users should have strong, alpha-numeric passwords. These should be long. They should NEVER be the same as the username or based on the user's extension.
Default Context
Your default context in extensions.conf should be empty. This context is used when other contexts might not match a peer. You should explicitly refer to a non-default context for remote SIP calls.
sip.conf configuration
In the general section, define:
[general]
...
context=bogus
allowguest=no
alwaysauthreject=no
...
The context line will refer to a context (which you *must define* in extensions.conf!) that should handle "default" SIP calls. This should go to a context with nothing in it (unless you want to play with them - then, if you have the bandwidth, feel free to play a recording or such!). Obviously if you want to accept anonymous SIP calls, send them to the proper context (but *never* a context that can dial out!).
The "allowguest" line disables anonymous SIP calls to your PBX. Some SIP providers connect as a guest user, however, so this may be inappropriate for your situation. Also, if you want to accept anonymous SIP calls, this line would block them, so you wouldn't want that. But it is listed here because it is the safest configuration.
The "alwaysauthreject" line is important. This causes a hacker to get the same response from your PBX when they try to guess passwords whether or not they guessed a valid username. This also has the side-effect of making poorly written scanning scripts (the vast majority of hacker scripts seem to be poorly written) take less resources on your Asterisk box, as even if they scan a valid username, they'll think it doesn't exist.
In addition to these, verify that all peers listed in sip.conf are valid and have strong passwords.
iax.conf
(I'm hoping others will fill in this section - I block IAX)
Dialplan
Do your users need to be able to dial internationally? If not, make sure your dialplan blocks international calls (in the US, these calls start with a 011 typically, although some countries "look like" US numbers - so also block calls to area codes that don't correspond to areas you call). You may be able to request your provider also blocks international calls. If you only have SOME users that need to call internationally, place them in a different context than the rest of your users.
Logs, CDR
Review your logs and CDR at least daily. Even one day of illegitimate calls can add up to tons of money quickly.
sexta-feira, 4 de fevereiro de 2011
Tons de progresso da telefonia brasileira.
* Tom de discar - sinal senoidal contínuo de 425 Hz - informa ao usuário para iniciar a discagem.
* Tom de controle de chamada - sinal senoidal intermitente de 425Hz, com duração de 1s e interrupção de 4s sucessivamente. Informa ao usuário que originou a ligação, que o telefone do usuário para o qual a ligação foi direcionada esta "tocando".
* Tom de ocupado - sinal senoidal intermitente de 425 Hz, com duração de 250ms e interrupção de 250ms sucessivamente. Informa ao usuário que originou a ligação que o telefone do usuário para o qual a ligação se destina está ocupado.
* Tom de número inacessível ou inexistente - sinal senoidal intermitente de 425Hz com durações alternadas de 750ms e 250ms em intervalos de 250ms, sucessivamente. Informa ao usuário que efetuou a ligação que o número discado não existe ou esta inacessível naquele momento.
* Tom de toque de chamada - sinal elétrico senoidal intermitente de 25Hz e tensão de 75Volts com duração de 1s e intervalo de 4s. - possibilita que o telefone toque.
* Tom de controle de chamada - sinal senoidal intermitente de 425Hz, com duração de 1s e interrupção de 4s sucessivamente. Informa ao usuário que originou a ligação, que o telefone do usuário para o qual a ligação foi direcionada esta "tocando".
* Tom de ocupado - sinal senoidal intermitente de 425 Hz, com duração de 250ms e interrupção de 250ms sucessivamente. Informa ao usuário que originou a ligação que o telefone do usuário para o qual a ligação se destina está ocupado.
* Tom de número inacessível ou inexistente - sinal senoidal intermitente de 425Hz com durações alternadas de 750ms e 250ms em intervalos de 250ms, sucessivamente. Informa ao usuário que efetuou a ligação que o número discado não existe ou esta inacessível naquele momento.
* Tom de toque de chamada - sinal elétrico senoidal intermitente de 25Hz e tensão de 75Volts com duração de 1s e intervalo de 4s. - possibilita que o telefone toque.
sexta-feira, 28 de janeiro de 2011
Sip Messages Structure
Format
All SIP messages are either requests from a server or client or responses to a request. The messages are formatted according to RFC 822, "Standard for the format of ARPA internet text messages." For all messages, the general format is:
* A start line
* One or more header fields
* An empty line
* A message body (optional)
Each line must end with a carriage return-line feed (CRLF).
Requests
SIP uses six types (methods) of requests:
* INVITE—Indicates a user or service is being invited to participate in a call session.
* ACK—Confirms that the client has received a final response to an INVITE request.
* BYE—Terminates a call and can be sent by either the caller or the callee.
* CANCEL—Cancels any pending searches but does not terminate a call that has already been accepted.
* OPTIONS—Queries the capabilities of servers.
* REGISTER—Registers the address listed in the To header field with a SIP server.
Responses
The following types of responses are used by SIP and generated by the Cisco SIP Proxy Server:
* SIP 1xx—Informational Responses
* SIP 2xx—Successful Responses
* SIP 3xx—Redirection Responses
* SIP 4xx—Client Failure Responses
* SIP 5xx—Server Failure Responses
* SIP 6xx—Global Failure Responses
The Registration Process
A registration occurs when a client needs to inform a proxy or redirect server of its location. During this process, the client sends a REGISTER request to the proxy or redirect server and includes the address (or addresses) at which it can be reached.
The Invitation Process
An invitation occurs when one SIP end point (user A) "invites" another SIP endpoint (user B) to join in a call. During this process, user A sends an INVITE message requesting that user B join a particular conference or establish a two-party conversation. If user B wants to join the call, it sends an affirmative response (SIP 2xx). Otherwise, it sends a failure response (SIP 4xx). Upon receiving the response, user A acknowledges the response with an ACK message. If user A no longer wants to establish this conference, it sends a BYE message instead of an ACK message.
SIP is a new protocol developed by the Internet Engineering Task Force (IETF) Multiparty Multimedia Session Control (MMUSIC) Working Group as an alternative to the ITU-T H.323 specification. SIP is defined by RFC 2543 and is used for multimedia call session setup and control over IP networks.
Retirado de:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_programming_reference_guide_chapter09186a0080087357.html
Todos os direitos ao autor.
All SIP messages are either requests from a server or client or responses to a request. The messages are formatted according to RFC 822, "Standard for the format of ARPA internet text messages." For all messages, the general format is:
* A start line
* One or more header fields
* An empty line
* A message body (optional)
Each line must end with a carriage return-line feed (CRLF).
Requests
SIP uses six types (methods) of requests:
* INVITE—Indicates a user or service is being invited to participate in a call session.
* ACK—Confirms that the client has received a final response to an INVITE request.
* BYE—Terminates a call and can be sent by either the caller or the callee.
* CANCEL—Cancels any pending searches but does not terminate a call that has already been accepted.
* OPTIONS—Queries the capabilities of servers.
* REGISTER—Registers the address listed in the To header field with a SIP server.
Responses
The following types of responses are used by SIP and generated by the Cisco SIP Proxy Server:
* SIP 1xx—Informational Responses
* SIP 2xx—Successful Responses
* SIP 3xx—Redirection Responses
* SIP 4xx—Client Failure Responses
* SIP 5xx—Server Failure Responses
* SIP 6xx—Global Failure Responses
The Registration Process
A registration occurs when a client needs to inform a proxy or redirect server of its location. During this process, the client sends a REGISTER request to the proxy or redirect server and includes the address (or addresses) at which it can be reached.
The Invitation Process
An invitation occurs when one SIP end point (user A) "invites" another SIP endpoint (user B) to join in a call. During this process, user A sends an INVITE message requesting that user B join a particular conference or establish a two-party conversation. If user B wants to join the call, it sends an affirmative response (SIP 2xx). Otherwise, it sends a failure response (SIP 4xx). Upon receiving the response, user A acknowledges the response with an ACK message. If user A no longer wants to establish this conference, it sends a BYE message instead of an ACK message.
SIP is a new protocol developed by the Internet Engineering Task Force (IETF) Multiparty Multimedia Session Control (MMUSIC) Working Group as an alternative to the ITU-T H.323 specification. SIP is defined by RFC 2543 and is used for multimedia call session setup and control over IP networks.
Retirado de:
http://www.cisco.com/en/US/products/sw/iosswrel/ps1835/products_programming_reference_guide_chapter09186a0080087357.html
Todos os direitos ao autor.
Marcadores:
sip messages invite ack voip phone ip
sexta-feira, 21 de janeiro de 2011
Apache 2 e PHP 5
Apache 2 and PHP Installation
The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on Linux. These instructions also apply, mostly, for any UNIX-like system, especially other Linux distributions. If you have a recent Linux distribution (say since 2002), you already have Apache 2 and PHP, so you don't need to do this unless you want the latest Apache 2 or PHP release or need to customize the Apache or PHP software. Don't forget to remove (or at least disable) the Apache rpm package if you install your own custom Apache.
Apache 2 Version Tip: Beginning with Apache 2.0.42 the API will be kept stable (yeah!). That means you will NOT have to recompile modules (and possibly upgrade/fix source) every time you install a new Apache release. This assumes you stay in the same Apache release series. For example, upgrading from 2.2.0 to 2.2.2 should work. This will not apply to upgrading to the next series (e.g., "development" 2.3.x or "stable" 2.4.x).
I was only able to get PHP working with Apache 2 as a *.so DSO ("dynamic shared object"), as opposed to compiled into Apache (with a static *.a library). I think DSO is the only way PHP is supported now on Apache 2.
I first used httpd-2.0.43 and php-4.3.0 with RedHat 7.3. I am now using httpd-2.2.3 and php-5.2.0 with SUSE 10.1.
Note: If you have problems with PHP and think it's a recent bug, you may want to consider using the latest http://snaps.php.net/ snapshot. Beware that snapshots frequently have regression and are not for production use. Usually problems are because of mis-configuration, not bugs, so snapshots will probably hurt more than help.
1. Download/unpack Apache2 source from the Apache httpd server website, http://httpd.apache.org/
2. In the Apache 2 source directory, create a Makefile by typing:
./configure --prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-info \
--enable-rewrite \
--enable-speling \
--enable-usertrack \
--enable-deflate \
--enable-ssl \
--enable-mime-magic
You only need the enable-so line above. For information on other options, type ./configure --help and see "Compiling and Installing" in the Apache 2 Documentation, http://httpd.apache.org/
3. Make Apache from the just-created Makefile:
make
4. If make is successful, install Apache as root:
make install
5. Download/unpack PHP source from the PHP website, http://www.php.net/
Pick the latest from the 4.x series or 5.x series.
6. In the PHP source directory, create a Makefile by typing:
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext \
--with-gdbm
You only need the --with-apxs2, and prefix lines. --with-mysql adds MySql (you need to specify the directory if it's in a unusual location (e.g., --with-mysql=/usr/local ), --with-config-file moves the php.ini file location, disable-cgi disables the CGI version, which is not needed if you use Apache modules. It also enables and installs the command line interface (CLI) version. --with-zlib allows use of gzip-type compression, --with-gettext is for internationalization, and --with-gdbm allows access to GDBM databases. For more information, type ./configure --help and see the "Installation" chapter in the PHP Manual, http://ww.php.net/docs.php
7. Make PHP from the just-created Makefile:
make
8. If make is successful, type this as root to install PHP:
make install
If you are not root (I do not perform makes while root, for security and safety reasons), become root and type the following:
make install-su
9. If file /usr/local/apache/modules/libphp5.so does not exist or is an older version, type this (change this to libphp4.so for PHP 4):
cp -p .libs/libphp5.so /usr/local/apache/modules
10. Install the php.ini file:
cp -p php.ini-recommended /usr/local/apache/php/php.ini
11. Add these directives are in /usr/local/apache/conf/httpd.conf (if already there, verify they are correct):
# Make sure there's only **1** line for each of these 2 directives:
# Use for PHP 4.x:
#LoadModule php4_module modules/libphp4.so
#AddHandler php-script php
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
AddType text/html php
# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps
Note 1: The php documentation recommends AddType application/x-httpd-php php instead of the above. However, it causes problems with the "MultiViews" feature of HTTP. That is, if the .php extension is left off a URL, and with certain browser Accept headers, Apache will not know .php (application/x-httpd-php) is HTML and will return a 406 Not Acceptable error. Using the AddType and AddHandler as shown above fixes this problem. For details see Mark Tranchant's webpage, "Using Apache's MultiViews with PHP whilst avoid 406 errors," and PHP bug 28023.
Note 2: PHP Syntax coloring isn't required, but it's very nice for looking at your php source while debugging. Here's an example.
Note 3: just for completeness I'll mention that you should be able to use SetOutputFilter / SetInputFilter instead of AddType, but you can't use both. However, SetOutputFilter / SetInputFilter no longer works for me. It used to work with an earlier PHP 4.x or Apache 2 version, but not with Apache 2.0.47/PHP 4.3.3. I understand this (PHP as an Apache 2 filter) is experimental, so I don't use it anymore:
SetOutputFilter PHP
SetInputFilter PHP
12. You're now ready to try it out. Start Apache (httpd) as root:
/usr/local/apache/bin/apachectl start
13. Perform these sanity checks to verify your install went OK:
$ /usr/local/apache/bin/httpd -t
Syntax OK
$ /usr/local/apache/bin/httpd -v
Server version: Apache/2.2.2
Server built: May 29 2006 12:40:55
$ /usr/local/apache/bin/httpd -V
Server version: Apache/2.2.2
Server built: May 29 2006 12:40:55
Server's Module Magic Number: 20051115:2
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
$ /usr/local/apache/bin/httpd -S
VirtualHost configuration:
. . .
$ /usr/local/apache/bin/httpd -l
Compiled in modules:
core.c
. . .
mod_so.c
$ /usr/local/apache/bin/httpd -M
Loaded Modules:
. . .
php5_module (shared)
Syntax OK
(the above works for Apache 2.2.x and higher only)
$ ps -ef |grep httpd
root 24069 1 0 09:17 ? 00:00:08 /usr/local/apache/bin/httpd -k s
apache 29917 24069 0 15:30 ? 00:00:00 /usr/local/apache/bin/httpd -k s
. . .
Note: on BSD-based UNIX systems, you need to use "ps -aux" instead of "ps -ef".
14. Access your webserver with telnet. Type HEAD / HTTP/1.0 followed by a blank line:
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Mon, 29 May 2006 23:28:18 GMT
Server: Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.7a PHP/5.1.4
X-Powered-By: PHP/5.1.4
Last-Modified: Wed, 15 Mar 2006 06:53:17 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
Connection closed by foreign host.
15. Access your webserver with your favorite browser. The following is a good test page to use for PHP. You only need the one line in bold is needed to display PHP configuration information. Name the file anything you want, but it must end with .php, such as phpinfo.php, and move the file to your web server content directory (for me /usr/local/apache/htdocs), with read permission set:
php logo Tips and Notes
• Disabling Existing Apache Software
If Apache is already installed with your Linux distribution you have to disable it before installing your own custom version. To do this, type the following under RedHat Linux:
/sbin/chkconfig --del httpd
/etc/init.d/httpd stop
You may also remove the httpd and php rpm packages, and dependent packages, if you wish.
• Automatic Startup of Apache
To start Apache automatically, follow these steps:
* Copy Apache startup file to the startup directory:
cp /usr/local/apache/bin/apachectl /etc/init.d/
* Edit /etc/init.d/apachectl by inserting these 2 lines in bold:
#!/bin/sh
#
# chkconfig: - 85 15
# description: Apache is a Web server used to serve HTML files and CGI.
#
# Copyright 2000-2005 The Apache Software Foundation or its licensors, as
# applicable.
. . .
# Apache control script designed to allow an easy command line interface
# to controlling Apache. Written by Marc Slemko, 1997/08/23
. . .
* Enable httpd to startup automatically:
/sbin/chkconfig --add apachectl
/sbin/chkconfig --level 2 apachectl on
This works for RedHat Linux, Mandrake, SuSE, and Sun Java Desktop System. The equivalent of chkconfig for Debian is:
update-rc.d apachectl defaults
For other distributions, make appropriate softlinks to directories /etc/rc*.d/
* Reboot Linux to verify Apache starts
[Thanks to Beriah Dutcher and others]
• Make doesn't make dynamic library libphp5.so, just static library libphp5.a
First make sure libphp5.so isn't there. It's usually in the libs or .libs subdirectory. Run find from the PHP source directory root: find . -name libphp5.so If that doesn't work, make sure you use the --with-apxs2 option with the correct directory in ./configure. For example:
./configure --with-mysql --with-apxs2=/path/to/apache/apxs
When re-running ./configure always start with a fresh, clean source directory (no object).
(For PHP 4, substitute libphp4.so and libphp4.a for libphp5.so and libphp5.a, respectively.)
• PHP 5: My PHP scripts that worked with PHP 4 now ignores input variables
If you have old PHP 4 scripts you don't want to convert to PHP 5, change this line in your php.ini file:
register_long_arrays = On
For the long term, you may want to upgrade your PHP software or convert the PHP source code to use new-style variables. E.g., use $_REQUEST[i] instead of $i
• PHP 5.2.0 Upgrade from 5.1.x (November 2006)
I had one problem with upgrading from PHP 5.1.x to 5.2.0. The Phorum 3 software I use has a function date_format that now conflicts with a new PHP 5.2 internal function, also called date_format. This new function is used for PHP 5.2.x's new "datetime support". I fixed this by renaming Phorum's date_format function to not conflict with PHP's function. See also PHP 5.2 Update Info for more PHP 5.2 upgrade information.
• PHP 5.x: you may need to upgrade libxml2 to use XML
To use PHP 5 and XML (--with-xml), you need the libxml2 library version 2.6.0 or greater. You may need to upgrade if you have an older Linux distribution. Check with rpm -q libxml2
If it's not installed, check your installation disks for the libxml2 package. If it's too old, you can get the library from XMLSoft.org. You will probably need to compile and install it yourself.
• PHP 4.3.5 / 4.3.6 / 5.0RC1 PCRE Regression (March 2004)
If you use PHP 4.3.5, 4.3.6, or PHP 5.0 RC1 with PCRE (Perl Regular Expressions, the default), you get a core dump when you try and restart (SIGHUP) Apache (at least with Apache 2.0.49). The cause is from adding a new version of PCRE, 4.5, in PHP. This is fixed in PHP 4.3.7 and 5.0.
The symptom are these messages in error_log (which is also a symptom for lots of other memory-type bugs in Apache):
[Wed Mar 31 17:14:43 2004] [notice] SIGHUP received. Attempting to restart
[Wed Mar 31 17:14:43 2004] [notice] seg fault or similar nasty error detected in the parent process
[Wed Mar 31 17:14:48 2004] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
To fix, upgrade to PHP 4.3.7 or higher, which fixes it (PHP 5.0 or higher also fixes the bug). A workaround is to stop/start Apache, instead of restarting Apache. For details, see PHP bug 27810.
• ServerRoot Installation Directory
By default, Apache is installed in ServerRoot, as specified in httpd.conf or the httpd -d option:
ServerRoot "/usr/local/apache"
Some packagers and distributions move the location to /usr/local/httpd or /usr/local/apache2 so check that Apache is installed where you say it is, and check that you don't have two separate Apache installations by mistake.
• PHP-required Apache files must be present
PHP expects certain files to be present. They may be missing for some Linux distributions, which tend to separate files among the /var, /etc, and other directories. The apxs program expects to find httpd under the bin directory where apache is installed (by default /usr/local/apache/bin). PHP expects to find the os.h and unixd.h header files under the include directory where apache is installed (by default /usr/local/apache/include).
• MySQL
Use the --with-mysql configure option to build PHP with PHP's version of MySql. If you want the system's MySQL, or are also using MySql with another apache module (e.g., mod_perl), use this: with-mysql=/usr
Make sure the MySQL developent headers are installed. This is usually package mysql-devel (thanks to Dev for the tip)
• Custom OpenSSL and SSL
When using "--enable-ssl" (i.e, build with OpenSSL), the configure script will try to guess the location of OpenSSL. If you're using your own custom SSL, you must specify the location. For example, "--with-ssl=/usr/local/ssl" (of course, you can use the SSL and PHP that comes with Redhat 9 and other distributions).
Please note that mod_ssl is only for Apache 1.x. Apache 2.x does not use mod_ssl—SSL is built into Apache 2.x.
Jason reports that with RedHat 9 on his system, the make failed at mod_ssl. It needed a missing krb5.h header file. The fix is to Add an environment variable, $CFLAGS, before making PHP. That is:
"-I/usr/kerberos/include/ -L/usr/kerberos/lib"
• gdbm
If you get this error when using "--with-gdbm":
configure: error: DBA: Could not find necessary header file(s).
then you are probably missing the gdbm-devel rpm package.
• Apache 1.x and Apache 2 Configuration Directives
The "AddModule," "AgentLog," "ReferrerLog," "RefererIgnore," "BindAddress," "ClearModuleList," "Port," "FancyIndexing," "ServerType," "AccessConfig," and "ResourceConfig" directives in Apache 1.x no longer exist in Apache 2. Also, "HAVE_*" httpd.conf definitions no longer exist. Comment them out of your httpd.conf for Apache 2. Most of these directives have been replaced by other directive(s).
• Error after glibc library upgrade
Apache should still work after upgrading glibc with security and bug fixes for the same release. If you use another architecture (say from or to i386/i686), you need to recompile. One symptom is an error like this in your Apache error_log:
[error] (38)Function not implemented:
• make clean
Kåre Olaussen adds this note: If you're compiling php4 for both Apache 1.3 and Apache 2, use a separate php source directory for each version of Apache. "The module wouldn't load into Apache 2, because I had forgotten to run make clean in between." [Ed. note: I recommend untaring the source from scratch in another directory, that way you are sure no old state information is left behind from previous makes. Do this for any configuration or version changes.]
• Enabling register_globals for Apache 2
From Duke: For those of you that are desperately trying to enable register_globals on a per-directory basis using Apache 2 with PHP 4 [or PHP 5] using .htaccess files, the syntax is different from Apache 1.x. In the directory you want to enable register_globals (or pretty much any other on/off setting), add an .htaccess file containing:
php_value register_globals 1
Note that php_flag does not work with Apache 2. Neither does on / off — you must use 0 (off) or 1 (on).
[Editor's note: To enable globally, add register_globals=off to your php.ini file.]
To enable register_globals on a per-directory basis, you can add to a stanza or create a .htaccess configuration file in the directory. To use .htaccess, you must first enable it by adding AllowOverride All (or some combination of AllowOverride options within the correct stanza. Also newer PHP software, such as SquirrelMail, no longer require register_globals to be enabled. Keeping register_globals disalbed makes the system much more secure (as it's harder to set internal php variables through submitting html forms). ]
• Multi-Processing Module (MPM): don't use multi-threading MPMs
MPMs is how Apache 2 handles multiple web server requests. That is, with multiple processes or multiple threads or some combination. For now, on Linux (and even UNIX) you should only use the (default) prefork module with PHP. This is specified at compile time. Other MPM modules (any involving threads) break PHP. This is partly because PHP uses a great number of external libraries, and many or most of them are not thread-safe or thread-aware. In any case, Linux 2.4 doesn't handle threads efficiently yet—multiple processes are better (this changes with Linux 2.6, or RedHat 9 with 2.6 threads backported to Linux 2.4).
• API module structure `php5_module' in file . . . is garbled
If you get a message like this:
httpd: Syntax error on line 195 of /usr/local/apache/conf/httpd.conf: API module
structure `php5_module' in file /usr/local/apache/modules/libphp5.so is garbled
- perhaps this is not an Apache module DSO
it's because your version of PHP wasn't built for the version of Apache you are using (For PHP 4, substitute php4_module . . . libphp4.so). Recompile PHP in a "fresh" source directory (where you haven't built PHP before) and make sure --prefix, --with-config-file and --with-apxs2 points to the correct Apache directories you are using and the libphp4.so file has been copied to your /usr/local/apache/modules directory.
• PATH_INFO
Dan Fitzpatrick notes that he uses PATH_INFO for many PHP scripts like /index.php/go/do/something (where parameters are passed to PHP as "fake" subdirectories). He received a 404 Not Found errors with Apache 2 but not Apache 1.3.27. He had to add "AcceptPathInfo On" to file httpd.conf. For details, see http://httpd.apache.org/docs-2.2/mod/core.html#acceptpathinfo
• Using style tags in addition to style tags
If you want to also use the old-style (or MS ASP-like) tags then add this line to your php.ini file. This is the default starting with PHP 5:
short_open_tag = On
• GD library now built-in PHP
PHP 4.3.0 has gd built-in, just pass --with-gd to PHP configure.
• --with-apache
If you don't have Apache source at the default directory at /usr/local/apache, then use --with-apache=DIR with PHP configure, where DIR is the root source directory, This tells PHP where to look for the Apache source.
• Redhat 9
Apache 2 and PHP is built-in RedHat 9 (packages httpd 2.0.40, and php 4.2.2). Apache is mostly under /usr/lib/httpd and /usr/sbin/httpd. PHP is at /usr/lib/httpd/modules/libphp4.so For a complete file listing, type: rpm -ql httpd php
For RedHat 9, PHP 4.3.1 gives a compiler errors with RedHat 9 similar to: my_malloc.c:24: undefined reference to `errno'
The problem is with mysql and will have to wait for a fix from them. Until then, add this line:
#include
to the beginning of file ./ext/mysql/libmysql/mysql.h in your PHP source and remake PHP (from scratch).
• Notes about Gentoo Linux and Apache2 with PHP
LoadModule php5_module modules/libphp5.so
becomes:
LoadModule php5_module /usr/lib/apache2-extramodules/libphp5.so
To start automatically under Gentoo:
rc-update add apache2 default
(change php5 to php4 for PHP 4)
[Thanks to Phillip Temple]
php logo References
* Apache and PHP
* Original posting on USENET newsgroup comp.lang.php, 1b7cbdd3.0210181532.68d981cb%40posting.google.com
* "Compiling PHP 4 and Apache 2 from source on Linux OS", a document similar to this one, with more details and options, by Sukhwinder Singh.
* Install & Configure Apache, PHP, JSP, Ruby on Rails, MySQL, PHPMyAdmin & WordPress on Windows XP/2000
* OnLAMP.com: Good source of PHP and Apache tutorials (O'Reilly)
* Apache
* Apache httpd server website: Links to documentation and source
o How to upgrade from Apache 1.3 to 2.0
o How to upgrade from Apache 2.0 to 2.2
o Why should you upgrade (Apache 2.0 features)
* Migrating Apache HTTP Server 1.3 Configuration Files (Redhat)
* Sites Reject Apache2 commentary on Slashdot about slow adoption of Apache 2 due to a lack of 3rd-party modules (9/2002).
* ApacheWeek has the best updates on Apache development effort.
* Apache on Slashdot also has news on Apache and related efforts.
* PHP
* PHP website: Has links to documentation, source, mailing lists, and news groups
* PHP Weekly Summary, is a good source on the latest PHP developments.
* PHP FAQ: Old, but still useful. Note that the newsgroup has moved to USENET newsgroup comp.lang.php. (also available at Google Groups)
* PHP Security
o Secure Programming in PHP by Thomas Oertli (Zend.com, 1/2002)
o Security Notes by JeffCT (DevShed.com, 1/2001)
Retirado de: http://dan.drydog.com/apache2php.html
Todos os direitos ao autor.
The following notes are how I got Apache 2 and PHP 5 (or PHP 4) working together on Linux. These instructions also apply, mostly, for any UNIX-like system, especially other Linux distributions. If you have a recent Linux distribution (say since 2002), you already have Apache 2 and PHP, so you don't need to do this unless you want the latest Apache 2 or PHP release or need to customize the Apache or PHP software. Don't forget to remove (or at least disable) the Apache rpm package if you install your own custom Apache.
Apache 2 Version Tip: Beginning with Apache 2.0.42 the API will be kept stable (yeah!). That means you will NOT have to recompile modules (and possibly upgrade/fix source) every time you install a new Apache release. This assumes you stay in the same Apache release series. For example, upgrading from 2.2.0 to 2.2.2 should work. This will not apply to upgrading to the next series (e.g., "development" 2.3.x or "stable" 2.4.x).
I was only able to get PHP working with Apache 2 as a *.so DSO ("dynamic shared object"), as opposed to compiled into Apache (with a static *.a library). I think DSO is the only way PHP is supported now on Apache 2.
I first used httpd-2.0.43 and php-4.3.0 with RedHat 7.3. I am now using httpd-2.2.3 and php-5.2.0 with SUSE 10.1.
Note: If you have problems with PHP and think it's a recent bug, you may want to consider using the latest http://snaps.php.net/ snapshot. Beware that snapshots frequently have regression and are not for production use. Usually problems are because of mis-configuration, not bugs, so snapshots will probably hurt more than help.
1. Download/unpack Apache2 source from the Apache httpd server website, http://httpd.apache.org/
2. In the Apache 2 source directory, create a Makefile by typing:
./configure --prefix=/usr/local/apache \
--enable-so \
--enable-cgi \
--enable-info \
--enable-rewrite \
--enable-speling \
--enable-usertrack \
--enable-deflate \
--enable-ssl \
--enable-mime-magic
You only need the enable-so line above. For information on other options, type ./configure --help and see "Compiling and Installing" in the Apache 2 Documentation, http://httpd.apache.org/
3. Make Apache from the just-created Makefile:
make
4. If make is successful, install Apache as root:
make install
5. Download/unpack PHP source from the PHP website, http://www.php.net/
Pick the latest from the 4.x series or 5.x series.
6. In the PHP source directory, create a Makefile by typing:
./configure \
--with-apxs2=/usr/local/apache/bin/apxs \
--with-mysql \
--prefix=/usr/local/apache/php \
--with-config-file-path=/usr/local/apache/php \
--enable-force-cgi-redirect \
--disable-cgi \
--with-zlib \
--with-gettext \
--with-gdbm
You only need the --with-apxs2, and prefix lines. --with-mysql adds MySql (you need to specify the directory if it's in a unusual location (e.g., --with-mysql=/usr/local ), --with-config-file moves the php.ini file location, disable-cgi disables the CGI version, which is not needed if you use Apache modules. It also enables and installs the command line interface (CLI) version. --with-zlib allows use of gzip-type compression, --with-gettext is for internationalization, and --with-gdbm allows access to GDBM databases. For more information, type ./configure --help and see the "Installation" chapter in the PHP Manual, http://ww.php.net/docs.php
7. Make PHP from the just-created Makefile:
make
8. If make is successful, type this as root to install PHP:
make install
If you are not root (I do not perform makes while root, for security and safety reasons), become root and type the following:
make install-su
9. If file /usr/local/apache/modules/libphp5.so does not exist or is an older version, type this (change this to libphp4.so for PHP 4):
cp -p .libs/libphp5.so /usr/local/apache/modules
10. Install the php.ini file:
cp -p php.ini-recommended /usr/local/apache/php/php.ini
11. Add these directives are in /usr/local/apache/conf/httpd.conf (if already there, verify they are correct):
# Make sure there's only **1** line for each of these 2 directives:
# Use for PHP 4.x:
#LoadModule php4_module modules/libphp4.so
#AddHandler php-script php
# Use for PHP 5.x:
LoadModule php5_module modules/libphp5.so
AddHandler php5-script php
# Add index.php to your DirectoryIndex line:
DirectoryIndex index.html index.php
AddType text/html php
# PHP Syntax Coloring
# (optional but useful for reading PHP source for debugging):
AddType application/x-httpd-php-source phps
Note 1: The php documentation recommends AddType application/x-httpd-php php instead of the above. However, it causes problems with the "MultiViews" feature of HTTP. That is, if the .php extension is left off a URL, and with certain browser Accept headers, Apache will not know .php (application/x-httpd-php) is HTML and will return a 406 Not Acceptable error. Using the AddType and AddHandler as shown above fixes this problem. For details see Mark Tranchant's webpage, "Using Apache's MultiViews with PHP whilst avoid 406 errors," and PHP bug 28023.
Note 2: PHP Syntax coloring isn't required, but it's very nice for looking at your php source while debugging. Here's an example.
Note 3: just for completeness I'll mention that you should be able to use SetOutputFilter / SetInputFilter instead of AddType, but you can't use both. However, SetOutputFilter / SetInputFilter no longer works for me. It used to work with an earlier PHP 4.x or Apache 2 version, but not with Apache 2.0.47/PHP 4.3.3. I understand this (PHP as an Apache 2 filter) is experimental, so I don't use it anymore:
SetOutputFilter PHP
SetInputFilter PHP
12. You're now ready to try it out. Start Apache (httpd) as root:
/usr/local/apache/bin/apachectl start
13. Perform these sanity checks to verify your install went OK:
$ /usr/local/apache/bin/httpd -t
Syntax OK
$ /usr/local/apache/bin/httpd -v
Server version: Apache/2.2.2
Server built: May 29 2006 12:40:55
$ /usr/local/apache/bin/httpd -V
Server version: Apache/2.2.2
Server built: May 29 2006 12:40:55
Server's Module Magic Number: 20051115:2
Server loaded: APR 1.2.7, APR-Util 1.2.7
Compiled using: APR 1.2.7, APR-Util 1.2.7
Architecture: 32-bit
Server MPM: Prefork
threaded: no
forked: yes (variable process count)
Server compiled with....
-D APACHE_MPM_DIR="server/mpm/prefork"
-D APR_HAS_SENDFILE
-D APR_HAS_MMAP
-D APR_HAVE_IPV6 (IPv4-mapped addresses enabled)
-D APR_USE_SYSVSEM_SERIALIZE
-D APR_USE_PTHREAD_SERIALIZE
-D SINGLE_LISTEN_UNSERIALIZED_ACCEPT
-D APR_HAS_OTHER_CHILD
-D AP_HAVE_RELIABLE_PIPED_LOGS
-D DYNAMIC_MODULE_LIMIT=128
-D HTTPD_ROOT="/usr/local/apache"
-D SUEXEC_BIN="/usr/local/apache/bin/suexec"
-D DEFAULT_PIDLOG="logs/httpd.pid"
-D DEFAULT_SCOREBOARD="logs/apache_runtime_status"
-D DEFAULT_LOCKFILE="logs/accept.lock"
-D DEFAULT_ERRORLOG="logs/error_log"
-D AP_TYPES_CONFIG_FILE="conf/mime.types"
-D SERVER_CONFIG_FILE="conf/httpd.conf"
$ /usr/local/apache/bin/httpd -S
VirtualHost configuration:
. . .
$ /usr/local/apache/bin/httpd -l
Compiled in modules:
core.c
. . .
mod_so.c
$ /usr/local/apache/bin/httpd -M
Loaded Modules:
. . .
php5_module (shared)
Syntax OK
(the above works for Apache 2.2.x and higher only)
$ ps -ef |grep httpd
root 24069 1 0 09:17 ? 00:00:08 /usr/local/apache/bin/httpd -k s
apache 29917 24069 0 15:30 ? 00:00:00 /usr/local/apache/bin/httpd -k s
. . .
Note: on BSD-based UNIX systems, you need to use "ps -aux" instead of "ps -ef".
14. Access your webserver with telnet. Type HEAD / HTTP/1.0 followed by a blank line:
$ telnet localhost 80
Trying 127.0.0.1...
Connected to localhost (127.0.0.1).
Escape character is '^]'.
HEAD / HTTP/1.0
HTTP/1.1 200 OK
Date: Mon, 29 May 2006 23:28:18 GMT
Server: Apache/2.2.2 (Unix) mod_ssl/2.2.2 OpenSSL/0.9.7a PHP/5.1.4
X-Powered-By: PHP/5.1.4
Last-Modified: Wed, 15 Mar 2006 06:53:17 GMT
Vary: Accept-Encoding
Connection: close
Content-Type: text/html; charset=ISO-8859-1
Content-Language: en
Connection closed by foreign host.
15. Access your webserver with your favorite browser. The following is a good test page to use for PHP. You only need the one line in bold is needed to display PHP configuration information. Name the file anything you want, but it must end with .php, such as phpinfo.php, and move the file to your web server content directory (for me /usr/local/apache/htdocs), with read permission set:
php logo Tips and Notes
• Disabling Existing Apache Software
If Apache is already installed with your Linux distribution you have to disable it before installing your own custom version. To do this, type the following under RedHat Linux:
/sbin/chkconfig --del httpd
/etc/init.d/httpd stop
You may also remove the httpd and php rpm packages, and dependent packages, if you wish.
• Automatic Startup of Apache
To start Apache automatically, follow these steps:
* Copy Apache startup file to the startup directory:
cp /usr/local/apache/bin/apachectl /etc/init.d/
* Edit /etc/init.d/apachectl by inserting these 2 lines in bold:
#!/bin/sh
#
# chkconfig: - 85 15
# description: Apache is a Web server used to serve HTML files and CGI.
#
# Copyright 2000-2005 The Apache Software Foundation or its licensors, as
# applicable.
. . .
# Apache control script designed to allow an easy command line interface
# to controlling Apache. Written by Marc Slemko, 1997/08/23
. . .
* Enable httpd to startup automatically:
/sbin/chkconfig --add apachectl
/sbin/chkconfig --level 2 apachectl on
This works for RedHat Linux, Mandrake, SuSE, and Sun Java Desktop System. The equivalent of chkconfig for Debian is:
update-rc.d apachectl defaults
For other distributions, make appropriate softlinks to directories /etc/rc*.d/
* Reboot Linux to verify Apache starts
[Thanks to Beriah Dutcher and others]
• Make doesn't make dynamic library libphp5.so, just static library libphp5.a
First make sure libphp5.so isn't there. It's usually in the libs or .libs subdirectory. Run find from the PHP source directory root: find . -name libphp5.so If that doesn't work, make sure you use the --with-apxs2 option with the correct directory in ./configure. For example:
./configure --with-mysql --with-apxs2=/path/to/apache/apxs
When re-running ./configure always start with a fresh, clean source directory (no object).
(For PHP 4, substitute libphp4.so and libphp4.a for libphp5.so and libphp5.a, respectively.)
• PHP 5: My PHP scripts that worked with PHP 4 now ignores input variables
If you have old PHP 4 scripts you don't want to convert to PHP 5, change this line in your php.ini file:
register_long_arrays = On
For the long term, you may want to upgrade your PHP software or convert the PHP source code to use new-style variables. E.g., use $_REQUEST[i] instead of $i
• PHP 5.2.0 Upgrade from 5.1.x (November 2006)
I had one problem with upgrading from PHP 5.1.x to 5.2.0. The Phorum 3 software I use has a function date_format that now conflicts with a new PHP 5.2 internal function, also called date_format. This new function is used for PHP 5.2.x's new "datetime support". I fixed this by renaming Phorum's date_format function to not conflict with PHP's function. See also PHP 5.2 Update Info for more PHP 5.2 upgrade information.
• PHP 5.x: you may need to upgrade libxml2 to use XML
To use PHP 5 and XML (--with-xml), you need the libxml2 library version 2.6.0 or greater. You may need to upgrade if you have an older Linux distribution. Check with rpm -q libxml2
If it's not installed, check your installation disks for the libxml2 package. If it's too old, you can get the library from XMLSoft.org. You will probably need to compile and install it yourself.
• PHP 4.3.5 / 4.3.6 / 5.0RC1 PCRE Regression (March 2004)
If you use PHP 4.3.5, 4.3.6, or PHP 5.0 RC1 with PCRE (Perl Regular Expressions, the default), you get a core dump when you try and restart (SIGHUP) Apache (at least with Apache 2.0.49). The cause is from adding a new version of PCRE, 4.5, in PHP. This is fixed in PHP 4.3.7 and 5.0.
The symptom are these messages in error_log (which is also a symptom for lots of other memory-type bugs in Apache):
[Wed Mar 31 17:14:43 2004] [notice] SIGHUP received. Attempting to restart
[Wed Mar 31 17:14:43 2004] [notice] seg fault or similar nasty error detected in the parent process
[Wed Mar 31 17:14:48 2004] [warn] pid file /var/run/httpd.pid overwritten -- Unclean shutdown of previous Apache run?
To fix, upgrade to PHP 4.3.7 or higher, which fixes it (PHP 5.0 or higher also fixes the bug). A workaround is to stop/start Apache, instead of restarting Apache. For details, see PHP bug 27810.
• ServerRoot Installation Directory
By default, Apache is installed in ServerRoot, as specified in httpd.conf or the httpd -d option:
ServerRoot "/usr/local/apache"
Some packagers and distributions move the location to /usr/local/httpd or /usr/local/apache2 so check that Apache is installed where you say it is, and check that you don't have two separate Apache installations by mistake.
• PHP-required Apache files must be present
PHP expects certain files to be present. They may be missing for some Linux distributions, which tend to separate files among the /var, /etc, and other directories. The apxs program expects to find httpd under the bin directory where apache is installed (by default /usr/local/apache/bin). PHP expects to find the os.h and unixd.h header files under the include directory where apache is installed (by default /usr/local/apache/include).
• MySQL
Use the --with-mysql configure option to build PHP with PHP's version of MySql. If you want the system's MySQL, or are also using MySql with another apache module (e.g., mod_perl), use this: with-mysql=/usr
Make sure the MySQL developent headers are installed. This is usually package mysql-devel (thanks to Dev for the tip)
• Custom OpenSSL and SSL
When using "--enable-ssl" (i.e, build with OpenSSL), the configure script will try to guess the location of OpenSSL. If you're using your own custom SSL, you must specify the location. For example, "--with-ssl=/usr/local/ssl" (of course, you can use the SSL and PHP that comes with Redhat 9 and other distributions).
Please note that mod_ssl is only for Apache 1.x. Apache 2.x does not use mod_ssl—SSL is built into Apache 2.x.
Jason reports that with RedHat 9 on his system, the make failed at mod_ssl. It needed a missing krb5.h header file. The fix is to Add an environment variable, $CFLAGS, before making PHP. That is:
"-I/usr/kerberos/include/ -L/usr/kerberos/lib"
• gdbm
If you get this error when using "--with-gdbm":
configure: error: DBA: Could not find necessary header file(s).
then you are probably missing the gdbm-devel rpm package.
• Apache 1.x and Apache 2 Configuration Directives
The "AddModule," "AgentLog," "ReferrerLog," "RefererIgnore," "BindAddress," "ClearModuleList," "Port," "FancyIndexing," "ServerType," "AccessConfig," and "ResourceConfig" directives in Apache 1.x no longer exist in Apache 2. Also, "HAVE_*" httpd.conf definitions no longer exist. Comment them out of your httpd.conf for Apache 2. Most of these directives have been replaced by other directive(s).
• Error after glibc library upgrade
Apache should still work after upgrading glibc with security and bug fixes for the same release. If you use another architecture (say from or to i386/i686), you need to recompile. One symptom is an error like this in your Apache error_log:
[error] (38)Function not implemented:
• make clean
Kåre Olaussen adds this note: If you're compiling php4 for both Apache 1.3 and Apache 2, use a separate php source directory for each version of Apache. "The module wouldn't load into Apache 2, because I had forgotten to run make clean in between." [Ed. note: I recommend untaring the source from scratch in another directory, that way you are sure no old state information is left behind from previous makes. Do this for any configuration or version changes.]
• Enabling register_globals for Apache 2
From Duke: For those of you that are desperately trying to enable register_globals on a per-directory basis using Apache 2 with PHP 4 [or PHP 5] using .htaccess files, the syntax is different from Apache 1.x. In the directory you want to enable register_globals (or pretty much any other on/off setting), add an .htaccess file containing:
php_value register_globals 1
Note that php_flag does not work with Apache 2. Neither does on / off — you must use 0 (off) or 1 (on).
[Editor's note: To enable globally, add register_globals=off to your php.ini file.]
To enable register_globals on a per-directory basis, you can add to a
• Multi-Processing Module (MPM): don't use multi-threading MPMs
MPMs is how Apache 2 handles multiple web server requests. That is, with multiple processes or multiple threads or some combination. For now, on Linux (and even UNIX) you should only use the (default) prefork module with PHP. This is specified at compile time. Other MPM modules (any involving threads) break PHP. This is partly because PHP uses a great number of external libraries, and many or most of them are not thread-safe or thread-aware. In any case, Linux 2.4 doesn't handle threads efficiently yet—multiple processes are better (this changes with Linux 2.6, or RedHat 9 with 2.6 threads backported to Linux 2.4).
• API module structure `php5_module' in file . . . is garbled
If you get a message like this:
httpd: Syntax error on line 195 of /usr/local/apache/conf/httpd.conf: API module
structure `php5_module' in file /usr/local/apache/modules/libphp5.so is garbled
- perhaps this is not an Apache module DSO
it's because your version of PHP wasn't built for the version of Apache you are using (For PHP 4, substitute php4_module . . . libphp4.so). Recompile PHP in a "fresh" source directory (where you haven't built PHP before) and make sure --prefix, --with-config-file and --with-apxs2 points to the correct Apache directories you are using and the libphp4.so file has been copied to your /usr/local/apache/modules directory.
• PATH_INFO
Dan Fitzpatrick notes that he uses PATH_INFO for many PHP scripts like /index.php/go/do/something (where parameters are passed to PHP as "fake" subdirectories). He received a 404 Not Found errors with Apache 2 but not Apache 1.3.27. He had to add "AcceptPathInfo On" to file httpd.conf. For details, see http://httpd.apache.org/docs-2.2/mod/core.html#acceptpathinfo
• Using style tags in addition to style tags
If you want to also use the old-style (or MS ASP-like) tags then add this line to your php.ini file. This is the default starting with PHP 5:
short_open_tag = On
• GD library now built-in PHP
PHP 4.3.0 has gd built-in, just pass --with-gd to PHP configure.
• --with-apache
If you don't have Apache source at the default directory at /usr/local/apache, then use --with-apache=DIR with PHP configure, where DIR is the root source directory, This tells PHP where to look for the Apache source.
• Redhat 9
Apache 2 and PHP is built-in RedHat 9 (packages httpd 2.0.40, and php 4.2.2). Apache is mostly under /usr/lib/httpd and /usr/sbin/httpd. PHP is at /usr/lib/httpd/modules/libphp4.so For a complete file listing, type: rpm -ql httpd php
For RedHat 9, PHP 4.3.1 gives a compiler errors with RedHat 9 similar to: my_malloc.c:24: undefined reference to `errno'
The problem is with mysql and will have to wait for a fix from them. Until then, add this line:
#include
to the beginning of file ./ext/mysql/libmysql/mysql.h in your PHP source and remake PHP (from scratch).
• Notes about Gentoo Linux and Apache2 with PHP
LoadModule php5_module modules/libphp5.so
becomes:
LoadModule php5_module /usr/lib/apache2-extramodules/libphp5.so
To start automatically under Gentoo:
rc-update add apache2 default
(change php5 to php4 for PHP 4)
[Thanks to Phillip Temple]
php logo References
* Apache and PHP
* Original posting on USENET newsgroup comp.lang.php, 1b7cbdd3.0210181532.68d981cb%40posting.google.com
* "Compiling PHP 4 and Apache 2 from source on Linux OS", a document similar to this one, with more details and options, by Sukhwinder Singh.
* Install & Configure Apache, PHP, JSP, Ruby on Rails, MySQL, PHPMyAdmin & WordPress on Windows XP/2000
* OnLAMP.com: Good source of PHP and Apache tutorials (O'Reilly)
* Apache
* Apache httpd server website: Links to documentation and source
o How to upgrade from Apache 1.3 to 2.0
o How to upgrade from Apache 2.0 to 2.2
o Why should you upgrade (Apache 2.0 features)
* Migrating Apache HTTP Server 1.3 Configuration Files (Redhat)
* Sites Reject Apache2 commentary on Slashdot about slow adoption of Apache 2 due to a lack of 3rd-party modules (9/2002).
* ApacheWeek has the best updates on Apache development effort.
* Apache on Slashdot also has news on Apache and related efforts.
* PHP
* PHP website: Has links to documentation, source, mailing lists, and news groups
* PHP Weekly Summary, is a good source on the latest PHP developments.
* PHP FAQ: Old, but still useful. Note that the newsgroup has moved to USENET newsgroup comp.lang.php. (also available at Google Groups)
* PHP Security
o Secure Programming in PHP by Thomas Oertli (Zend.com, 1/2002)
o Security Notes by JeffCT (DevShed.com, 1/2001)
Retirado de: http://dan.drydog.com/apache2php.html
Todos os direitos ao autor.
Assinar:
Postagens (Atom)