Re: [asterisk-users] Mailing a fax with mutt does not succeed

2013-06-20 Thread Ishfaq Malik
Hi

Login as user asterisk and then try it

e.g. sudo su asterisk

and then try to execute the command.

Last time I had this issue I had to set the shell environment for
asterisk with the 

chsh

command

On Wed, 2013-06-19 at 13:03 -0500, Daniel - Asterisk wrote:
 Hello everyone,
  
 I'm trying to send a received fax with mutt, when I try it from the
 Linux shel it works, but when trying with Asterisk's System command it
 doesn't.
  
 Successful Linux command: 
 echo | mutt -s New fax earohua...@gmail.com
 -a /tmp/faxes/20130619.tif
  
 Unsuccessful Asterisk Command:
 same = n,System(mutt -s New fax elder.arohua...@gmail.com -a
 ${FAXDEST}/${tempfax}.tif)
  
 I'm using Asterisk 1.8.19.0 on Debian 6.0.6, Asterisk was installed by
 root.
  
 Any hint will be appreciated.
  
 Elder D. Arohuanca
 Lima - Peru
 
 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
Ishfaq Malik i...@pack-net.co.uk
Department: VOIP Support
Company: Packnet Limited
t: +44 (0)845 004 4994
f: +44 (0)161 660 9825
e: i...@pack-net.co.uk
w: http://www.pack-net.co.uk

Registered Address: PACKNET LIMITED, 2A ENTERPRISE HOUSE, LLOYD STREET
NORTH, MANCHESTER
SCIENCE PARK, MANCHESTER, M156SE
COMPANY REG NO. 04920552


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


[asterisk-users] Customer src in CDR with incoming sipp calls

2013-06-20 Thread Olivier
Hello,

I'm stressing an Asterisk 11 platform with incoming calls from sipp 3.1.

I've dedicated a context to sipp in my dialplan.
Everything works OK expect that calls from sipp comes in with a CallerID
set to sipp and this sipp value is stored in CDR.

1. I can change the value of the CallerID but how can I have the calls from
sipp traced in CDR with a customized src field value ?

[from-sipp]
exten = _X., 1, Whatever()
same = n, set(CallerID(num)=987654321))
same = n, Goto(maincontext, 123456789, 1)

[maincontext]
exten = _X., 1, Whatever()
same = n, Dial(SIP/foobar/${EXTEN})

I've read in CDR function online doc that src field is Readonly so I can't
simple use Set(CDR(src)=987654321).

Would a combination of NoCDR, ForkCDR or whatever help ?


2. Beside that, is there a what to set sipp CallerID from command line ?
Doc mentions -cdr_str option but I couldn't get anything with it.

Regards
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] no silk translation ?

2013-06-20 Thread Max N. Boyarov

On 11.06.2013, at 0:24, Sean Darcy wrote:

 Using 11.4.0, trying to use SILK on the cell phone to ulaw over gv, but no 
 success:


Silk is enabled only after asterisk restart.

for silk work need codecs.conf with silk configuration
res_format_attr_silk.so - loaded
codec_silk.so - loaded

please see

https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Codecs+and+Audio+Formats


 
 [Jun 10 16:18:22] WARNING[4090][C-000a]: channel.c:6164 
 ast_channel_make_compatible_helper: No path to translate from SIP/ng- 
 to Motif/+12025551...@voice.google.com-da3c
 [Jun 10 16:18:22] WARNING[4090][C-000a]: app_dial.c:3032 dial_exec_full: 
 Had to drop call because I couldn't make SIP/ng- compatible with 
 Motif/+12025551...@voice.google.com-da3c
  == Spawn extension (BaseDial, s, 4) exited non-zero on 'SIP/ng-'
 
 core show translations doesn't include any SILK.
 
 SILK is installed:
 
 core show codec 100018
 100018 SILK Custom Format 8khz
 100018 SILK Custom Format 12khz
 100018 SILK Custom Format 16khz
 100018 SILK Custom Format 24khz
 
 sean
 
 
 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-users


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


[asterisk-users] sip video endpoint with asterisk

2013-06-20 Thread Marek Cervenka

hi,

i need some small sip video endpoint for cloud videoconference (like 
bluejeans)


i have this idea

VIDEO OUT
TV or projector with HDMI

VIDEO IN
cameras with h264 hw enconding
- http://downloads.element14.com/raspberry-pi-camera/ 
http://downloads.element14.com/raspberry-pi-camera/

- logitech C920
- Creative Live! Cam Connect HD
- ???

ENDPOINT
- raspberry
- miniPC

linux + asterisk ? 
https://wiki.asterisk.org/wiki/display/AST/Video+Console 
https://wiki.asterisk.org/wiki/display/AST/Video+Console



AUDIO IN + AUDIO OUT
microphone with integrated speakers for the table
http://www.jabra.com/Products/PC_Headsets/Jabra_SPEAK__510_Series/Jabra_Speak_510 
http://www.jabra.com/Products/PC_Headsets/Jabra_SPEAK__510_Series/Jabra_Speak_510  
(bluetooth connection!!!)

http://www.phnxaudio.com/quattro3 http://www.phnxaudio.com/quattro3
http://www.yamaha.com/products/en/communication/usb_conference_speakerphones/ 
http://www.yamaha.com/products/en/communication/usb_conference_speakerphones/
http://www.dev-audio.com/products/microcone/ 
http://www.dev-audio.com/products/microcone/
http://www.clearone.com/products_chat160 
http://www.clearone.com/products_chat160



do you think it is possible? any recommendations?

--
---
Marek Cervenka
===

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread Dr. Michael J. Chudobiak

Hi all,

I have two phones that I've been comparing (different manufacturers).

To debug call quality issues on one of them, I've been using calls from 
the phone to our main DID, so 3 SIP sessions exist (phone  asterisk 
then asterisk  provider, and the providerasterisk for the DID).


The bad phone shows roughly twice the number of packets on the 
phoneasterisk session as on the other two sessions.


The good phone shows roughly equal packet counts on each of the 3 
sessions.


I've used asterisk server MTUs of 1440 and 1500, but it makes no difference.

Is this double-packet-count a clue, a problem, or a red herring?

The packet counts are shown using sip show channelstats.


- Mike

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread jg

Have you checked whether the same codecs, or codecs with the same bandwidth 
requirements, are used?

jg

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread Dr. Michael J. Chudobiak

On 06/20/2013 11:56 AM, jg wrote:

Have you checked whether the same codecs, or codecs with the same
bandwidth requirements, are used?


Yes, it is ulaw everywhere.

- Mike


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread Dr. Michael J. Chudobiak

On 06/20/2013 11:56 AM, jg wrote:

Have you checked whether the same codecs, or codecs with the same
bandwidth requirements, are used?


Here's an example of a simple outgoing call. Everything is ulaw. The 
192.x.x.x phone has roughly twice the packet count of the provider 
session. The lost packet count is nonsensical on one session. Sigh.


- Mike


steerpike*CLI sip show channelstats
Peer Call ID  Duration Recv: Pack  Lost   ( %) 
Jitter Send: Pack  Lost   ( %) Jitter
209.217.98.130   0c15efc03f2  00:01:03 003069  104829 (97.16%) 
0. 003040  00 ( 0.00%) 0.0002
192.168.0.36 qY0p292XeDl  00:01:03 006121  00 ( 0.00%) 
0. 006096  00 ( 0.00%) 0.0001

2 active SIP channels

steerpike*CLI sip show channels
Peer User/ANR Call ID  Format   Hold 
Last MessageExpiry Peer
209.217.98.130   6139419467   0c15efc03f243c7  (ulaw)   No 
 Tx: ACK6136866675
192.168.0.36 mjc_office   qY0p292XeDlPcLk  (ulaw)   No 
 Rx: ACKmjc_office


steerpike*CLI core show version
Asterisk 11.4.0 built by root @ steerpike.avtechpulse.com on a x86_64 
running Linux on 2013-06-19 12:10:47 UTC


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread Steve Edwards

On Thu, 20 Jun 2013, Dr. Michael J. Chudobiak wrote:

Here's an example of a simple outgoing call. Everything is ulaw. The 
192.x.x.x phone has roughly twice the packet count of the provider session.


Would running wireshark yield any clues?

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

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread jg

There's one thing on my list of things to check, that could be relevant for 
your problem, too.

Packet count is one thing, transferred data is another one. If one phone uses smaller UDP 
packages, then the packet count should increase in reciprocally. I have read some comments on 
the net that smaller packages are preferable because lost packages have less impact on the 
hearable audio.


Getting a complete pcap trace with subsequent wireshark  analysis is probably a tedious but 
appropriate way to analyse this. Currently I don't know what determines the size of the UDP 
packages and whether there are any general ways to control this size.


jg

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread Dr. Michael J. Chudobiak

Packet count is one thing, transferred data is another one. If one phone
uses smaller UDP packages, then the packet count should increase in
reciprocally. I have read some comments on the net that smaller packages
are preferable because lost packages have less impact on the hearable
audio.


Aha. I overlooked that some phones had ulaw:10 in sip.conf, instead of 
the standard ulaw:20. That explains the packet count difference. It 
seems my call quality issues are coming from something else.


- Mike


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] Asterisk / PHP-AGI / pthreads

2013-06-20 Thread Steve Edwards

On Thu, 20 Jun 2013, Satish Barot wrote:

Would you mind sharing a sample of your pthread-ed C AGI? This will help 
someone like me who has written AGI in Perl/PHP and now exploring C AGI.


The source code for this particular AGI is about 600 lines and uses my own 
AGI library (written before other C AGI libraries were available) so I 
don't think it has a whole lot of value to other programmers.


First a little background on why I used pthreads in this AGI...

The application was an adult chat platform. (Mostly) guys call in to chat 
to (mostly) women and pay $1 to $4 per minute. At the end of the call, the 
accumulated charges are billed to their their credit card.


Charges to credit cards usually take 2 transactions. The first transaction 
('OPEN') places a temporary 'hold' on the card for $XXX. At the end of the 
call, a second transaction ('SALE') finalizes the billing for the actual 
charges for the call.


(This '2 step' process is why you may have trouble charging an expensive 
dinner after checking into a hotel -- the hotel may have placed a 'hold' 
against your credit limit for the expected charge for your entire stay.)


As originally implemented, Asterisk would play a prompt asking the caller 
to enter their card details. After the caller entered a 'valid' card 
number (that passes Luhn mod 10) and expiration date (between the current 
month  current year and current year + 7). My AGI would then play a 
prompt ('Please wait while your card is being verified') and then transmit 
the card details to our card processor. Getting a response from the card 
processor takes a second or so. My AGI returned the card processor 
response code as the 'priority' so the dialplan could continue to the main 
menu or play a prompt indicating why the card details failed. After 3 
failures, a caller was played a prompt instructing them on alternative 
billing methods (high rate NPAs, check by phone, etc).


This client was extremely particular about the 'caller experience' and 
thought the 'second or so' of silence while the card was being verified 
was excessive and had to be eliminated.


Since the card processing time was not under my control, my solution was 
to change my AGI to create a second thread to play the 'please wait' 
prompt while the 'main line' code shipped off the card details to the 
processor.


When I got the processor's response (which was usually before the prompt 
finished playing), the 'main line' code would 'join' the prompt thread. If 
the prompt thread was finished playing the prompt, execution continued 
immediately. If the prompt thread was still playing the prompt, execution 
continued as soon as the prompt thread received the AGI response from 
Asterisk. None of this took any special programming or synchronizing from 
me. It all 'just worked' because of the way pthreads are implemented.


So, what did I learn that would be of value to you? Really understand the 
AGI protocol and you won't make a bunch of silly mistakes.


The AGI protocol is very simple:

1) Read the AGI environment from stdin before you do anything in your AGI 
that interacts with Asterisk.


2) Write your AGI request to stdout.

3) Read Asterisk's AGI response from stdin.

4) Rinse, lather, repeat (steps 2  3).

If you use an established AGI library (like you really, really should), 
this should be taken care of automagically, but understanding what's 
really going on will help when things don't work as expected.


The number 1 mistake new AGI programmers make is not reading the AGI 
environment. Sometimes they 'get away' with it, some times they don't.


The number 2 mistake is not reading the responses (step 3). Again, 
sometimes it works, sometimes it doesn't


The number 3 mistake new (and old salts like me still make on occasion) is 
doing any I/O on stdin or stdout. A lot of bad debugging centers around 
'throw in a printf somewhere to see what's going on' instead of using 
'real programmer' tools like gdb*.


If you're using an established AGI library, the crucial relationship 
between steps 2 and 3 will be take care of -- unless you're using multiple 
threads.


If thread 1 issues an AGI request (writing to stdout) and then thread 2 
issues an AGI request (also writing to stdout) before thread 1 reads it's 
response, you've broken the protocol and bad things will happen. Maybe not 
immediately, but certainly when you're demonstrating the system to your 
boss.


So my first suggestion (after using an established library and without 
knowing what your use case is) would be to 'designate' a single thread as 
'the Asterisk' thread and only interact (via stdin and stdout) with 
Asterisk in that thread. If that's not feasible, you're going to need some 
sort of 'semaphore' mechanism so you don't 'intermingle' your AGI requests 
and responses and thereby violate the AGI protocol.


Another couple of suggestions unrelated to threads, but are best (IMNSHO) 
practices for AGIs in general:


1) Use getopt_long(). 

Re: [asterisk-users] packet counts: twice as high on one leg?

2013-06-20 Thread jg


Aha. I overlooked that some phones had ulaw:10 in sip.conf, instead of the standard ulaw:20. 
That explains the packet count difference. It seems my call quality issues are coming from 
something else.




... and this explains how to set the packet size. Answer to get answers, or so.

jg

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


[asterisk-users] Questions about sRTP

2013-06-20 Thread Mike Diehl
Hi all,

I'm getting ready to setup SIP/TLS and SRTP.  But I have a few questions.
The first one is that I was reading an article at:

https://supportforums.cisco.com/docs/DOC-15381

That indicated that Asterisk doesn't support TLS as an OPTIONAL transport.
It's either all or nothing.  Specifically, this is what it said:

==
*Note: There is no optional SRTP mode in Asterisk, i.e. if encryption is
active on peer, it will not accept non-ciphered audio and viceversa. On the
IP phones, however, it is possible to have unsecure calls if the other peer
does not support SRTP, i.e. incoming calls may work, but not outgoing
calls. This is an Asterisk limitation (Snom supports also the
“optional”mode on SRTP sending two m=audio attributes, but Asterisk does
not know how to handle those descriptors).*
==

This is from a quite dated article (2011), so I'm hoping that I newer
versions of Asterisk will fall back on plaintext if TLS isn't available for
some reason.

Secondly, is there any way to detect if a call is secure from inside the
dialplan or AGI script?

I think that's all for now.

Thanks in advance,

Mike Diehl.
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] Exceptionally long queue length (help!)

2013-06-20 Thread Markus

Help!

I have providers configured that send me incoming calls via SIP. There's 
one that seems to make trouble. As soon as I get a few concurrent calls 
through this peer, Asterisk CPU load goes up to 250%, audio becomes 
laggy and I get hundreds of these per second in the logs:


[Jun 20 20:00:16] WARNING[1206][C-0001] channel.c: Exceptionally 
long queue length queuing to SIP/provider11-0001


And the following is what I always get every few seconds for every call 
via this peer. I think this only happens when I'm answering the call in 
Asterisk itself, i.e. right now I'm just streaming MusicOnHold to callers.


[Jun 20 20:00:22] NOTICE[1206][C-0001] channel.c: Dropping 
incompatible voice frame on SIP/provider11-0001 of format ulaw since 
our native format has changed to (alaw)


Peer config

[provider11]
host=121.16.15.230
type=peer
insecure=port,invite
context=provider-in
disallow=all
allow=alaw
canreinvite=no
dtmfmode=rfc2833

Before I had

allow=ulaw
allow=alaw

and removed the ulaw codec hoping that the above NOTICEs might 
disappear, but without success.


Asterisk 11.4.0-1 from the official repository under CentOS 6.4 64bit.

Help! :)


--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


[asterisk-users] Question about media before connect

2013-06-20 Thread CDR
I need to block any audio before there is a connect, in SIP. How do I tell
the DIAL application to behave like that?
Yours
Philip
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] I need a second opinion on a new phone system deployment

2013-06-20 Thread Michel Verbraak
Please also have a look at the gateway boxes from berofix
(http://wiki.beronet.com/index.php/Main_Page). I am not affiliated but
have used different products from them over last few yeas and all have
survived and are stable.

Documentation is open and free on their wiki. They provide updates. They
are not the cheapest but they have different vendors and they are sold
in online webshops. You can choose for the inside PCI(e) cards or their
external boxes. Last few years I went for the external boxes. They can
be fitted in a server rack or you mount them against the wall with screws.

Regards,

Michel.

On 16-06-13 16:55, Nunya Biznatch wrote:
 Thanks again to everyone that's responded thus far. I have once again
 bundled the questions and answers into a single email, and am
 responding below.


 On 6/14/2013 9:43 AM, Nunya Biznatch wrote:
 Howdy All,
They say opinions are like belly buttons, everybody has one.
 (that's the clean version of the saying). So I'm asking for yours.
 I hope you see it as a fun exercise.

 I'm designing a phone system from the ground up. Will be about
 1000-1300 seats mixed 80/20 VoIP/Analog. 58-acre campus environment
 with 23 buildings. Userbase is emergency services organization,
 24/7/365 operation. Down time is not an option, but blips are
 acceptable. Repair time is immediate. We need failover for the
 failover essentially. However, money is a major factor, so I have to
 do it all for nothing. So here's what I'm thinking. Please throw in
 your 2 cents.

 Network will be separate for phones. Fiber infrastructure available
 between buildings as well as copper. Internet access will be limited
 to a single administrative console on a temporary basis, and then
 only when remote 3rd party support is required. Access for 3rd party
 support will be supervised through remote access tools such as VNC,
 GoToMeeting, etc... etc... System will have zero access to local data
 network. This means all ancillary support servers such as DHCP, DNS,
 NTP, FTP, etc...etc... will be specific to the phone system. Yes, I
 know some responders at this time will become fixated on me gaining
 this connectivity. It ain't gonna happen. It's not an option. Period,
 end of story. These are the parameters I must work within. Trying to
 fix that will be a non-starter.

 The phone system will upgrade an existing TDM-based system. Mitel
 SX2000 with NuPoint Voicemail. This will not be a dump-trunk
 replacement. I expect at least a one to two-year transition, meaning
 we will have time to find problems,  work bugs, and learn over time,
 with minimized impacts. It also means we'll be supporting two systems
 for some time.

 PBX is 97% serving your basic phone on the desk. Nothing special.
 Customers expect the usual list of features. There will be a goodly
 number of hints required for BLF on maybe 150 phones. There is one
 office of about 30 phones in a call-center environment that will need
 that service. They would be considered low volume (but don't tell
 them that).

 My Skills... I am not a Linux kung fu master, but I have built and
 managed my share of Linux servers on mutiple Linux flavors. I am a
 DCAA, having been through formal training, and have been playing with
 Asterisk for years, but always in fits and spurts and never in a live
 environment so I am by no means a kung fu master there either. I have
 started dabbling with virtualizations via XEN, but I am not
 comfortable enough with it to go live this first round. I can see
 myself implementing it in about three years once we're totally
 comfortable with what we have, so I can then have time to get that
 skill sorted. I was a network engineer for the US no3. telecom for a
 number of years, 10-years in comm-electronics in the military before
 that. Telecom my entire career. I've got the kung-fu to handle the
 network side of the house, and having administrated multiple PBXs for
 decade-plus, I've got the concepts down.

 No plans to build databases for things like directories, etc... I'm
 not greatly confident in those skills, and to date, haven't found
 anything that really stands out that would make me require that. You
 may think otherwise, so please chime in. I say that, but at the same
 time I recognize I may require a GUI interface once fully deployed to
 allow lower-skilled people to follow the motions to complete simple
 moves, adds, and changes. I'm fighting the uphill battle that is the
 GUI is new, CLI is old mentality.

 System will use G.722 for VoIP Phones.

 So there's the groundwork. Here's the hardware plan.

 Plan is to build my own servers following industry standards (ATX)
 and using industry standard equipment. Why? Spares? Whether redundant
 or not, I will still have spares for the most common elements on the
 shelf so equipment can be returned to service as quickly as possible.
 This will also allow me to be comfortable with more basic server
 configurations and help keep cost down. For example, Servers with
 single 

Re: [asterisk-users] Questions about sRTP

2013-06-20 Thread Joshua Colp

Mike Diehl wrote:

Hi all,

I'm getting ready to setup SIP/TLS and SRTP.  But I have a few
questions.  The first one is that I was reading an article at:

https://supportforums.cisco.com/docs/DOC-15381

That indicated that Asterisk doesn't support TLS as an OPTIONAL
transport.  It's either all or nothing.  Specifically, this is what it said:


Your statement is incorrect. Asterisk supports TLS as an optional 
signaling transport (although if you do SDES SRTP without it then 
someone can snoop on your keys and ultimately decrypt your media).


What it does not support is optional *SRTP*. If a device requests SRTP 
and it's not possible, the call will fail.


--
Joshua Colp
Digium, Inc. | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at:  www.digium.com   www.asterisk.org

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] Mailing a fax with mutt does not succeed

2013-06-20 Thread Daniel - Asterisk
Hello jg:

When mutt is called from Asterisk's dialplan there's no output at mail.log

When I use:
echo | /usr/bin/mutt -s New fax earohua...@gmail.com -a
${FAXDEST}/${tempfax}  /tmp/ocurrencias.txt 21
replacing FAXDEST and TEMPFAX with proper values, the output is as follows:

Jun 20 16:16:16 SERVER-NAME sendmail[21276]: My unqualified host name
(SERVER-NAME) unknown; sleeping for retry
Jun 20 16:17:16 SERVER-NAME sendmail[21276]: unable to qualify my own
domain name (SERVER-NAME) -- using short name
Jun 20 16:17:16 SERVER-NAME sendmail[21276]: r5KLHGgk021276: from=root,
size=116501, class=0, nrcpts=1, msgid=20130620211615.GA21267@SERVER-NAME,
relay=root@localhost
Jun 20 16:17:17 SERVER-NAME sm-mta[21285]: r5KLHGNY021285:
from=root@SERVER-NAME, size=116646, class=0, nrcpts=1,
msgid=20130620211615.GA21267@SERVER-NAME, proto=ESMTP, daemon=MTA-v4,
relay=localhost [127.0.0.1]
Jun 20 16:17:17 SERVER-NAME sendmail[21276]: r5KLHGgk021276: to=
earohua...@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01,
mailer=relay, pri=146501, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0,
stat=Sent (r5KLHGNY021285 Message accepted for delivery)
Jun 20 16:17:19 SERVER-NAME sm-mta[21287]: STARTTLS=client, relay=
gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL,
cipher=RC4-SHA, bits=128/128
Jun 20 16:17:20 SERVER-NAME sm-mta[21287]: r5KLHGNY021285: to=
earohua...@gmail.com, ctladdr=root@SERVER-NAME (0/0), delay=00:00:03,
xdelay=00:00:03, mailer=esmtp, pri=236646, relay=gmail-smtp-in.l.google.com.
[173.194.76.26], dsn=2.0.0, stat=Sent (OK 1371763040 f6si834075qaf.111 -
gsmtp)
ocurrencias.txt is empty also.

Elder Arohuanca



On Wed, Jun 19, 2013 at 3:12 PM, jg webaccou...@jgoettgens.de wrote:

  More things to try:

 (1) Is there any entry in /var/log/maillog (or equivalent log file)? If
 so, mutt basically works and the messages should give some clues.
 (2) What happens if you call mutt without any attachments?

 I am using mutt in exactly the same way and it works.

 jg

 Am 19.06.2013 21:50, schrieb Daniel - Asterisk:

  Hi Andre:

 I added echo to provide STDIN, I'm sure on variable contents, please see
 bellow


 Hello Steve,

 1. I've just addd echo at my sentence, please see output bellow.
 2. Asterisk is executing as root, I think Asterisk has access to read TIF
 files since I've used ls, chmod, cp  mv from Asterisk's CLI with '!'
 character.
 3. I don't get you, please give some advice to try using Verbose instead
 System
 4. I don't know how to get this, but I'm using /usr/bin/mutt as you can
 see bellow.
 5. I have redirected output of System this way : System(echo |
 /usr/bin/mutt -s New fax earohua...@gmail.com -a ${FAXDEST}/${tempfax}
  /tmp/ocurrencies.txt 21), ocurrencies.txt is empty.


 DIALPLAN:
 [ Context 'default' created by 'pbx_config' ]
   '*95' =  1. NoOp(trying to send a fax to an email)
 2. Set(FAXDEST=/tmp/faxes)
 3. Set(tempfax=${SHELL(ls /tmp/faxes/*.tif):11})
 4. NoOp(file name is: ${tempfax})
 5. Goto(incoming-fax,fax,7)

 [ Context 'incoming-fax' created by 'pbx_config' ]
   'fax' =  1. Verbose(3,Incoming fax)
   ...
 5. ReceiveFax(${FAXDEST}/${tempfax})
 6. Verbose(3,- Fax receipt completed with status:
 ${FAXSTATUS})
 7. System(echo | /usr/bin/mutt -s New fax
 earohua...@gmail.com -a ${FAXDEST}/${tempfax})
 8. NoOp(System command status is: ${SYSTEMSTATUS})
 9. Hangup()

 ASTERISK CLI OUTPUT:
 -- Goto (default,*95,1)
 -- Executing [*95@default:1] NoOp(SIP/40106-1ea1, trying to
 send a fax to an email) in new stack
 -- Executing [*95@default:2] Set(SIP/40106-1ea1,
 FAXDEST=/tmp/faxes) in new stack
 -- Executing [*95@default:3] Set(SIP/40106-1ea1,
 tempfax=20130619.tif) in new stack
 -- Executing [*95@default:4] NoOp(SIP/40106-1ea1, file name
 is: 20130619.tif) in new stack
 -- Executing [*95@default:5] Goto(SIP/40106-1ea1,
 incoming-fax,fax,7) in new stack
 -- Goto (incoming-fax,fax,7)
 -- Executing [fax@incoming-fax:7] System(SIP/40106-1ea1, echo
 | /usr/bin/mutt -s New fax earohua...@gmail.com -a
 /tmp/faxes/20130619.tif) in new stack
 -- Executing [fax@incoming-fax:8] NoOp(SIP/40106-1ea1, System
 command status is: APPERROR) in new stack
 -- Executing [fax@incoming-fax:9] Hangup(SIP/40106-1ea1, ) in
 new stack


 Elder D. Arohuanca
 Lima - Peru


 On Wed, Jun 19, 2013 at 1:38 PM, Andre Courchesne voipfor...@gmail.comwrote:

 Why echo | ?

  Alsy are you sire of the content of ${FAXDEST} and ${tempfax}.

  Add some NoOp before.


  On 2013-06-19, at 2:29 PM, Daniel - Asterisk earohua...@gmail.com
 wrote:

  Hi Andre,

 I've tried with:
 System(echo | /usr/bin/mutt -s New fax earohua...@gmail.com -a
 ${FAXDEST}/${tempfax})

 with no success, value of SYSTEMSTATUS variable is 

Re: [asterisk-users] Mailing a fax with mutt does not succeed

2013-06-20 Thread Andre Courchesne - Gmail
Have you tried calling a bash script that in turns calls mutt. That way you 
could debug much easier, adding echo to a log file.

Sent from my iPhone

On 2013-06-20, at 5:27 PM, Daniel - Asterisk earohua...@gmail.com wrote:

 Hello jg:
  
 When mutt is called from Asterisk's dialplan there's no output at mail.log
  
 When I use:
 echo | /usr/bin/mutt -s New fax earohua...@gmail.com -a 
 ${FAXDEST}/${tempfax}  /tmp/ocurrencias.txt 21
 replacing FAXDEST and TEMPFAX with proper values, the output is as follows:
  
 Jun 20 16:16:16 SERVER-NAME sendmail[21276]: My unqualified host name 
 (SERVER-NAME) unknown; sleeping for retry
 Jun 20 16:17:16 SERVER-NAME sendmail[21276]: unable to qualify my own domain 
 name (SERVER-NAME) -- using short name
 Jun 20 16:17:16 SERVER-NAME sendmail[21276]: r5KLHGgk021276: from=root, 
 size=116501, class=0, nrcpts=1, msgid=20130620211615.GA21267@SERVER-NAME, 
 relay=root@localhost
 Jun 20 16:17:17 SERVER-NAME sm-mta[21285]: r5KLHGNY021285: 
 from=root@SERVER-NAME, size=116646, class=0, nrcpts=1, 
 msgid=20130620211615.GA21267@SERVER-NAME, proto=ESMTP, daemon=MTA-v4, 
 relay=localhost [127.0.0.1]
 Jun 20 16:17:17 SERVER-NAME sendmail[21276]: r5KLHGgk021276: 
 to=earohua...@gmail.com, ctladdr=root (0/0), delay=00:00:01, xdelay=00:00:01, 
 mailer=relay, pri=146501, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent 
 (r5KLHGNY021285 Message accepted for delivery)
 Jun 20 16:17:19 SERVER-NAME sm-mta[21287]: STARTTLS=client, 
 relay=gmail-smtp-in.l.google.com., version=TLSv1/SSLv3, verify=FAIL, 
 cipher=RC4-SHA, bits=128/128
 Jun 20 16:17:20 SERVER-NAME sm-mta[21287]: r5KLHGNY021285: 
 to=earohua...@gmail.com, ctladdr=root@SERVER-NAME (0/0), delay=00:00:03, 
 xdelay=00:00:03, mailer=esmtp, pri=236646, relay=gmail-smtp-in.l.google.com. 
 [173.194.76.26], dsn=2.0.0, stat=Sent (OK 1371763040 f6si834075qaf.111 - 
 gsmtp)
 ocurrencias.txt is empty also.
  
 Elder Arohuanca
  
 
 
 On Wed, Jun 19, 2013 at 3:12 PM, jg webaccou...@jgoettgens.de wrote:
 More things to try:
 
 (1) Is there any entry in /var/log/maillog (or equivalent log file)? If so, 
 mutt basically works and the messages should give some clues.
 (2) What happens if you call mutt without any attachments?
 
 I am using mutt in exactly the same way and it works.
 
 jg
 
 Am 19.06.2013 21:50, schrieb Daniel - Asterisk:
 Hi Andre:
  
 I added echo to provide STDIN, I'm sure on variable contents, please see 
 bellow
  
  
 Hello Steve,
  
 1. I've just addd echo at my sentence, please see output bellow.
 2. Asterisk is executing as root, I think Asterisk has access to read TIF 
 files since I've used ls, chmod, cp  mv from Asterisk's CLI with '!' 
 character.
 3. I don't get you, please give some advice to try using Verbose instead 
 System
 4. I don't know how to get this, but I'm using /usr/bin/mutt as you can see 
 bellow.
 5. I have redirected output of System this way : System(echo | 
 /usr/bin/mutt -s New fax earohua...@gmail.com -a ${FAXDEST}/${tempfax}  
 /tmp/ocurrencies.txt 21), ocurrencies.txt is empty.
  
  
 DIALPLAN:
 [ Context 'default' created by 'pbx_config' ]
   '*95' =  1. NoOp(trying to send a fax to an email) 
 2. Set(FAXDEST=/tmp/faxes)
 3. Set(tempfax=${SHELL(ls /tmp/faxes/*.tif):11}) 
 4. NoOp(file name is: ${tempfax}) 
 5. Goto(incoming-fax,fax,7)  
  
 [ Context 'incoming-fax' created by 'pbx_config' ]
   'fax' =  1. Verbose(3,Incoming fax)
   ...
 5. ReceiveFax(${FAXDEST}/${tempfax})  
 6. Verbose(3,- Fax receipt completed with status: 
 ${FAXSTATUS}) 
 7. System(echo | /usr/bin/mutt -s New fax 
 earohua...@gmail.com -a ${FAXDEST}/${tempfax}) 
 8. NoOp(System command status is: ${SYSTEMSTATUS}) 
 9. Hangup()
  
 ASTERISK CLI OUTPUT:
 -- Goto (default,*95,1)
 -- Executing [*95@default:1] NoOp(SIP/40106-1ea1, trying to send 
 a fax to an email) in new stack
 -- Executing [*95@default:2] Set(SIP/40106-1ea1, 
 FAXDEST=/tmp/faxes) in new stack
 -- Executing [*95@default:3] Set(SIP/40106-1ea1, 
 tempfax=20130619.tif) in new stack
 -- Executing [*95@default:4] NoOp(SIP/40106-1ea1, file name is: 
 20130619.tif) in new stack
 -- Executing [*95@default:5] Goto(SIP/40106-1ea1, 
 incoming-fax,fax,7) in new stack
 -- Goto (incoming-fax,fax,7)
 -- Executing [fax@incoming-fax:7] System(SIP/40106-1ea1, echo | 
 /usr/bin/mutt -s New fax earohua...@gmail.com   -a 
 /tmp/faxes/20130619.tif) in new stack
 -- Executing [fax@incoming-fax:8] NoOp(SIP/40106-1ea1, System 
 command status is: APPERROR) in new stack
 -- Executing [fax@incoming-fax:9] Hangup(SIP/40106-1ea1, ) in 
 new stack
  
  
 Elder D. Arohuanca
 Lima - Peru
 
 
 On Wed, Jun 19, 

Re: [asterisk-users] Mailing a fax with mutt does not succeed

2013-06-20 Thread jg

Hi Elder!

I am currently busy with a problem of one of my customers. I am pretty sure that your setup 
requires only minor changes to make things work. I have several setups that use mutt exactly in 
the same way as you are trying to do (except that I am using postfix instead of sendmail, but 
this shouldn't matter). I'll have a look at your log entries tomorrow.


jg

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] Questions about sRTP

2013-06-20 Thread Mike Diehl
On Thu, Jun 20, 2013 at 2:05 PM, Joshua Colp jc...@digium.com wrote:

 Mike Diehl wrote:

 Hi all,

 I'm getting ready to setup SIP/TLS and SRTP.  But I have a few
 questions.  The first one is that I was reading an article at:

 https://supportforums.cisco.com/docs/DOC-15381

 That indicated that Asterisk doesn't support TLS as an OPTIONAL
 transport.  It's either all or nothing.  Specifically, this is what it
 said:


 Your statement is incorrect. Asterisk supports TLS as an optional
 signaling transport (although if you do SDES SRTP without it then someone
 can snoop on your keys and ultimately decrypt your media).

 What it does not support is optional *SRTP*. If a device requests SRTP and
 it's not possible, the call will fail.


So then, is it safe to say that Asterisk will ALLOW a secure phone call,
but the client hast to REQUEST it?

I understand that requesting SRTP without SIP/TLS is evil; I just
misunderstood what I was reading.

I'm also thinking that the AGI script I use to route calls can check if
either leg of a call comes from or goes to port 5061 and play a sound file
to indicate that the cal is 'secure.'  Does this seem reasonable?

Thanks,

Mike.
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

[asterisk-users] asterisk -rx core show channels + time

2013-06-20 Thread Joseph

When I type: asterisk -rx core show channels
I usually get 

Channel  Location State   Application(Data) 
SIP/pstn--03 7807574622@internal: Up  Dial(SIP/77807574622@pstn-9998

SIP/pstn-9998-03 (None)   Up  AppDial((Outgoing Line))

Is there a way to pull information about time the channel started?

--
Joseph

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
  http://www.asterisk.org/hello

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


Re: [asterisk-users] asterisk -rx core show channels + time

2013-06-20 Thread Carlos Rojas
Hi

You can do,

core show channels verbose


Kind Regards


On Thu, Jun 20, 2013 at 6:45 PM, Joseph syscon...@gmail.com wrote:

 When I type: asterisk -rx core show channels
 I usually get
 Channel  Location State   Application(Data)
   SIP/pstn--03 7807574622@internal: Up
  Dial(SIP/77807574622@pstn-9998
 SIP/pstn-9998-03 (None)   Up  AppDial((Outgoing Line))

 Is there a way to pull information about time the channel started?

 --
 Joseph

 --
 __**__**_
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] SIP Simple support on Asterisk 11

2013-06-20 Thread Matthew J. Roth
Eloi,

My responses are inline.

 Thanks a lot for this detailed answer :

You're welcome.  Thank you for responding.  A lot of people forget to do so and
future list readers are left wondering whether or not the proposed solution
worked.

 - I managed to have it working disabling auth message request :
   auth_message_requests = no in sip.conf
 - pedantic=no does not resolve the issue
 - reenabling  auth_message_requests = yes and removing pedantic option, your
   patch in chan_sip resolves the issues !

 As it looks like pidgin has an issue, I guess that we can use it as a
 workaround.

I'm glad my patch worked but keep in mind that it really is a workaround,
because it will cause actual retransmits of MESSAGE requests to be treated as
new requests.  This may not cause you any issues, but the root problem should
still be addressed by submitting a report to the Pidgin bug tracker [1].  It's
a straightforward problem so if you provide a link to your original post [2] the
developers should be able to resolve it quickly.

 I would like know to enable presence notification between each users. To
 fulfill it, I am using
 http://asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/DeviceStates_id265377.html

 Am I doing it in a good way ?

Yes, but there is a 4th edition of Asterisk: The Definitive Guide available
in the Open Feedback Publishing System [3] that is focused on documenting
Asterisk 11.

[1] https://developer.pidgin.im/wiki/TipsForBugReports
[2] http://lists.digium.com/pipermail/asterisk-users/2013-June/279569.html
[3] http://ofps.oreilly.com/titles/9781449332426/asterisk-DeviceStates.html

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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


[asterisk-users] Asterisk Queue Frame

2013-06-20 Thread Gopalakrishnan N
What happens when we increase the queue frame size in channels.c

if ((queued_frames + new_frames  128 || queued_voice_frames +
new_voice_frames  96)) {

Be default it is 128 and 96 if i increase it to 256 and 192 what will
happen? will it impact to default behavior?


Regards,
Gopal.
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] Asterisk Queue Frame

2013-06-20 Thread Richard Mudgett
On Thu, Jun 20, 2013 at 6:55 PM, Gopalakrishnan N 
gopalakrishnan...@gmail.com wrote:

 What happens when we increase the queue frame size in channels.c

 if ((queued_frames + new_frames  128 || queued_voice_frames +
 new_voice_frames  96)) {

 Be default it is 128 and 96 if i increase it to 256 and 192 what will
 happen? will it impact to default behavior?


It looks like you are getting the Exceptionally long queue length warning
message.  The
change you mention will just increase the allowed size of the queue.  Doing
that won't really
help much as it will just delay getting the message.  That warning message
means Asterisk
is falling behind in processing frames on the channel.

Richard
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] Asterisk Queue Frame

2013-06-20 Thread Gopalakrishnan N
actually when i get the message my call volume is around 180 to 200
calls will that matter... and some calls being transferred to other
location and some are making outbound calls, some are inbound...

Is there any way for optimization?


On Fri, Jun 21, 2013 at 5:57 AM, Richard Mudgett rmudg...@digium.comwrote:

 On Thu, Jun 20, 2013 at 6:55 PM, Gopalakrishnan N 
 gopalakrishnan...@gmail.com wrote:

 What happens when we increase the queue frame size in channels.c

 if ((queued_frames + new_frames  128 || queued_voice_frames +
 new_voice_frames  96)) {

 Be default it is 128 and 96 if i increase it to 256 and 192 what will
 happen? will it impact to default behavior?


 It looks like you are getting the Exceptionally long queue length
 warning message.  The
 change you mention will just increase the allowed size of the queue.
 Doing that won't really
 help much as it will just delay getting the message.  That warning message
 means Asterisk
 is falling behind in processing frames on the channel.

 Richard

 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello

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

--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] Questions about sRTP

2013-06-20 Thread Matthew Jordan
On Thu, Jun 20, 2013 at 5:10 PM, Mike Diehl mdiehlena...@gmail.com wrote:



 On Thu, Jun 20, 2013 at 2:05 PM, Joshua Colp jc...@digium.com wrote:

 Mike Diehl wrote:

 Hi all,

 I'm getting ready to setup SIP/TLS and SRTP.  But I have a few
 questions.  The first one is that I was reading an article at:

 https://supportforums.cisco.com/docs/DOC-15381

 That indicated that Asterisk doesn't support TLS as an OPTIONAL
 transport.  It's either all or nothing.  Specifically, this is what it
 said:


 Your statement is incorrect. Asterisk supports TLS as an optional
 signaling transport (although if you do SDES SRTP without it then someone
 can snoop on your keys and ultimately decrypt your media).

 What it does not support is optional *SRTP*. If a device requests SRTP
 and it's not possible, the call will fail.


 So then, is it safe to say that Asterisk will ALLOW a secure phone call,
 but the client hast to REQUEST it?

 I understand that requesting SRTP without SIP/TLS is evil; I just
 misunderstood what I was reading.

 I'm also thinking that the AGI script I use to route calls can check if
 either leg of a call comes from or goes to port 5061 and play a sound file
 to indicate that the cal is 'secure.'  Does this seem reasonable?


You can query a channel using the CHANNEL function (
https://wiki.asterisk.org/wiki/display/AST/Function_CHANNEL) to see if the
channel currently supports secure communication, and you can request that
the outbound channel be made secure using the same function.

An example of doing this is on the wiki:

https://wiki.asterisk.org/wiki/display/AST/Secure+Calling+Specifics

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com  http://asterisk.org
--
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
   http://www.asterisk.org/hello

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

Re: [asterisk-users] Asterisk / PHP-AGI / pthreads

2013-06-20 Thread Satish Barot
On Thu, Jun 20, 2013 at 10:54 PM, Steve Edwards
asterisk@sedwards.comwrote:

 On Thu, 20 Jun 2013, Satish Barot wrote:

  Would you mind sharing a sample of your pthread-ed C AGI? This will help
 someone like me who has written AGI in Perl/PHP and now exploring C AGI.


 The source code for this particular AGI is about 600 lines and uses my own
 AGI library (written before other C AGI libraries were available) so I
 don't think it has a whole lot of value to other programmers.

 First a little background on why I used pthreads in this AGI...

 The application was an adult chat platform. (Mostly) guys call in to chat
 to (mostly) women and pay $1 to $4 per minute. At the end of the call, the
 accumulated charges are billed to their their credit card.

 Charges to credit cards usually take 2 transactions. The first transaction
 ('OPEN') places a temporary 'hold' on the card for $XXX. At the end of the
 call, a second transaction ('SALE') finalizes the billing for the actual
 charges for the call.

 (This '2 step' process is why you may have trouble charging an expensive
 dinner after checking into a hotel -- the hotel may have placed a 'hold'
 against your credit limit for the expected charge for your entire stay.)

 As originally implemented, Asterisk would play a prompt asking the caller
 to enter their card details. After the caller entered a 'valid' card number
 (that passes Luhn mod 10) and expiration date (between the current month 
 current year and current year + 7). My AGI would then play a prompt
 ('Please wait while your card is being verified') and then transmit the
 card details to our card processor. Getting a response from the card
 processor takes a second or so. My AGI returned the card processor response
 code as the 'priority' so the dialplan could continue to the main menu or
 play a prompt indicating why the card details failed. After 3 failures, a
 caller was played a prompt instructing them on alternative billing methods
 (high rate NPAs, check by phone, etc).

 This client was extremely particular about the 'caller experience' and
 thought the 'second or so' of silence while the card was being verified was
 excessive and had to be eliminated.

 Since the card processing time was not under my control, my solution was
 to change my AGI to create a second thread to play the 'please wait' prompt
 while the 'main line' code shipped off the card details to the processor.

 When I got the processor's response (which was usually before the prompt
 finished playing), the 'main line' code would 'join' the prompt thread. If
 the prompt thread was finished playing the prompt, execution continued
 immediately. If the prompt thread was still playing the prompt, execution
 continued as soon as the prompt thread received the AGI response from
 Asterisk. None of this took any special programming or synchronizing from
 me. It all 'just worked' because of the way pthreads are implemented.

 So, what did I learn that would be of value to you? Really understand the
 AGI protocol and you won't make a bunch of silly mistakes.

 The AGI protocol is very simple:

 1) Read the AGI environment from stdin before you do anything in your AGI
 that interacts with Asterisk.

 2) Write your AGI request to stdout.

 3) Read Asterisk's AGI response from stdin.

 4) Rinse, lather, repeat (steps 2  3).

 If you use an established AGI library (like you really, really should),
 this should be taken care of automagically, but understanding what's really
 going on will help when things don't work as expected.

 The number 1 mistake new AGI programmers make is not reading the AGI
 environment. Sometimes they 'get away' with it, some times they don't.

 The number 2 mistake is not reading the responses (step 3). Again,
 sometimes it works, sometimes it doesn't

 The number 3 mistake new (and old salts like me still make on occasion) is
 doing any I/O on stdin or stdout. A lot of bad debugging centers around
 'throw in a printf somewhere to see what's going on' instead of using 'real
 programmer' tools like gdb*.

 If you're using an established AGI library, the crucial relationship
 between steps 2 and 3 will be take care of -- unless you're using multiple
 threads.

 If thread 1 issues an AGI request (writing to stdout) and then thread 2
 issues an AGI request (also writing to stdout) before thread 1 reads it's
 response, you've broken the protocol and bad things will happen. Maybe not
 immediately, but certainly when you're demonstrating the system to your
 boss.

 So my first suggestion (after using an established library and without
 knowing what your use case is) would be to 'designate' a single thread as
 'the Asterisk' thread and only interact (via stdin and stdout) with
 Asterisk in that thread. If that's not feasible, you're going to need some
 sort of 'semaphore' mechanism so you don't 'intermingle' your AGI requests
 and responses and thereby violate the AGI protocol.

 Another couple of suggestions unrelated