Re: [asterisk-users] asterisk 11.6 nat problem

2013-10-11 Thread Matthew J. Roth
Jeremy Kister wrote:
 
 using asterisk 11.6.0-rc1 i just converted my nat=yes to 
 nat=auto_force_rport,auto_comedia
 
 I have my asterisk box on the same subnet as a cisco 1760 (vgw1).
 
 a few times per day, Asterisk thinks vgw1 is dead (by qualify/options). 
   A 'sip reload' always fixes the problem.
 
 i left 'sip set debug peer vgw1' on the console.  but i dont see what's 
 causing the issue..
 
 http://kister.net/tmp/ast-sip.conf
 http://kister.net/tmp/ast-console.txt
 
 can anyone spot the issue?


Jeremy,

It looks like at some point Asterisk decides that vgw1's SIP port is
no longer 5060.  This may have to do with the NAT settings for that
device:

 Before 'sip reload'  |  After 'sip reload'
--|-
* Name   : vgw1   | * Name   : vgw1
...   | ...
Force rport  : Auto (Yes) | Force rport  : Auto (No)
Symmetric RTP: Auto (Yes) | Symmetric RTP: Auto (No)
...   | ...
Addr-IP : 10.9.1.9:59934 | Addr-IP : 10.9.1.9:5060
...   | ...
Status   : UNREACHABLE| Status   : OK (19 ms)

Since the device is on the same subnet as your Asterisk server, you
could try setting 'nat=no' for the vgw1 peer.  That may not be a good
long-term solution because of its security implications¹, but it
could help determine if the NAT settings are the cause of the problem
and serve as a stopgap until you figure out why the port is changing.

Alternatively, you could try setting 'port=5060' for the vgw1 peer,
but that's the default so it may still get changed.

¹ From sip.conf.sample:

  IT IS IMPORTANT TO NOTE that if the nat setting in the general
  section differs from the nat setting in a peer definition, then the
  peer username will be discoverable by outside parties as Asterisk
  will respond to different ports for defined and undefined peers. For
  this reason it is recommended to ONLY DEFINE NAT SETTINGS IN THE
  GENERAL SECTION. Specifically, if nat=force_rport in one section and
  nat=no in the other, then valid peers with settings differing from
  those in the general section will be discoverable.

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

Re: [asterisk-users] The call is established but without exchanged voice packets

2013-09-20 Thread Matthew J. Roth
Asmaa, 

You're getting ahead of yourself.  How do you expect audio to work if
your firewall/NAT settings aren't even configured correctly to
establish SIP sessions?

Go back and read the message that I sent yesterday.  Fix the SIP 
three-way handshake problem.  That is step 1 and you'll know you have
it right when you stop seeing 'Retransmission timeout reached on
transmission' errors.

You still won't have audio but that's step 2.  It requires properly
configuring Asterisk's NAT settings and the firewall(s) between the
phones and the server to allow RTP traffic to flow, but don't worry
about it until step 1 is complete.

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


Re: [asterisk-users] The call is established but without exchanged voice packets

2013-09-20 Thread Matthew J. Roth
Asmaa Ahmed wrote: 
 
 Indeed I missed your previous message! 
 After changing the externip, it worked successfully... The sip
 session is established with the complete three-way handshake, and
 the voice packet is exchanged with no problem! 
 
 Many thanks.


Asmaa,

That's great news!!  I guess the firewall settings were already
correct and it was just a matter of configuring Asterisk properly.

In my experience, the first call is always the hardest one to get
working.  Now that you've done that you can really start seeing what
Asterisk can do.  Have fun, but remember to take it step by step and
don't hesitate to ask the list if you run into any problems.

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


Re: [asterisk-users] The call is established but without exchanged voice packets

2013-09-19 Thread Matthew J. Roth
Asmaa Ahmed wrote:
 
 
 I am trying to make my first call on Asterisk to succeed. I have
 Asterisk 1.8.10.1 running on Ubuntu machine. 
 
 The configuration is quite simple just for my first test, Trying to
 have a call between two X-lite sipphone. The subscribers succeeded
 to register and the call is established, but still no voice can be
 heard, a nd lead the call to be disconnected after! By checking the
 logs, I can see this chan_sip.c:3641 retrans_pkt: Retransmission
 timeout reached on transmission
 Mjk3MGU1NjgxZWQwM2E3MjhjZmFiNzhjOGVjZjg5ZTc for seqno 2
 (Critical Response) 

The SIP trace you provided breaks down as follows:

  X-Lite   Asterisk
  ---  ---
  INVITE(No Auth) --- 
  --- 401 Unauthorized
  ACK ---
  INVITE(Auth)---
  --- 100 Trying
  --- 200 OK
  --- 200 OK (Retransmitted 10 Times)
  --- BYE
  OK  ---

This shows that the three-way handshake (INVITE/200 OK/ACK) used to
establish SIP sessions is not completed because Asterisk never
receives an ACK from X-Lite.  After retransmitting the 200 OK 10 times
Asterisk gives up and disconnects the call.

 Here's my simple sip configuration 
 [general] 
 context=internal 
 allowguest=no 
 allowoverlap=no 
 bindport=5060 
 bindaddr=0.0.0.0 
 srvlookup=no 
 disallow=all 
 allow=ulaw 
 alwaysauthreject=yes 
 canreinvite=no 
 nat=yes 
 session-timers=refuse 
 externip=IP 

From the SIP trace, I believe 'externip=41.46.164.96' is set.  If that
is the case, try changing it to 'externip=54.241.129.14'.  You should
also set localnet as follows:

  ; RFC 1918 addresses
  localnet=192.168.0.0/255.255.0.0
  localnet=10.0.0.0/255.0.0.0
  localnet=172.16.0.0/12

If that doesn't work you can also try setting 'nat=force_rport'
instead of 'nat=yes'.

 [7001] 
 type=friend 
 host=dynamic 
 secret=123 
 context=internal 
 
 [7002] 
 type=friend 
 host=dynamic 
 secret=456 
 context=internal 
 
 A snoop capture for my call is uploaded in the following link. I
 wonder if there is any missing configuration or plugin need to be
 set here! 
 http://www.fileconvoy.com/dfl.php?id=gc0957418962ed157999374318118ae80b9d015992
  

At this point, you should be able to establish a call between the two
X-Lite phones that won't get disconnected due to failing to complete
the three-way handshake.  There may still not be voice because the
firewall(s) between Asterisk and the X-Lite phones may block the RTP
traffic.  The phones appear to be on the same network, so you can try
setting 'canreinvite=yes' to workaround this problem until the
firewall(s) are configured to allow RTP traffic on the UDP port range
specified in 'rtp.conf' (the default range is 1-2).

Good luck and please report your progress back to the list.

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


Re: [asterisk-users] Adjusting confbridge call quality

2013-07-10 Thread Matthew J. Roth
Chris Gentle wrote:

 Is there any way I can improve the audio quality in a confbridge in
 Asterisk 11?  I've changed the internal_sample_rate setting to 44100
 but that doesn't seem to make any difference.  I would also think this
 would make my confbridge recordings 44100 but they all end up as 8000.
 Am I completely missing something?

basteon wrote:

 What codec do you use with yours subscribers?

Chris Gentle wrote:

 ulaw


Chris,

The sampling frequency for u-law is 8,000 Hz.  You can't produce a recording
with higher quality than the source, so you'd have to switch to a wideband codec
to improve the conferences and recordings [1] [2].

[1] 
https://wiki.asterisk.org/wiki/display/AST/Asterisk+10+Codecs+and+Audio+Formats
[2] http://www.slideshare.net/saghul/wideband-audio-conferencing-with-asterisk

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


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


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

2013-06-19 Thread Matthew J. Roth
Eloi Bail wrote:

 I am trying to enable SIP SIMPLE communication in my test environment.

 I have the following env :

 - one server (192.168.50.126) with Asterisk 11
 - 2 clients using pidgin : demo-bob and demo-alice on my 192.168.50.143

 I successfully had a phone call between clients.

 I used the following link to enable SIMPLE messaging between my clients :
 http://highsecurity.blogspot.ca/2012/03/asterisk-10-110-sms-messaging-or-sip.html

 Both users managed to register.

 Adding verbose on the server, I have the following traces when I send the
 message MESSAGE FROM ALICE TO BOB from demo-alice to demo-bob

 http://paste.fedoraproject.org/19489/37158861/

 As you can see I succeed to have the message sent from alice to Asterisk.

 When the server is trying to transmitting, I see a 401 error message.
 According to this post ( http://forums.digium.com/viewtopic.php?f=1t=72814 )
 the first 401 should be normal as authentication is requested.

 Afterwards the server emit 202 message.

 But demo-bob never receives a message.
 I ran wireshark on server and client. It confirms that no message is sent from
 Asterisk to demo-bob.

 Could you please give me advice ?

 Here are my extensions.conf and sip.conf according to the link I mentioned.
 http://paste.fedoraproject.org/19626/16493741/

 http://paste.fedoraproject.org/19627/49423137/


Eloi,

The trace shows that the initial MESSAGE from Alice does not include an
Authorization header so Asterisk responds with a 401 Unauthorized.  Alice then
replies with a MESSAGE with an Authorization header, but reuses the same CSeq
header (CSeq: 6 MESSAGE) which causes Asterisk to ignore it as a retransmit:

 [Jun 18 16:49:35] DEBUG[16266] chan_sip.c: Ignoring SIP message because of
 retransmit (MESSAGE Seqno 6, ours 6)

I believe this is a bug in Pidgin because RFC 3261 [1] states:

   CSeq or Command Sequence contains an integer and a method name.  The
   CSeq number is incremented for each new request within a dialog and
   is a traditional sequence number.
   ...
   Requests within a dialog MUST contain strictly monotonically
   increasing and contiguous CSeq sequence numbers (increasing-by-one)
   in each direction (excepting ACK and CANCEL of course, whose numbers
   equal the requests being acknowledged or cancelled).

However, there is also a similar issue [2] that can be worked around by setting
pedantic=no in sip.conf.  If that doesn't work, you can give the following
(untested) patch to chan_sip.c a try:


--- chan_sip.c.orig 2013-06-19 11:44:38.0 -0400
+++ chan_sip.c  2013-06-19 11:47:22.0 -0400
@@ -28078,6 +28078,7 @@
} else if (p-icseq 
   p-icseq == seqno 
   req-method != SIP_ACK 
+  p-method != SIP_MESSAGE 
   (p-method != SIP_CANCEL || p-alreadygone)) {
/* ignore means don't do anything with it but still have to
   respond appropriately.  We do this if we receive a repeat of


Good luck and please let the list know how this works out.

[1] http://www.ietf.org/rfc/rfc3261.txt
[2] https://issues.asterisk.org/jira/browse/ASTERISK-19139

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


Re: [asterisk-users] Asterisk sends the INTERNAL IP address of my equipments to my SIP friends?!?

2013-06-15 Thread Matthew J. Roth
Andreas Sikkema wrote:

 On 6/13/13 16:20 , Matthew J. Roth wrote:
  It's hard to be certain without seeing a full SIP trace, but I think the 
  INVITE
  with the internal IP is actually a re-INVITE that Asterisk is sending to
  establish a native bridge between the SIP friend and the SIP gateway to PSTN
  converter.  

 It's actually pretty easy.

 If an INVITE message has a tag parameter in both To and From headers,
 it's a re-INVITE. If the To header doesn't have a tag parameter, it's an
 initial INVITE.


Andreas,

Thanks for the tip.  That's a very useful bit of information to know.  It also
confirms that the INVITE in Mickael's original post [1] is a re-INVITE:

  From: sip: at 109.69.217.6;tag=as15b47581
  To: test sip: at 109.69.217.6;tag=kp1VwHD80rA9MVdBjTF4jyFIaCkrJcjh

Consequently, the advice in my response [2] about initially reconfiguring
Asterisk with directmedia=no and then fine-tuning the NAT SUPPORT and MEDIA
HANDLING settings is valid.

[1] http://lists.digium.com/pipermail/asterisk-users/2013-June/279435.html
[2] http://lists.digium.com/pipermail/asterisk-users/2013-June/279450.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


Re: [asterisk-users] Asterisk sends the INTERNAL IP address of my equipments to my SIP friends?!?

2013-06-13 Thread Matthew J. Roth
Mickael MONSIEUR wrote:

 My version is Asterisk 1.6.2.9.

 Or have you seen NAT ? I have no NAT on my network . Have you seen my little
 diagram above ?

 Here it is:

 SIP friends (phones) - Asterisk - SIP gateway to PSTN converter
 80.236.215.61109.69.217.6 internal IP ( 
 10.4.0.10/255.255.255.0 )

 My Asterisk server has two NIC/interfaces.

 - 1 interface with public IP (109.69.217.6 to talk with SIP friends )
 - 1 interface with internal ip ( 10.4.0.1 to talk with SIP gateway's)

 SIP friend should not even know that the call is routed to the SIP /PSTN
 gateway .
 It could be a SIP trunk to a SIP provider Internet , the user does not have to
 know. ..


Mickael,

It's hard to be certain without seeing a full SIP trace, but I think the INVITE
with the internal IP is actually a re-INVITE that Asterisk is sending to
establish a native bridge between the SIP friend and the SIP gateway to PSTN
converter.  This would allow the endpoints to send their media directly to one
another, but in your case I'd expect it to cause one-way audio because the SIP
friend shouldn't be able to send RTP packets to the internal IP.

If it's a re-INVITE, start by reconfiguring Asterisk with directmedia=no in
the [general] section of sip.conf and for all of the endpoints involved in the
calls.  That should completely eliminate the re-INVITEs at the expense of
relaying all RTP through Asterisk, even for calls between two phones on the
internal network.  After you've confirmed that internal IPs are no longer being
sent to external endpoints you can start fine-tuning the NAT SUPPORT and MEDIA
HANDLING settings in sip.conf to only allow re-INVITEs when appropriate for your
environment.

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


Re: [asterisk-users] No audio until you put call on hold...

2013-06-13 Thread Matthew J. Roth
Carlos Chavez wrote:

 I have been struggling with an audio issue for a week now and have
 not been able to solve it.

 We have an Asterisk server (now running 11.4 but started with 1.8)
 with several sip phones on an internal network and a SIP trunk for
 external calls.  We recently put several phones in service that
 connect via the Internet to the server.  All NAT settings and port
 configurations were done and all phones register.  The problem we have
 is that when external phones dial a pstn number they get no audio.  We
 found that if you dial and put the call on hold for a couple second
 you then get audio on the call.

 I really do not know what else I can check in the configuration.  Why
 would putting the call on hold get the audio flowing?  Any ideas or
 recommendations?


Carlos,

Please provide SIP traces of both call legs (external phone to Asterisk and
Asterisk to SIP trunk) annotated to show when the audio starts as well as the
CLI output of 'sip show settings', 'sip show peer external phone', and 'sip
show peer SIP trunk'.

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


Re: [asterisk-users] Asterisk sends the INTERNAL IP address of my equipments to my SIP friends?!?

2013-06-12 Thread Matthew J. Roth
Mickael MONSIEUR wrote:

 I have a standard Asterisk configuration:

 SIP friends (phones) - Asterisk - SIP gateway to PSTN converter
 80.236.215.61109.69.217.6 internal IP ( 
 10.4.0.10/255.255.255.0 )

 When analyzing traffic on a SIP friend/phone I see this:

 INVITE sip:@80.236.215.61:64946;ob SIP/2.0
 Via: SIP/2.0/UDP 109.69.217.6:5060;branch=z9hG4bK52d50250;rport
 Max-Forwards: 70
 From:  sip:@109.69.217.6 ;tag=as15b47581
 To: test  sip:@109.69.217.6 ;tag=kp1VwHD80rA9MVdBjTF4jyFIaCkrJcjh
 Contact:  sip:x@109.69.217.6 
 Call-ID: MSMhw2bsheHWAQgHlae3O7yKQ2P9EcsM
 CSeq: 102 INVITE
 User-Agent: Asterisk
 Require: timer
 Session-Expires: 1800;refresher=uas
 Min-SE: 90
 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO
 Supported: replaces, timer
 Content-Type: application/sdp
 Content-Length: 217

 v=0
 o=root 664087974 664087976 IN IP4 10.4.0.10
 s=Asterisk
 c=IN IP4 10.4.0.10
 t=0 0
 m=audio 8652 RTP/AVP 8 101
 a=rtpmap:8 PCMA/8000
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-16
 a=ptime:20
 a=sendrecv

 My equipement IP 10.4.0.10 is visible to the user, why?


Mickael,

What version of Asterisk are you running?

Is the Asterisk server outside and the SIP gateway to PSTN converter inside of a
NAT?

What are the NAT SUPPORT and MEDIA HANDLING settings in sip.conf?

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


Re: [asterisk-users] Why does it take several seconds to interpret DTMF-input ?

2013-06-11 Thread Matthew J. Roth
Jonas Kellens wrote:
 
 I notice that it takes 4 to 6 seconds between someone pressing a cipher and
 Asterisk continuing inside the dialplan. How come ???
 
 ...
 
 Why doesn't Asterisk continue immediately inside the dialplan after having
 received the DTMF-input ?


Jonas,

Please provide the version of Asterisk you are using and the part of the 
dialplan
that receives the DTMF input.

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


Re: [asterisk-users] Why does it take several seconds to interpret DTMF-input ?

2013-06-11 Thread Matthew J. Roth
Jonas Kellens wrote: 
 
 Even if there *can* be more than 1 digit, in case there is only 1 digit it
 should go faster.


Jonas,

Use the TIMEOUT function to set the maximum amount of time permitted between
digits when the user is typing in DTMF.  As you've discovered, the default is 5
seconds.

The following example reduces it to 2 seconds:

exten = ivr,1,NoOp()
exten = ivr,n,Set(TIMEOUT(digit)=2)
exten = 
ivr,n(restartprompt),Background(/var/lib/asterisk/sounds/vprompts/${KNUMMER}/${ASTPROMPT})
exten = ivr,n,NoOp(${BACKGROUNDSTATUS})
exten = ivr,n,WaitExten(15)
exten = ivr,n,GoTo(restartprompt)


Enter 'core show function TIMEOUT' at the Asterisk CLI for more information 
about
the TIMEOUT function.

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


Re: [asterisk-users] G.729 codec in pass-thru mode

2013-06-05 Thread Matthew J. Roth
Kamlesh Kumar wrote:
 
 allow=all is defined in sip.conf for the ITSP's SIP peer. Additionally, ITSP
 supports g729 codec as we are able to send the traffic from other soft switch.


There must be some difference between your Asterisk servers.  Please set them
up for calling the ITSP with G.729 and provide the following CLI output from
both of them.  Be sure to preserve any differences when obscuring IP addresses
and label the output clearly as G.729 working and G.729 fails.

  CLI core show version
  CLI sip show settings
  CLI sip show peer 100
  CLI sip show peer ITSP's SIP peer
  CLI g729 show licenses

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


Re: [asterisk-users] G.729 codec in pass-thru mode

2013-06-04 Thread Matthew J. Roth
Kamlesh Kumar wrote:
 
 SIP.conf
 [100]
 username=100
 secret=password
 type=friend
 host=dynamic
 nat=yes
 canreinvite=no
 insecure=port
 disallow=all
 allow=ulaw
 allow=alaw
 allow=g729
 context=asterisk
 qualify=no

Is there also an allow=g729 line in sip.conf for the ITSP's SIP peer?

 SIP Trace: 
 201.xxx.xxx.xxx = SIP Softphone which originates the call 
 xxx.xxx.xxx.xxx = Asterisk server 
 yyy.yyy.yyy.yyy = ITSP 
 
 ...
 
 --- SIP read from UDP:yyy.yyy.yyy.yyy:5060 ---
 SIP/2.0 183 Session Progress
 Via: SIP/2.0/UDP xxx.xxx.xxx.xxx:5060;branch=z9hG4bK15380659;rport=5060
 From: 100 sip:1...@xxx.xxx.xxx.xxx;tag=as643c20b1
 To: sip:12127773...@yyy.yyy.yyy.yyy;tag=gK029aaa8c
 Call-ID: 07714ae4593feb5c3e42b3a01cf4a...@xxx.xxx.xxx.xxx
 CSeq: 102 INVITE
 Contact: sip:12127773...@yyy.yyy.yyy.yyy:5060
 Allow: 
 INVITE,ACK,CANCEL,BYE,REGISTER,REFER,INFO,SUBSCRIBE,NOTIFY,PRACK,UPDATE,OPTIONS
 Content-Length:  234
 Content-Disposition: session; handling=required
 Content-Type: application/sdp
 v=0
 o=Sonus_UAC 24592 17457 IN IP4 yyy.yyy.yyy.yyy
 s=SIP Media Capabilities
 c=IN IP4 zzz.zzz.zzz.zzz
 t=0 0
 m=audio 21996 RTP/AVP 0 101
 a=rtpmap:0 PCMU/8000
 a=rtpmap:101 telephone-event/8000
 a=fmtp:101 0-15
 a=sendrecv
 a=maxptime:20
 -
 [Jun  3 13:11:31] --- (11 headers 11 lines) ---
 [Jun  3 13:11:31] Found RTP audio format 0
 [Jun  3 13:11:31] Found RTP audio format 101
 [Jun  3 13:11:31] Found audio description format PCMU for ID 0
 [Jun  3 13:11:31] Found audio description format telephone-event for ID 101
 [Jun  3 13:11:31] Capabilities: us - 0x4 (ulaw), peer - audio=0x4 
 (ulaw)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x4 (ulaw)
 [Jun  3 13:11:31] Non-codec capabilities (dtmf): us - 0x1 (telephone-event), 
 peer - 0x1 (telephone-event), combined - 0x1 (telephone-event)
 [Jun  3 13:11:31] Peer audio RTP is at port zzz.zzz.zzz.zzz:21996
 [Jun  3 13:11:31] -- SIP/yyy.yyy.yyy.yyy-34d9 is making progress 
 passing it to SIP/100-34d8
 [Jun  3 13:11:31] Audio is at xxx.xxx.xxx.xxx port 26042
 [Jun  3 13:11:31] Adding codec 0x4 (ulaw) to SDP
 [Jun  3 13:11:31] Adding non-codec 0x1 (telephone-event) to SDP

This response from the ITSP says that only u-law may be used for the call.
Please contact the ITSP and confirm that they actually support the G.729 codec.

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


Re: [asterisk-users] G.729 codec in pass-thru mode

2013-06-04 Thread Matthew J. Roth
Mark Henry wrote:
 
 1. Your softphone is not sending g729

This was a SIP trace of a successful u-law call.  In an earlier post Kamlesh
provided a trace of a failed G.729 call which did not include the dialog between
the Asterisk server and the ITSP.  I asked for this trace so that I could see
the codecs offered by the ITSP.

 2. canreinvite should be set to yes for using pass-thru mode

I believe that by pass-thru mode [1] Kamlesh means he wants to avoid transcoding
from G.729 to another codec since that requires a license per channel.  Pass-
thru mode can be achieved with canreinvite=no as shown by the following line
from the successful u-law SIP trace and Mark Michelson's asterisk-dev post:

 [Jun  3 13:11:32] -- Packet2Packet bridging SIP/100-34d8 and 
 SIP/yyy.yyy.yyy.yyy-34d9

From [asterisk-dev] Native Bridging: terminology [2]:

  ...within SIP, native bridging has two subcategories.  One, typically referred
  to as SIP native bridging is used when reINVITEs are enabled.  The endpoints
  send their media directly to one another.  The other subcategory is called
  Packet 2 Packet or P2P bridging.  If reINVITEs are not enabled, but there
  are also no features that require the Asterisk core to be in the voice path,
  then the bridging will be done at the RTP layer of Asterisk.

[1] http://www.voip-info.org/wiki/view/Asterisk+G.729+pass-thru
[2] http://lists.digium.com/pipermail/asterisk-dev/2010-March/043053.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


Re: [asterisk-users] G.729 codec in pass-thru mode

2013-05-31 Thread Matthew J. Roth
Kamlesh Kumar wrote:
 
 Yes that's correct, when I use u-law call works fine.
 
 In case of g729, I enabled sip debug with 'sip set debug on' and captured all
 the sip traces and got whatever I posted in last email. There was no other
 call on the system when I captured sip trace. Please suggest further
 proceedings. 


Kamlesh,

Please provide a SIP trace (sip set debug on) of a successful u-law call.  I'm
especially interested in the dialog between the Asterisk server and the ITSP in
this scenario.

Also include the relevant sections of sip.conf and the dialplan.

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


Re: [asterisk-users] G.729 codec in pass-thru mode

2013-05-29 Thread Matthew J. Roth
Kamlesh Kumar wrote:

 Call even doesn't go to the ITSP. I tried without AGI script and the results
 were same.


Kamlesh,

Your first message stated that the call is successful if the codec is u-law, so
there must be communication between the Asterisk server and the ITSP.  The key
to understanding why the G.729 call fails is in this SIP signaling.

How are you capturing the SIP trace?  Are you enabling SIP debugging for the
specific SIP softphone?  If so, please use sip set debug on to enable it for
all SIP packets.  Then wait until there are no other calls on the Asterisk
server, try another G.729 call, and post the CLI output.

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


Re: [asterisk-users] G.729 codec in pass-thru mode

2013-05-28 Thread Matthew J. Roth
Kamlesh,

Please provide SIP traces of both call legs for a failed call.

Your last message only included a SIP trace of the call leg from the SIP
softphone to the Asterisk server.  There was no SIP trace for the call leg from
the Asterisk server to the ITSP and, as shown below, that is probably where the
answer to your problem can be found.

First, the call leg from the SIP softphone to the Asterisk server successfully
negotiated G.729 as the codec:

 [May 28 11:51:34] Found RTP audio format 18
 ...
 [May 28 11:51:34] Capabilities: us - 0x104 (ulaw|g729), peer - audio=0x100 
 (g729)/video=0x0 (nothing)/text=0x0 (nothing), combined - 0x100 (g729)

However, the call.php AGI script then failed to create the call leg from the
Asterisk server to the ITSP:

 [May 28 11:51:34] -- Executing AGI(SIP/100-115f, call.php)
 [May 28 11:51:34] -- Launched AGI Script 
 /var/lib/asterisk/agi-bin/call.php
 [May 28 11:51:34] -- AGI Script Executing Application: (Dial) Options: 
 (SIP/yyy.yyy.yyy.yyy/12127773456)
 [May 28 11:51:34]   == Using SIP RTP CoS mark 5
 [May 28 11:51:34] -- Couldn't call yyy.yyy.yyy.yyy/12127773456
 [May 28 11:51:34] Scheduling destruction of SIP dialog 
 '142182ef20750fda512f8d2b0b071...@xxx.xxx.xxx.xxx' in 32000 ms (Method: 
 INVITE)
 [May 28 11:51:34]   == Everyone is busy/congested at this time (0:0/0/0)
 [May 28 11:51:34] -- SIP/100-115fAGI Script call.php completed, 
 returning 0
 [May 28 11:51:34] -- Auto fallthrough, channel 'SIP/100-115f' status 
 is 'CHANUNAVAIL'

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


Re: [asterisk-users] Failed to authenticate device Ext 110

2013-05-22 Thread Matthew J. Roth
asterisk users wrote:
 
 Registration trace
 (note that extension 88 is the voicemail extension, which the phone registers
 to also for MWI)
 -- http://pastebin.com/c3H700wa

There are no REGISTER requests in that trace.  All I see are SUBSCRIBE, NOTIFY,
OPTIONS, and INVITE dialogs.

 Call trace: 
 |Time | 10.8.0.6 | 
 | | | 192.168.6.2 | 
 |268.693661| INVITE SDP (g711U g729 g722 telephone-eventRTP...e-101) |SIP 
 From: Ext 110  sip:110@192.168.6.2 To: sip:88@192.168.6.2 
 | |(1024) -- (5060) | 
 |268.694449| 401 Unauthorized |SIP Status 
 | |(1024) -- (5060) | 
 |268.914195| ACK | |SIP Request 
 | |(1024) -- (5060) | 
 |268.945115| INVITE SDP (g711U g729 g722 telephone-eventRTP...e-101) |SIP 
 From: Ext 110  sip:110@192.168.6.2 To: sip:88@192.168.6.2 
 | |(1024) -- (5060) | 
 |268.945717| 403 Forbidden |SIP Status 
 | |(1024) -- (5060) | 
 |269.041417| ACK | |SIP Request 
 | |(1024) -- (5060) | 

This is just a failed INVITE probably due to the username and/or password being
incorrect.  It's also possible that bad ACLs (see the 'permit/deny/acl' settings
in sip.conf) could be to blame.  It's hard to say without seeing a full SIP
trace and Asterisk CLI output.

 I'm also confused by the reference in sip show peers to port 5062, as I
 can't see that anywhere in the configuration of either the phone or in
 sip.conf. All the other phones show port 5060 in the sip show peers output. 

Start there and work through the obvious issues one by one.  First, figure out
why the phone is showing up on port 5062 and correct it if necessary.  Then,
double-check the username and password.  Keep going down that path until it
leads to a resolution or report back to the list if you run into a roadblock.

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


Re: [asterisk-users] Failed to authenticate device Ext 110

2013-05-21 Thread Matthew J. Roth
asterisk users wrote:
 
 I'm having a strange problem recently with a Yealink SIP-T28P phone connected
 to Asterisk 11.4.0 via openvpn. It was working fine for months, and now when I
 dial anything from the phone, it shows Forbidden, and the Asterisk console
 shows: 
 
 [May 21 10:47:49] NOTICE[28518][C-0004]: chan_sip.c:25189 
 handle_request_invite: Failed to authenticate device Ext 110  
 sip:110@192.168.6.2 ;tag=1130259112 
 
 Asterisk 192.168.6.2 
 OpenVPN on router 10.8.0.1 
 Remote Yealink phone 10.8.0.6 
 
 The remote phone shows as being registered: 
 PBX*CLI sip show peers 
 Name/username Host Dyn Forcerport ACL Port Status Description 
 110/110 10.8.0.6 D A 5062 OK (111 ms) Yealink OpenVPN 
 
 Also, if there is voicemail in the mailbox for 110, the phone's message light
 is lit and it beeps periodically. 
 
 ...
 
 Any suggestions on what might be happening here, and how it could be 
 resolved? 


That is quite strange.  Please provide SIP traces of the dialogs between
Asterisk and the phone in the following two scenarios:

  1) Phone registering to Asterisk (presumably successful)
  2) Phone dialing to Asterisk (presumably unsuccessful)

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


Re: [asterisk-users] Initial REGISTER Request: Contains Credentials before 401: KDDI Japan

2013-05-16 Thread Matthew J. Roth
Brian,

 KDDI does provide a list of supported equipment and vendors.  Specific
 hardware or license based software products that quickly become cost
 prohibitive.
 
 I doubt that Asterisk will find it's way on the list any time soon.  Because
 KDDI follows the traditional big telco method of interoperability, which
 normally means licensing products for use on their network.

That's exactly the sort of thing that the industry should be evolving away from.
For now, this should help quiet KDDI's complaints.

Here is a small patch to the transmit_register() function in chan_sip.c that
prevents adding an Authorization header to the initial REGISTER request:


--- certified-asterisk-1.8.15-cert1/channels/chan_sip.c.orig2013-05-16 
16:30:12.0 -0400
+++ certified-asterisk-1.8.15-cert1/channels/chan_sip.c 2013-05-16 
16:57:49.0 -0400
@@ -13620,6 +13620,8 @@
if (!ast_strlen_zero(global_useragent))
add_header(req, User-Agent, global_useragent);

+/* Never add auth header to the initial REGISTER request */
+if (r-regattempts) {
if (auth) {  /* Add auth header */
add_header(req, authheader, auth);
} else if (!ast_strlen_zero(r-nonce)) {
@@ -13647,6 +13649,7 @@
 ast_log(LOG_NOTICE, No authorization available for 
authentication of registration to %s@%s\n, r-username, r-hostname);
}
}
+}

snprintf(tmp, sizeof(tmp), %d, r-expiry);
add_header(req, Expires, tmp);


I tested it to make sure it works as advertised, but not thoroughly enough to
be completely confident that there are no side effects.  At the very least, it
should be a good starting point for a more robust patch.

Here is a SIP trace of the REGISTER dialog when Asterisk starts or when 'sip
reload' is entered at the CLI.


17:03:39.279847 IP astdev.imminc.com.sip  ekiga.net.sip: SIP, length: 381
REGISTER sip:ekiga.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK0f4587f3;rport
Max-Forwards: 70
From: sip:regt...@ekiga.net;tag=as1f2818c1
To: sip:regt...@ekiga.net
Call-ID: 5f37c0dc188cdd5c02a9a092148ef217@192.168.1.1
CSeq: 104 REGISTER
User-Agent: Asterisk PBX 1.8.15-cert1
Expires: 120
Contact: sip:s@192.168.1.1:5060
Content-Length: 0


17:03:39.370575 IP ekiga.net.sip  astdev.imminc.com.sip: SIP, length: 462
SIP/2.0 401 Unauthorized
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK0f4587f3;rport=42521
From: sip:regt...@ekiga.net;tag=as1f2818c1
To: sip:regt...@ekiga.net;tag=c64e1f832a41ec1c1f4e5673ac5b80f6.9b08
Call-ID: 5f37c0dc188cdd5c02a9a092148ef217@192.168.1.1
CSeq: 104 REGISTER
WWW-Authenticate: Digest realm=ekiga.net, 
nonce=519549c961b09f86679289f055e42960ed06592c052d
Server: Kamailio (1.5.3-notls (i386/linux))
Content-Length: 0


17:03:39.403113 IP astdev.imminc.com.sip  ekiga.net.sip: SIP, length: 582
REGISTER sip:ekiga.net SIP/2.0
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK32be996c;rport
Max-Forwards: 70
From: sip:regt...@ekiga.net;tag=as36aa89ae
To: sip:regt...@ekiga.net
Call-ID: 5f37c0dc188cdd5c02a9a092148ef217@192.168.1.1
CSeq: 105 REGISTER
User-Agent: Asterisk PBX 1.8.15-cert1
Authorization: Digest username=regtest, realm=ekiga.net, algorithm=MD5, 
uri=sip:ekiga.net, nonce=519549c961b09f86679289f055e42960ed06592c052d, 
response=e477ad0f835211b06d750a8c3edf88ea
Expires: 120
Contact: sip:s@192.168.1.1:5060
Content-Length: 0


17:03:39.495126 IP ekiga.net.sip  astdev.imminc.com.sip: SIP, length: 399
SIP/2.0 200 OK
Via: SIP/2.0/UDP 192.168.1.1:5060;branch=z9hG4bK32be996c;rport=42521
From: sip:regt...@ekiga.net;tag=as36aa89ae
To: sip:regt...@ekiga.net;tag=c64e1f832a41ec1c1f4e5673ac5b80f6.bf7b
Call-ID: 5f37c0dc188cdd5c02a9a092148ef217@192.168.1.1
CSeq: 105 REGISTER
Contact: sip:s@192.168.1.1:5060;expires=600
Server: Kamailio (1.5.3-notls (i386/linux))
Content-Length: 0


I hope this helps you convince KDDI that Asterisk is a legitimate VoIP platform.
Please reply and let me know how it goes.

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


Re: [asterisk-users] Initial REGISTER Request: Contains Credentials before 401

2013-05-15 Thread Matthew J. Roth
Brian LaVallee wrote:
 
 My SIP provider is not happy that credentials (in the Authorization header
 field) are provided in the initial REGISTER request.
 
 The SIP provider ONLY wants the credentials AFTER rejecting the message with
 a 401.
 
 I know it's dumb, because the RFC says that the the initial REGISTER message
 MAY include credentials.  If it fails, the proper authentication method is
 included in the 401.  I know there is nothing wrong, it is how SIP is
 supposed to work.

Who is your SIP provider?  They need to be called out so that other Asterisk
users can avoid them.  This tendency to flip the customer/vendor relationship on
its head must be discouraged.

 However I would like to keep my SIP provider from complaining.

The only thing they should complain about is if you don't pay your bill on time.

 Asterisk is NOT SUPPORTED by the SIP provider.

The REGISTER request was successful so, at least from a practical standpoint,
the provider does support Asterisk.  It would be ideal if all providers
officially supported Asterisk, but this is just one example of how it's not
worth trying to please everyone.

 Does anyone in the Asterisk community know how to avoid sending the
 credentials until AFTER receiving a 401?

Edit the source.  I'm sorry to be blunt, but I really can't see the developers
adding another option to sip.conf just to satisfy such a pointless request.

 Any suggestions would be appreciated!

Ask the provider what platforms are supported.  Pick one of them and use it to
configure the useragent and sdpsession options in sip.conf.  Or look for
another provider that doesn't waste your time complaining about RFC-compliant
behavior.  

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

Re: [asterisk-users] On SIP INVITE answering to IP:port found in Contact: header.

2013-04-17 Thread Matthew J. Roth
Joshua Colp wrote:
 
 Most of your response is correct except it doesn't take into account the 
 rport RFC. Lack of implementation of an RFC doesn't make it 
 non-compliant, so their stuff really is fine for this scenario. It all 
 comes down to us forcing rport to be on by default.
 
 This is now the second known platform on my list that uses a random 
 source port for the IP header instead of the actual one. The other 
 being, like I mentioned, older Cisco phones.

Joshua,

I've added RFC 3581 to my list of references.

Thank you for taking the time to look at my response and provide feedback, as
well as for your hard work migrating Asterisk to a new SIP stack.

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

Re: [asterisk-users] On SIP INVITE answering to IP:port found in Contact: header.

2013-04-17 Thread Matthew J. Roth
Markus,

I'll take another shot at answering your questions.  As before, if someone more
knowledgeable, like Joshua Colp, also responds please give more credibility to
their remarks.

 Although I have to say I don't understand what is going on exactly. :) 
 As can be seen below, and as Joshua suggested, nat=no removed the 
 rport in the Via: header. I'm just wondering how Asterisk now knows to 
 which port to send the replies to? Is it simply using 5060 because 
 that's the RFC default for SIP? And because there is no port specified 
 in the Via: header?

I think you're on the right track here.  From RFC 3261 [1]:

   Before a request is sent, the client transport MUST insert a value of
   the sent-by field into the Via header field.  This field contains
   an IP address or host name, and port.  The usage of an FQDN is
   RECOMMENDED.  This field is used for sending responses under certain
   conditions, described below.  If the port is absent, the default
   value depends on the transport.  It is 5060 for UDP, TCP and SCTP,
   5061 for TLS.

 Would the nat=no switch also fix it in a scenario 
 where the remote side was sending from port 36252 but wanted the replies 
 on port 5061 instead of 5060?

Let's use another random port, 23456, as an example to avoid the default port
for TLS.  In this case, I believe the 'nat=no' setting would not work because if
a port isn't specified in the Via header the default port for UDP, 5060, is
used.  It would only work if the provider included the port in the Via header as
follows:

  Via: SIP/2.0/UDP 1.1.1.1:23456;branch=z9hG4bK2e91efaf

 Matthew, to provide you with feedback, here are the SIP headers before 
 and after nat=no:
 
 Without nat=no:
 
 IP 1.1.1.1.36252  2.2.2.2.5060: UDP, length 845
 INVITE sip:1234@2.2.2.2 SIP/2.0
 Via:SIP/2.0/UDP 
 1.1.1.1;branch=z9hG4bKBroadWorks.2plg2e-2.2.2.2V5060-0-164693126-1529565735-1366128986378-
 From:sip:@1.1.1.1;user=phone;tag=1529565735-1366128986378-
 To:My wifesip:1234@2.2.2.2:5060
 Call-ID:BW161626378160413-1212022685@1.1.1.1
 CSeq:164693126 INVITE
 Contact:sip:1.1.1.1:5060
 Supported:100rel
 Allow:ACK,BYE,CANCEL,INFO,INVITE,OPTIONS,PRACK,REFER,NOTIFY,UPDATE
 Accept:application/media_control+xml,application/sdp,multipart/mixed
 Max-Forwards:40
 Content-Type:application/sdp
 Content-Length:206
 
 [ ... SDP removed ... ]
 
 IP 2.2.2.2.5060  1.1.1.1.36252: UDP, length 602
 SIP/2.0 100 Trying
 Via: SIP/2.0/UDP 
 1.1.1.1;branch=z9hG4bKBroadWorks.2plg2e-2.2.2.2V5060-0-164693126-1529565735-1366128986378-;received=1.1.1.1;rport=36252
 From: sip:@1.1.1.1;user=phone;tag=1529565735-1366128986378-
 To: My wifesip:1234@2.2.2.2:5060
 Call-ID: BW161626378160413-1212022685@1.1.1.1
 CSeq: 164693126 INVITE
 Server: Asterisk PBX 10.7.1
 Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO, 
 PUBLISH
 Supported: replaces, timer
 Contact: sip:1234@2.2.2.2:5060
 Content-Length: 0

As Joshua Colp stated in another email [2], without 'nat=no' Asterisk forces
rport to be on by default.  From RFC 3581 [3]:

   The Session Initiation Protocol (SIP) operates over UDP and TCP,
   among others.  When used with UDP, responses to requests are returned
   to the source address the request came from, and to the port written
   into the topmost Via header field value of the request.  This
   behavior is not desirable in many cases, most notably, when the
   client is behind a Network Address Translator (NAT).  This extension
   defines a new parameter for the Via header field, called rport,
   that allows a client to request that the server send the response
   back to the source IP address and port from which the request
   originated.

So Asterisk ignores the Via header in the INVITE, sends the response back to
1.1.1.1:36252 (the source IP address and port), and appends an rport parameter
to the Via header in the response.

 And with nat=no:
 
 The same, except for the reply:
 
 IP 2.2.2.2.5060  1.1.1.1.5060: UDP, length 588
 SIP/2.0 100 Trying
 Via: SIP/2.0/UDP 
 1.1.1.1;branch=z9hG4bKBroadWorks.2plg2e-2.2.2.2V5060-0-179354203-809967599-1366158308532-;received=1.1.1.1
 
 That means the rport part is gone.

The sample sip.conf for Asterisk 10 [4] has a comment stating:

  ; nat = no ; Use rport if the remote side says to use it.

Since the provider did not say to use rport in the INVITE, Asterisk responds
to the source address the request came from and to the port in the Via header.
The port is absent, so Asterisk uses the default port for UDP, 5060, and sends
the response back to 1.1.1.1:5060.

I really hope this helps you understand the situation.  I know I learned at
least a thing or two writing it up.

[1] http://www.ietf.org/rfc/rfc3261.txt
[2] http://lists.digium.com/pipermail/asterisk-users/2013-April/278611.html
[3] http://www.ietf.org/rfc/rfc3581.txt
[4] 
http://svnview.digium.com/svn/asterisk/branches/10/configs/sip.conf.sample?revision=373665view=markup

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software 

Re: [asterisk-users] On SIP INVITE answering to IP:port found in Contact: header.

2013-04-16 Thread Matthew J. Roth
Markus,

I think I know what's wrong here but I did a fair amount of research while
digging into your problem.  I may have misinterpreted something along the way so
you should also consider other responses, especially if they come from someone
who claims greater expertise.  I did this to help you and to learn, so I would
appreciate your feedback and welcome any corrections from more knowledgeable
list members.

Now on with the show.  My responses are inline.
 
 I'm trying to get a DID routed to me and the provider seems to have an 
 unusual setup. Or maybe not? From looking at their SIP header they are 
 using BroadWorks.

Using BroadWorks isn't unusual, but the rest of what you described is.
 
 The problem: they're sending their SIP invite from port 36252. My 
 Asterisk 10.7.1 is answering to that port 36252 but their BroadWorks 
 thingie is not listening on that port, but instead on port 5060. So they 
 want me to send my SIP responses to the IP:port they send via the 
 Contact: header.

That's where it got weird.  From RFC 3261 [1]:

   While the Via header field tells other elements where to send the
   response, the Contact header field tells other elements where to send
   future requests.
   ...
   The Contact header field provides a SIP or SIPS URI that can be used
   to contact that specific instance of the UA for subsequent requests.
   ...
   The Via header field indicates the transport used for the transaction
   and identifies the location where the response is to be sent.
   ...
   A Via header field value contains the transport protocol used to send
   the message, the client's host name or network address, and possibly
   the port number at which it wishes to receive responses.

 Here's the output from tcpdump (1.1.1.1 = them; 2.2.2.2 = me):
 
 IP 1.1.1.1.36252  2.2.2.2.5060: UDP, length 845
 [...]
 Contact:sip:1.1.1.1:5060
 [...]
 
 My Asterisk' reply:
 
 IP 2.2.2.2.5060  1.1.1.1.36252: UDP, length 602
 [...]

Their INVITES are requests and your Asterisk's replies (e.g. 100 Trying, 183
Session Progress, 200 OK) are responses.  As the RFC specifies, the Contact
header field applies to future requests.  However, it is the Via header field
that is used to route responses [2][3].

 I tried the following in the peer config in sip.conf:
 
 host=1.1.1.1
 type=peer
 insecure=port,invite
 port=5060
 
 But that didn't change anything.
 
 How can I tell Asterisk to honor and use the info found in Contact: when 
 sending its replies?

I don't think that you can, because Asterisk is probably just following the
specification and sending responses back to whatever IP and port are in the Via
header of the INVITE.  It's hard to say with certainty without seeing the entire
SIP dialog, but I think the provider needs to modify their INVITE to have a Via
header like the following:

  Via: SIP/2.0/UDP 1.1.1.1:5060;branch=z9hG4bK2e91efaf

[1] http://www.ietf.org/rfc/rfc3261.txt
[2] 
https://lists.cs.columbia.edu/pipermail/sip-implementors/2005-December/011517.html
[3] http://www.sipknowledge.com/faq_child5.htm#q2.12

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


Re: [asterisk-users] On SIP INVITE answering to IP:port found in Contact: header.

2013-04-16 Thread Matthew J. Roth
Joshua Colp wrote:
 
 If you set nat=no for that specific peer it should work as you need. 
 'rport' is forced on these days which works for most situations, except 
 with some platforms and Cisco phones. _

Joshua,

That sounds much easier than what I came up with, so I'd recommend to Markus
that he try your suggestion first.

If you have a moment, please take a look at my response and let me know if my
understanding of the Contact and Via headers was correct.  If it was, is the
'nat=no' solution just a way to workaround the provider's RFC-noncompliant
platform?

Thank you,

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


Re: [asterisk-users] Diagnosing call problem

2013-03-23 Thread Matthew J. Roth
Mitch Claborn wrote:
 
 I get to go home on Saturday!  The Digium phone deployment is simple 
 enough to manage remotely.

Glad to hear it.  If the problem comes back on the hardphones, just post the
debug information to this thread and I'll take a look at it.

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

Re: [asterisk-users] Diagnosing call problem

2013-03-22 Thread Matthew J. Roth
Mitch Claborn wrote:
 
 Interestingly, using Bria we sometimes see similar, though not exactly 
 the same, symptoms.  That would make me wonder about the TCP stack on 
 the client machine, or similar.

With a softphone, you're dependent on the entire software stack up to the 
softphone and at the mercy of every other process.  They're often a cheaper
solution, but the trade-off comes in the form of reliability and stability.

 We are close to ditching the soft phones entirely for this call center 
 and going to the Digium D40.  I put one of those in service this morning 
 and the calls are noticeably clearer and there have been no reported 
 problems.

The hardphone eliminates a lot of variables, so it's a very good idea to at
least use them in your test environment.  Using them in production may be more
expensive at first, but if they're easier to manage then they may be more
economical in the long run.

Good luck and I hope you get to go home this weekend.

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


Re: [asterisk-users] Asterisk disconnecting SIP Calls after 15 Minutes

2013-03-22 Thread Matthew J. Roth
Florian Wolters wrote:
 
 Does it make sense to have a more detailed tcpdump of the SIP session? If
 so, how should such a thing been shared without posting too much ASCII
 text to the list?

SIP sessions are generally small enough to post right to the list.  Otherwise,
you can put them up on a site like pastebin.com and provide the link.

 So I did setup another Extension leading me to a MeetMe conference to at
 least listen to some MoH while waiting for the 15 Minutes to exceed. This
 showed the same behaviour. After exactly 15 Minutes, the call is
 terminated  - namely by the provider. The analysis of the dump in
 Wireshark shows the last 6 SIP packets:
 
 2013-03-21 15:56:50.648141217.0.17.170   =   172.16.0.2Request:
 INVITE sip:02341234567890@79.253.136.186:5060
 2013-03-21 15:56:50.648325172.16.0.2 =   217.0.17.170  Status:
 100 Trying
 2013-03-21 15:56:50.648427172.16.0.2 =   217.0.17.170  Status:
 200 OK, with session description
 2013-03-21 15:56:50.731436217.0.17.170   =   172.16.0.2Request:
 ACK sip:02341234567890@79.253.136.186:5060
 2013-03-21 15:56:50.735426217.0.17.170   =   172.16.0.2Request:
 BYE sip:02341234567890@79.253.136.186:5060
 2013-03-21 15:56:50.735590172.16.0.2 =   217.0.17.170  Status:
 200 OK
 
 (manually copied that from the Wireshark window). This looks to me as if
 the provider for some reason does an INVITE after 15 Minutes, that is not
 correctly handled by my Asterisk. Is there any timer inside the SIP
 protocol, that may be aged by 15 Minutes? Or should I have a deeper look
 at the SIP packets?

This is where a full SIP trace that includes the messages used to setup the call
in the first place would be helpful.  I haven't seen anything related to session
timers in what you've posted so far, but they may have been negotiated when the
call was established.

Regardless, your calls are consistently dropping at 15 minutes and you've shown
that it's caused by the provider sending an INVITE, waiting for the OK, and
then sending a BYE.  You have enough to go to them and ask why it's happening.
Even if it's something in your Asterisk configuration, they are initiating the
hangup and should be able to tell you why.  If they can't or won't help you
troubleshoot this problem then I'd seriously consider looking for a new
provider.

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


Re: [asterisk-users] Asterisk disconnecting SIP Calls after 15 Minutes

2013-03-21 Thread Matthew J. Roth
Florian Wolters wrote:
 
 So I turned on SIP debug for this host and analyszed it with wireshark.
 The last packets show an INVITE from my provider, that is answered by my
 Asterisk with 200 OK, with session description. What follows is an ACK
 by the provider and immediately a BYE sent by the provider. So for me it
 looks like the provider is disconnecting the call.


Florian,

This is a little hard to diagnose without seeing the SIP traffic for the
duration of the call.  It makes it impossible to tell if the INVITES the
provider is sending are related to the call (i.e. have the same Call-ID header),
but if they are being sent consistently 15 minutes into every call it may not
matter.  If the provider is sending you unsolicited INVITES that cause your
calls to drop, I'd suggest contacting their customer service and asking them why
they are being sent.

The provider actually sent you two INVITES in rapid succession with different
Call-IDs.  To keep this simple, I'll use the following shorthand:

  Call 1 = Call-ID 83de2b0c3faf0ef9@217.0.17.170
  Call 2 = Call-ID 248ef1b5553e5756490d6556573a1...@tel.t-online.de

Call 1 is terminated with a BYE from Asterisk immediately after it gets the ACK
from the provider.  The provider tried to terminate it immediately with its own
BYE, but it lost the race.  This results in the Call/Transaction Does Not Exist
message at the end of that dialog.

Call 2 is terminated with a BYE from the provider immediately after they ACK the
OK from Asterisk.

As I said above, I'd start out by asking the provider why they are sending these
INVITES in the first place.  Here is the simple timeline derived from your SIP
trace that I worked from:

  Call 1  Call 2
  

  13:37:54.240304
INVITE From Provider to Asterisk

  13:37:54.240497
INVITE From Provider to Asterisk

  13:37:54.240593
Trying From Asterisk to Provider

  13:37:54.240752
OK From Asterisk to Provider

  13:37:54.240976
Trying From Asterisk to Provider

  13:37:54.241172
OK From Asterisk to Provider

  13:37:54.282723
ACK From Provider to Asterisk

  13:37:54.286434
BYE From Provider to Asterisk

  13:37:54.286700
OK From Asterisk to Provider

  13:37:54.339838
OK From Asterisk to Provider

  13:37:54.384756
ACK From Provider to Asterisk

  13:37:54.385007
BYE From Asterisk to Provider

  13:37:54.388625
BYE From Provider to Asterisk

  13:37:54.388816
OK From Asterisk to Provider

  13:37:54.404027
Call/Transaction Does Not Exist From
Provider to Asterisk

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


Re: [asterisk-users] Diagnosing call problem

2013-03-21 Thread Matthew J. Roth
Mitch Claborn wrote:
 
 Thank you for that most excellent post.  I had guessed at most of the 
 SDP fields and meaning.

No problem.  I actually like looking at SIP traces for some reason.

 I have wireshark traces from the client and the RTP packets are not in 
 the trace, which I think means that the client software is simply not 
 producing them.  I have opened a ticket with SFL phone support and will 
 post here if I find anything.

That's a reasonable conclusion.  Just make sure that you get some traces of good
calls to verify that your tests are valid.

 I did test the muted microphone theory.  SFLphone continues to send 
 RTP packets even when the mic is muted, so that doesn't seem to be the 
 cause.

It's always a good idea to rule out PEBKAC before spending a lot of time
diagnosing a problem.

 I've also compared the call initiation SIP and SDP packets between a 
 call that fails and one that works correctly.  I can discern no 
 difference other than things like port numbers and call IDs.
 
 Tomorrow I'll be trying one of my agents on Bria instead of SFL - maybe 
 that will make a difference.

It really seems like it may be a problem with the softphone.  I'm sure the
developers of SFLphone will appreciate your feedback, because not sending RTP is
a pretty serious bug.

I'll keep an eye on this thread and help out if I can.

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


Re: [asterisk-users] Diagnosing call problem

2013-03-20 Thread Matthew J. Roth
Mitch Claborn wrote: 

 Where is a good place to find documentation on the various fields in the
 INVITE SIP message and the response? I'd like to dig into them and try
 to understand them more completely.


For the SIP headers:

  http://en.wikipedia.org/wiki/Session_Initiation_Protocol
  http://www.ietf.org/rfc/rfc3261.txt

For the SDP content:

  http://en.wikipedia.org/wiki/Session_Description_Protocol
  http://www.ietf.org/rfc/rfc4566.txt

Don't forget that SIP is a request-response protocol.  The server sends an
INVITE with SDP describing the media session on its end (RTP IP and port, codec,
etc.) but that only gives you half of the picture.  The client returns an OK
with SDP describing its side of the media session.  You have to look at both to
determine if the call was negotiated properly.

To start, I'm going to strip down one of the SIP traces you sent so it's not
overwhelming:

  INVITE from Asterisk server (172.16.0.245) to client (172.16.0.71)

  c=IN IP4 172.16.0.245
  m=audio 13428 RTP/AVP 0 8 101
  a=rtpmap:0 PCMU/8000
  a=rtpmap:8 PCMA/8000
  a=rtpmap:101 telephone-event/8000
  a=sendrecv

This says that the Asterisk server's RTP for the call will be at 172.16.0.245
(from the c= line) port 13428 (from the m= line), the allowed codecs are u-law
(0 PCMU), a-law (8 PCMA), and DTMF (101 telephone-event) (from the m= and a=
lines), and Asterisk will both send and receive packets.  Note that this is the
port (13428) that must be within the range defined in rtp.conf.  The port
returned in the client's OK is specific to the client and Asterisk has no
control over it.  Speaking of the client's OK:

  OK from client (172.16.0.71) to Asterisk server (172.16.0.245)

  c=IN IP4 172.16.0.71
  m=audio 39408 RTP/AVP 0
  a=rtpmap:0 PCMU/8000
  a=sendrecv
  a=rtpmap:101 telephone-event/8000

This says that the client's RTP for the call will be at 172.16.0.71 (from the c=
line) port 39408 (from the m= line), the allowed codec is u-law (0 PCMU) (from
the m= and a= lines), and the client will both send and receive packets.  There
is also a stray a= line describing DTMF, but its payload type (101) isn't listed
on the m= line.  I may be wrong, but that seems broken to me.  I don't think it
would cause the audio issues you're describing, but it's something you could
ask SFLphone support about.

So the IPs and ports are agreed on (Asterisk = 172.16.0.245:13428, client =
172.16.0.71:39408), both endpoints share an allowed codec (u-law), and they're
both ready to send and receive packets.  The good news is that the call should
work.  The bad news is it doesn't.  The RTCP information you posted bears this
out:

   Fraction lost: 254 / 256
   Cumulative number of packets lost: 37134
   Extended highest sequence number received: 37331

Over 99% of the packets are lost, so the call is setup fine but something is
getting in the way of the RTP.  Your first post said:

  Occasionally an agent will get a call (or more often a series of
  calls in a row) where neither party can hear the other,
  or can only hear each other sporadically.  A MixMonitor
  recording of the call plays only the caller - none of the
  agent's audio is  heard in the recording.

This means that the agent's RTP never makes it to the Asterisk process.  I
doubt it's even making it to the server, but you could prove it by running:

  # tcpdump -s 0 -A host 172.16.0.71 and portrange 1-65535

at the Linux command line during a bad call.  If you only see packets going
to the client that takes your Asterisk configuration out of the equation.
Then you have to start tracing it back to the client.  First rule out the
firewall on the Asterisk server, then the cable to the switch, then the
switch, then the cable to the client, then the client's firewall, then the
softphone on the client.  Something on that path has to be stopping (or not
producing) the agent's RTP.

Don't forget the simple stuff either.  It could be something like the agent
putting their microphone on mute.

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


Re: [asterisk-users] DIDForSale spam

2013-01-10 Thread Matthew J. Roth
Jai Rangi wrote:

 I am sure we all get lots if spam emails every day.

Yes, I do.  Now ask yourself why I was able to immediately identify
where my address was harvested from for this particular piece of spam.
The answer has to do with DIDForSale's business practices as observed
on the Asterisk lists for many years.

From November 2008:

  Spam from DIDForSale contact-sales at didforsale.com
  http://lists.digium.com/pipermail/asterisk-users/2008-November/221335.html

 If you really got some time and talent, why don't you write some
 good tips and tricks about asterisk.

Don't shoot the messenger.

 Long story short We have a link where you can unsubscribe your email
 for any further communication.
 http://www.didforsale.com/unsubscribe.php or Send me your email
 address I will personally take care of that and will remove your
 email.

You already have all of our addresses.  Please unsubscribe us.

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


Re: [asterisk-users] Verizon SIP trunking Field Trial

2013-01-04 Thread Matthew J. Roth
 Carlos Alvarez wrote:

 Sounds like the same huge effort it takes to work with Qwest/
 Centurylink, and in the long run we found it simply isn't worth it.
 The few benefits of working with an RBOC are countered by the many
 drawbacks of working with an RBOC.
 
 Also we recently acquired a half million minutes/mo from a company who
 was tired of dealing with Qwest SIP.  They said the same thing I said
 above.
 
 I suppose the point of what I'm saying is you should really think
 about what you think you will gain from a relationship with them, and
 whether all this is worth it (all this means now and how their
 attitude will affect you forever).
 
 
 Eric Wieling wrote:
 
 Trust me, Verizon doesn't really provide support.What they will
 do is tell you something different (often conflicting stuff) when you
 send in a ticket.One time they tell us the From must be in e.164
 format, other times they say it does not.We asked for an updated
 Interop guide weeks ago and they have not provided us anything.  We
 have been with VZ SIP for years so I wanted an updated interop guide
 so we can point them to it when they tell us something which
 conflicts with their docs.  Don't get me started on trying to upgrade
 our service with them..


Michael,

At least Verizon maintains a consistent customer experience.  ; )

Overall, we've found the service to be reliable and stable, but when
there are problems or changes needed you're dealing with Verizon and the
w...h...e...e...l...s..t...u...r...n..s...l...o...w...l...y.

It's a trade-off of dealing with such a huge company and I don't have
experience with any other SIP trunk providers to compare it to, so give
proper consideration to the opinions of the other members of this list.

Just know that as you weigh your options, Verizon will work in the end
but this whole field trial process is your preview of all future
dealings with them.  It can make you question your sanity but so far
everything you've said has been spot-on.

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


Re: [asterisk-users] Verizon SIP trunking Field Trial

2013-01-03 Thread Matthew J. Roth
Michael L. Young wrote:

 I should have probably stated that this is going to be going through
 an MPLS network being setup with Verizon.  They may not be requiring
 that since it is within their network, not going over the internet.
 They have not said anything about the the need to secure the traffic
 coming from them or to them since the VoIP traffic will be on
 Verizon's network.


Michael,

Your email documents the same experience we had years ago.  It was
strange reading it and I was shocked that nothing has changed in that
much time.  Asterisk will work with Verizon's IP trunking product, but
they're trying to make you jump through some old hoops first.

We were using Verizon IP trunks over an MPLS network in 2008.  At the
time, they did not require IPSEC for signaling.  However, they did
want us to install an SBC and actually provided us with an AudioCodes
nCite 1000 at their cost.  It just acted as a proxy, so it didn't
affect interoperability with Verizon's IP trunks and I wouldn't
buy one only to satisfy them.

We were quite happy with the service, so I'd encourage you to go ahead
with the field trial without putting an SBC in place.  Remember that
you will be paying them, so they should be working to fit your design
and if they reject you for some arcane reason then you are better off
with another provider anyway.

Don't hesitate to let them know that you know you're jumping through
the same hoops that have been in place since 2008 and you'd appreciate
it if they would streamline the process to save time and money.  Tell
them that Asterisk should already be on their certified list of
approved devices because they've been running field trials and
production setups on it for years.

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


Re: [asterisk-users] Audio feedback - where to troubleshoot?

2012-12-07 Thread Matthew J. Roth
Justin Sherrill wrote:

 We occasionally get a sort of feedback/echo noise on our phones
 here.  (Polycom IP550 / Asterisk 1.8).  It lasts for about a second,
 and it's described by users as 'jingle bells'.

That's very appropriate for the season.  I just hope they're not
Todash Chimes.  ; )

 It happens when people are using the speakerphone, especially when
 it's on both ends.  It happens on internal calls, so it's not
 something from the PSTN.
 
 My theory is that the very sensitive speakerphone microphones in
 those models are picking up small noises, and then picking up their
 own playback of the noise, which leads to the feedback sound.  It
 repeats, which is why it sounds like an echo.

Your theory sounds correct to me.  You've described acoustic echo and
that is the most prevalent type for internal VoIP calls.

 I think turning rxgain/txgain down may make a difference, but I
 haven't tried it yet.  Has anyone else experienced something
 similar?  

I believe rxgain and txgain only apply to DAHDI channels.  The first
thing I would try is reducing the speakerphone volume settings on the
Polycom IP550s.

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


Re: [asterisk-users] SIP Debugging Information..

2012-11-27 Thread Matthew J. Roth
Michael L. Young wrote:

 If I am reading this right, it looks like a BYE is coming in from
 the far end, Bandwidth.com.


Prior to that, Asterisk retransmits the OK to Bandwidth.com's INVITE
twice.  It doesn't look like Bandwidth.com receives any of them,
because they never respond with an ACK.  Since, from Bandwidth.com's
perspective, the call is never setup, they terminate it with a BYE.

It could just be a NAT issue, but there are two things I really don't
understand about the SIP dialog:

1) It starts with an ACK from Bandwidth.com.  Is it possible that
   the debugging output is missing the beginning of the dialog?

2) Every timestamp is Nov 23 15:43:13.  I don't think the SIP
   session timers on either end should be expiring quickly enough
   for this to happen.

Do other calls originating from Bandwidth.com work properly?  If so,
comparing the SIP from a working call to a failed call may be
revealing.

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


Re: [asterisk-users] the lenght of the uri affects on dialplan?

2012-08-27 Thread Matthew J. Roth
Rafael Visser wrote:

 I replaced for the following sip.conf

 [general] 
 context=default ; Default context for incoming calls 
 allowguest=no ; Allow or reject guest calls -sin password- (default is yes) 
 allowoverlap=no ; Disable overlap dialing support. (Default is yes) 
 udpbindaddr=0.0.0.0 ; IP address to bind UDP listen socket to (0.0.0.0 binds 
 to all) 
 tcpenable=yes ; Enable server for incoming TCP connections (default is no) 
 tcpbindaddr=0.0.0.0 ; IP address for TCP server to bind to (0.0.0.0 binds to 
 all interfaces) 
 srvlookup=yes ; Enable DNS SRV lookups on outbound calls 
 relaxdtmf=yes 
 dtmfmode=inband 
 ;rfc2833compensate=yes 

 [sip.ericsson] 
 ;cambios allowguest hosts 
 allowguest=no ; Allow or reject guest calls -sin password- (default is yes) 
 type=friend 
 calllimit=200 
 fromuser=ivr1 
 dtmfmode=inband 
 username=administrador 
 context=incoming-sip-ericsson 
 host=10.146.9.70 
 host=ericsson 
 host=MSSASU1.MYDOMAIN.COM.PY 
 port=5060 
 disallow=all 
 allow=alaw 
 allow=gsm 
 allow=ulaw 
 qualify=yes 
 insecure=no


 Debug with long hostname (B is considered as an '*') 
  
 --- SIP read from TCP:10.146.9.70:6240 --- 
 ...
 No matching peer for '971200152' from '10.146.9.70:6240' 

 Short hostname on switch 
 === 
 --- SIP read from UDP:10.146.9.70:5060 --- 
 ...
 Found peer 'sip.ericsson' for '971200152' from 10.146.9.70:5060 


The device sending SIP is using a different protocol (TCP vs. UDP) and
port (6240 vs. 5060) in your two examples.  You have Asterisk
configured to listen for UDP and TCP connections, so the protocol
isn't the problem.

However, the first example fails to find a matching peer because the
sip.ericsson SIP entity is defined with port=5060 and
insecure=no.  Try changing the insecure option to insecure=port.
This should resolve your problem by allowing the peer to be matched
by IP address regardless of the port number.

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


Re: [asterisk-users] Upgrade from version 1.6.24 to 1.8.12 - Retransmission timeout error

2012-05-30 Thread Matthew J. Roth
Administrator TOOTAI wrote:

 10.0.70.12 is the IP of Asterisk server (kvm virtual machine) which is 
 replaced by externaddr parameter from sip.conf.
 
 If you have other ideas, welcome ;-)


Considering that you made progress on your initial problem by setting
nat=force_rport (resulting in connected calls with no audio) and now
you're mentioning the use of externaddr, I'd recommend a very
careful reading of the NAT SUPPORT section of sip.conf.sample in the
configs directory of the Asterisk source tree.  In Asterisk 1.8, there
is a new configuration option named media_address which may be of
particular interest.

This is confusing because your first email said you had nat=no in
your working 1.6.24 setup, but everything you're saying indicates a
NAT problem to me.  A diagram showing all network elements between
your Asterisk server and the remote host would be helpful.  To avoid
further confusion, please include full and unaltered logs, SIP traces,
and configurations in future posts.

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


Re: [asterisk-users] Upgrade from version 1.6.24 to 1.8.12 - Retransmission timeout error

2012-05-29 Thread Matthew J. Roth
Administrator TOOTAI wrote:

 We tested this setting this WE, effectively this problem disappear but 
 another appears: call get connected but no audio. We installed Asterisk 
 10.3.1 - connection and no audio too, so same behaviour.
 
 We did read those files, don't see which parameter we could have forget. 
 media_address nor nat=comedia seems options for us. Hereunder a debug 
 from call with force_rport: as you can see, the RTP audio is coming from 
 another IP (77.77.777.77) We think asterisk doesn't accept this and 
 don't know which parameter could solve this.


Daniel,

Asterisk is fine with RTP coming from another IP.  It used to work for
you on 1.6.24.  Here are the relevant bits from the 200 OK
responses:

  1.6.24 - o=CARRIER 1338135052 1338135052 IN IP4 77.72.168.74
   c=IN IP4 77.72.168.74
  1.8.12 - o=CARRIER 1338276550 1338276550 IN IP4 77.77.777.77
   c=IN IP4 77.77.777.77

Is that really the response that you received?  77.77.777.77 is not a
valid IP address (the 3rd octet is greater than 255), so if that's
what you're getting than your configuration is fine and the remote
end (or some proxy) is now the problem.

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


Re: [asterisk-users] Upgrade from version 1.6.24 to 1.8.12 - Retransmission timeout error

2012-05-28 Thread Matthew J. Roth
Administrator TOOTAI wrote:

 we are upgrading our Asterisk production server from 1.6.24 to 1.8.12
 version and face the following problem: one of our peer
 (voicetrading.com) doesn't accept our calls anymore, we receive a
 timeout error Packet timed out after 32000ms with no response.
 
 Switching back to 1.6 make things working again!
 
 In sip.conf we have nat=no, peer conf is:


Asterisk 1.8.12 is not getting responses to the INVITES it sends.
Comparing the INVITES, the only significant difference I see is that
Asterisk 1.6.24 includes the rport field in the Via header and
Asterisk 1.8.12 does not:

  1.6.24 - Via: SIP/2.0/UDP 222.222.22.22:5060;branch=z9hG4bK58aef527;rport
  1.8.12 - Via: SIP/2.0/UDP 222.222.22.22:5060;branch=z9hG4bK0c8907be

Try setting nat=force_rport in sip.conf.  Please reply back to the
list with the results.

There may be other differences between the versions that you haven't
accounted for.  Read the CHANGES and UPGRADE.txt files in the root of
the Asterisk source tree for details.

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] Open source replacement for AudioCodes nCite 1000 SBC

2012-04-25 Thread Matthew J. Roth
List users,

I have an AudioCodes nCite 1000 SBC that is end-of-life and I'm
looking to replace it with open source software.  I believe one of the
SIP proxy projects will fit my needs, but I'm a bit overwhelmed by
the number of choices and I'd like the advice of experienced users
before I venture too far down any one path.

The projects that came to mind first were Kamailio, OpenSIPS, SER, and
SIP-Router, but I'm aware that there are others and I'm open to
suggestions.  Please keep in mind that I'm looking for something
reasonably easy to setup and administer.  I'm not looking to have it
setup tomorrow, but it must be something that a single skilled
Linux/Asterisk administrator could take on in addition to other daily
tasks.

The functionality that I'm currently using on the nCite 1000 is:

  SIP Proxy/B2BUA and RTP Proxy
* Internal call routing (private IP-to-private IP)
* External call routing (external IP-to-private IP and vice versa)
  with topology hiding
* SIP header modification
* Digit manipulation (delete digits/add prefixes based on matching
  criteria)

  Connectivity
* NAT traversal
* External registrations (registration bindings are maintained and
  ports on the far end firewall are kept open)

  Authentication
* By source IP address or range
* By destination SIP proxy

  Session Targets and Session Target Sets
* Individual SIP entities (e.g. Asterisk servers, SIP trunks) are
  defined as session targets
* Session targets are grouped into sets with call distribution based
  on priorities/weights

  Call Routing
* Static Binding: All calls to an inbound SIP proxy are routed to
  the same session target set via the same outbound SIP proxy
* Dial Pattern: All calls to an inbound SIP proxy are routed to
  different session target sets via different outbound SIP proxies
  based on dial patterns

  Future Considerations
* TLS/SRTP support

Thank you,

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


Re: [asterisk-users] sox: Failed reading obd-demo.mp3: Do not understand format type: mp3

2011-09-13 Thread Matthew J. Roth
Kaushal,

Your version of SoX does not have MP3 support.  Since you have LAME
installed, use it as a first step to produce an intermediate file
that SoX supports.  Then use SoX to convert the intermediate file
to the desired format.

Step 1
--

# lame --decode obd-demo.mp3 obd-demo.wav
input:  obd-demo.mp3  (8 kHz, 1 channel, MPEG-2.5 Layer III)
output: obd-demo.wav  (16 bit, Microsoft WAVE)
skipping initial 1105 samples (encoder+decoder delay)
Frame# 16818/16818   16 kbps
# file obd-demo.wav
obd-demo.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, 
mono 8000 Hz


Step 2
--

# sox -V obd-demo.wav -r 8000 -b -t ul -c 1 obd-demo.ulaw
sox: Detected file format type: wav

sox: WAV Chunk fmt
sox: WAV Chunk data
sox: Reading Wave file: Microsoft PCM format, 1 channel, 8000 samp/sec
sox: 16000 byte/sec, 2 block align, 16 bits/samp, 19372126 data bytes
sox: 9686063 Samps/chans
sox: Input file obd-demo.wav: using sample rate 8000
size shorts, encoding signed (2's complement), 1 channel
sox: Output file obd-demo.ulaw: using sample rate 8000
size bytes, encoding u-law, 1 channel
sox: Output file: comment Processed by SoX


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


Re: [asterisk-users] Securing Asterisk

2011-07-27 Thread Matthew J. Roth
CDR wrote:
 
 The point is that a minor change in the code would have a dramatic
 effect on security, and carry a lower impact on CPU that using
 Iptables. The simplicity of the change cannot understated.


You're in luck.  Since Asterisk is open source, you can make the
unbelievably simple change yourself.  If you make it configurable and
default it to no (so as not to break backwards compatibility, not to
mention RFC compliance), it may even get accepted into Asterisk so
that you won't have to maintain your own patchset.

This feature would actually be a bit like alwaysauthreject in that
it breaks RFC compliance for the sake of security, so it's not a
completely lost cause.  However, pining away on a mailing list about
how simple the work would be instead of doing it yourself is.

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


Re: [asterisk-users] a=sendonly Music On Hold ignored

2011-07-22 Thread Matthew J. Roth
Michael,

It looks like your problem is caused by a phone with a non-standard
SDP session version implementation.  The phone is sending an INVITE
with SDP that contains an a=sendonly line.  Asterisk should respond
with an OK that contains an a=recvonly line, but it responds with
a=sendrecv instead.

Asterisk is probably ignoring the SDP in the INVITE, because the phone
never updates the SDP session version.  It remains at 0 throughout the
entire dialog:

 o=  usernamesess-id sess-version  nettype  addrtype  addr
 --  --    ---    -
 o=  500 109600  0 IN   IP4   192.168.1.109
 o=  500 109601  0 IN   IP4   192.168.1.109
 o=  500 109600  0 IN   IP4   192.168.1.109

Luckily, there is an option to force Asterisk to ignore the SDP
session version number and treat all SDP data as new data.  Try adding
ignoresdpversion=yes to the phone's configuration in sip.conf.

For the sake of future list readers, please respond to this post with
[RESOLVED] appended to the subject line if this fixes your problem.

 That's what I get: 
 [root@pbx ~]# asterisk -rx 'module show' | egrep 
 'format_g729.so|format_pcm.so' 
 format_pcm.so Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU), G. 0 
 format_g729.so Raw G729 data 0 
 
 What does the 5 (or in my case 0) stand for? 

It's the Use Count, but I'm not certain how to interpret it.  On one
of my servers chan_sip.so has a use count of 110451 and rising.  That
seems like it should indicate some sort of leak, but Asterisk has been
running continuously for over half a year without any problems.

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


Re: [asterisk-users] 10.0.0 better than 2.0.0?

2011-07-22 Thread Matthew J. Roth
Kevin P. Fleming: The versions all go to ten. Look, right across the
board, ten, ten, ten and...

Asterisk Users: Oh, I see. And most open source projects upgrade to
two?

Kevin P. Fleming: Exactly.

Asterisk Users: Does that mean it's better? Is it any better?

Kevin P. Fleming: Well, it's eight better, isn't it? It's not two. You
see, most blokes, you know, will be running at two. You're on two
here, all the way up, all the way up, all the way up, you're on two on
your software. Where can you go from there? Where?

Asterisk Users: I don't know.

Kevin P. Fleming: Nowhere. Exactly. What we do is, if we need that
extra push over the cliff, you know what we do?

Asterisk Users: Put it up to ten.

Kevin P. Fleming: Ten. Exactly. Eight better.

Asterisk Users: Why don't you just make two better and make two be the
top number and make that a little better?

Kevin P. Fleming: [pause] Asterisk goes to ten.

--

Sorry, couldn't resist.

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


Re: [asterisk-users] a=sendonly Music On Hold ignored

2011-07-19 Thread Matthew J. Roth
Michael, 

Here are the differences between the systems that I determined from the two SIP 
traces: 

* Working system: no NAT, phone codec: G.729, Asterisk codec: G.729 
* Non-working system: NAT, phone codec: G.729, Asterisk codec: A-law 

Does the conversation have two-way audio prior to the hold? If it doesn't, your 
problem may be caused by NAT and/or codec transcoding. NAT is notorious for 
causing one-way audio and transcoding G.729 requires a commercial license from 
Digium. 

After those two possible causes are ruled out, the only other thing that I can 
think of is a missing format translation path for the music-on-hold files. Does 
the AsteriskNOW system have modules loaded for both formats? I don't use either 
format, but I believe the required modules are format_g729.so and 
format_pcm.so. 

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

Re: [asterisk-users] a=sendonly Music On Hold ignored

2011-07-19 Thread Matthew J. Roth
Michael wrote: 
 
 True. In the working system, LAN calls are also using G.729, while
 in the non-working system, LAN calls are in G.711 (supported but
 not prioritized by the phones) and only the SIP trunk to the ITSP
 is set to G.729. 

Can you set the phone to G.711 and try making a LAN call on the non-
working system.  If a call that is G.711 from end-to-end doesn't have
the same problem it would be evidence of a codec translation issue.

 We tested with NAT set to no and yes and neither settings
 mattered. 

As long as the phone and the Asterisk server are both on the same LAN,
my recommendation would be to test with NAT set to no.  NAT is not
necessary unless there is a firewall between the phone and the
Asterisk server and setting it to no also eliminates a variable that
differentiates it from the working system.

 It should (have modules loaded for both formats). How do we check
 this? 

The following command should output a line for each module (as shown):

 # asterisk -rx 'module show' | egrep 'format_g729.so|format_pcm.so'
 format_pcm.so  Raw/Sun uLaw/ALaw 8KHz (PCM,PCMA,AU), G. 5
 format_g729.so Raw G729 data0

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


Re: [asterisk-users] Benchmarking AGI performance in C, PHP, and Perl

2011-07-12 Thread Matthew J. Roth
Steve Edwards wrote:
 Also they tend to be used more by 'non-programmers' who get away with 
 'stupid' stuff like calling out to system() and piping a bunch of 
 commands together because they don't know how to use the language 
 properly :)
 
 I'm not disparaging Perl programmers or the language. I'm just saying
 it is easier to 'abuse' a language like Perl or PHP than C.
 
 This Bash snippet was posted to the -users list a couple of years ago.
 I'm  not trying to embarrass the original programmer or trash his
 skills, I'm just using this snippet as an example. We've all got
 skeletons in our closets :)
 
 while read line; do
epoch=`echo $line | cut -d '|' -f 1`
if [ $epoch -ge $start_epoch -a $epoch -le $end_epoch ]; then
  echo $line
fi
 done  /var/log/asterisk/queue_log
 
 Note the second line. It creates a couple (2 or 3) of processes to
 extract the first field from the queue_log file. For every line in
 the input file!
 
 This kind of coding is easy in a scripting language. It would be way
 more difficult in C. So much more difficult, a programmer with the
 requisite skills to do it should recognize the inefficiency and do
 it another way.
 
 If the original programmer had a better grasp of the language, he
 could have coded this line as:
 
  epoch=${line:0:10}
 
 Since the Epoch will be 10 digits for the next 300 years, I'd feel 
 relatively comfortable with this solution.
 
 This single change reduced the execution time of his script by an
 order of magnitude.
 
 Recoding it in a language more appropriate to processing lots of data 
 (like C) would reduce the execution time to 1/3,000th of the original. And 
 yes, I did it and measured it.
 
 A skilled programmer (like any craftsman) has many tools in his toolbox, 
 the experience to choose the right one, and the skill to use it well.
 
 C is my sharpest tool so I tend to see everything through that lens, but 
 I'm learning to appreciate PHP and how it lets me represent some 
 programming problems clearly, quickly and sufficiently efficient.


Steve,

I recognized the code you posted.  It's mine:

http://lists.digium.com/pipermail/asterisk-users/2009-September/237750.html

Thank goodness you didn't try to embarrass me.  You just used my code as an
example of how a non-programmer would use a language, called piping commands
together stupid and an indication of not knowing how to use the language,
referred to it as a skeleton in my closet and something that a programmer
with the requisites skills and a better grasp of the language wouldn't do.

I guess I am just not a skilled enough programmer to try to help someone out
on this list without getting criticized by you at the time

http://lists.digium.com/pipermail/asterisk-users/2009-September/237755.html

and again almost two years later.

Maybe, just maybe, it's possible that some people recognize that your crusade
to replace all scripting with compiled C has its virtues, but it's not worth
their programming time to save a few seconds of execution time.  You've been
at this for years and yet scripting languages still exist.

Just think how fast Linux would boot if all of the init scripts were
rewritten in C and compiled (they probably have some pipes that could be
removed, too!!).  Of course, it's pretty nice to be able to easily read and
modify them, but execution time is all that's important, right?

Your example reduced the execution time of my script by a factor of 2,700!!
That's great, but do you really think if I posted C source code as a response
(I could if I wanted to) to the original poster that she would have had any
idea what to do with it?  I'd wager that she'd spend more than the minute and
a half your optimization saved pondering it before responding, What do I do
with this?  Instead, she copy-and-pasted my code, ran it, said thanks (can
you believe she didn't even mention that pipe I used!!), and went on to the
next thing.  So which is really more efficient?

Not to mention that your optimization is technically incorrect because it
assumes the field is a fixed length.  I'll admit, it's a valid assumption,
but we're arguing technicalities here.  I wonder if you'll be able to admit
that sometimes optimizing a one-off script just isn't worth it?

My code also has the benefit of being self-documenting.  Anyone can look at
it and understand exactly what it does (quite useful for a mailing list, 
don't you think?).  On the other hand, most people will be headed straight
to the Advanced Bash Scripting Guide when they see epoch=${line:0:10}.

I haven't posted here in a long time and I usually make it a policy not to
get involved in or start any flame wars.  Furthermore, I've always thought
that your posts are intelligent and show a real understanding of the subject
matter and a technical prowess.  But you're out of line using other people's
code as examples of bad programming techniques.  Unless my code is in a
directory on your desktop labeled Bad (but in NO Way 

Re: [asterisk-users] Benchmarking AGI performance in C, PHP, and Perl

2011-07-12 Thread Matthew J. Roth
Tzafrir Cohen wrote:
 
 Well, there are a number of separate optimizations in systemd:
 
 1. Delayed loading of services (or even not loading them at all, if not
needed. E.g.: don't load CUPS if nobody needs it.
 
 2. Paralelized loading of services (though there have been other
implemtnations of that. SuSE has had that for years: insserv).
 
 3. Rewriting some scripts in C. Also note that udev has been going
through this for quite some time as well.
 
 4. A nice facility to get the timing information and show where the
actual bottlenecks are.


Tzafrir,

I kind of suspected that the init scripts weren't a great example because
of systemd.  It's already in Fedora 15, but I have to plead ignorance to
its implementation.  I thought it still used text-based service files, but
I'm only familiar with it from reading the large number of posts it has
generated on the Fedora users list.  That's actually started to settle
down and Gnome 3 has emerged as the new whipping boy.  Since systemd
has been proposed as a dependency of Gnome 3, this has the potential to
create singularity that will destroy the universe.  ; )

Personally, I'm not really excited about any of the optimizations that you
listed.  I can manage which services are started and the Linux boot
sequence is pretty fast already.  It's far quicker than the serial
initialization of hardware that our servers go through at each boot.  So
for my use case, it can still be cited as an example of optimizing the
wrong thing.  In the long run, it's likely to save me very little time
compared to the amount of time spent learning the new system.  I'm sure it
has its benefits and I'll come to appreciate them over time, but SysV init
ain't broke (for me) so I'm not looking forward to fixing it.

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


Re: [asterisk-users] Benchmarking AGI performance in C, PHP, and Perl

2011-07-12 Thread Matthew J. Roth
Steve,

Apology accepted.  As I said in the original post, I hold you in high 
regard so your criticism was hard to take.  I still think that the trade-
off between readability and optimization is up for debate, but it's
certainly nothing to hold a grudge over.

I can tell you one thing for certain:  I will think of you and that Bash
substring-extraction construct every time I even consider piping
something to cut.  I might even remember that particular syntax without
resorting to the ABS.  I'm not making any promises about the others,
though.  Some of them are just nasty.  ; )

http://tldp.org/LDP/abs/html/refcards.html#AEN22429

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


Re: [asterisk-users] Mirroring or other arangement to secure *

2010-09-09 Thread Matthew J. Roth
HB wrote:
 
 Please excuse me for addressing this Linux issue on this list, however I
 hope that some of you have found a solution thats matches the * use and
 also easy to install without very deep knowledge of Linux.
 
 My wish are a program that maintain a mirror copy of the HD.


http://en.wikipedia.org/wiki/Standard_RAID_levels#RAID_1

Be warned that this is not a replacement for regular backups, because all 
writes (including accidentally deleting your Asterisk configuration) are done 
to each disk in the array.

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


Re: [asterisk-users] colored CLI with reattach

2010-08-17 Thread Matthew J. Roth
Tilghman Lesher wrote:
 
 Eric Smith wrote:
 Using Asterisk 1.4.26.2
 I can get a nice colored CLI if I run asterisk -c
 
 But I cannot achieve this when I reattach to an existing instance
 (as i want to do) with asterisk -r.

 Is there a way to reattach and have color?
 
 Yes, but you'll need to upgrade to the latest 1.4 release. This also
 only works if you do not explicitly disable colors (-n) in the main
 daemon.

Eric,

You could also run the main Asterisk daemon within a screen 
http://www.manpagez.com/man/1/screen/ session.  It will require some changes 
to how Asterisk is started at boot, but they should be simpler and less prone 
to introducing any side effects than upgrading to the latest release.

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


Re: [asterisk-users] installing with yum

2010-08-13 Thread Matthew J. Roth
Albert Bonomo wrote:
 
 Well, I did tried using the source but couldn't make it work.
 some problem with dependencies and kernel version.
 It is really difficult to put all the stuff in order to make a source
 work.

Albert,

It's really not that difficult if your system is in decent shape.  
Unfortunately, from reading your posts on this subject in the Fedora users list 
http://lists.fedoraproject.org/pipermail/users/2010-August/380371.html, I 
know that you're working on a system that you didn't set up and it's a terrible 
mess.  As a matter of etiquette, this is information that you really should 
disclose to people when you ask them for help.

You need to fix the underlying problems before you attempt to go any further 
with that system.  You are trying to force your way through some serious 
issues, and I wouldn't trust any software that you manage to get installed via 
source or the package manager.  My suggestion is to start with a clean and 
fully updated install of CentOS.  If that's not possible, go with the most 
recent version of Fedora available, but be warned that it has a very short 
support cycle which isn't ideal for production servers.

You may experience some difficulty coming up to speed with Linux, but rest 
assured that Asterisk is not difficult to install from source if the right 
foundation is in place.  People will be willing and able to help you along the 
way if you're following a sensible path.

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


Re: [asterisk-users] Asterisk Gurus - What is your best Asterisk Queue Analyzer and Asterisk Log Analyzer program out there?

2010-07-28 Thread Matthew J. Roth
Leif Madsen wrote:
 
 I have a client using QueueMetrics and they seem to be fairly pleased
 with it.  Their response times on issues has been pretty good from
 what I can tell (I had the client communicate with them directly
 where necessary).
 
 Unless you build it yourself, I'm not sure there is any good + free
 queue metrics program. Queue's typically are a money generating 
 adventure and as such makes sense for this type of application to be a
 pay-for system.

Bruce,

I'll throw in another vote for QueueMetrics.  It's not free, but you get a lot 
of value for your money.  The application is solid and the developer is top 
notch.

Check out a demo at: http://queuemetrics.com/demosys.jsp

Or get a get a free temporary (30-day) license at: 
http://queuemetrics.com/sendDemoLicence.jsp

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


Re: [asterisk-users] PHP can't insert - Can someone please help

2010-07-11 Thread Matthew J. Roth
Bruce, 

These two links may be helpful to you: 

  PHP: SQL Injection - Manual 
http://www.php.net/manual/en/security.database.sql-injection.php 

  PHP: mysql_real_escape_string - Manual 
http://www.php.net/manual/en/function.mysql-real-escape-string.php 

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] SIP Witch

2010-06-09 Thread Matthew J. Roth
Is anyone out there using SIP Witch in conjunction with Asterisk?  It claims to 
be able to enhance existing IP-PBX solutions such as Asterisk, so maybe it 
can be used as a simple means to provide secure/encrypted calls.

GNU SIP Witch - Summary http://savannah.gnu.org/projects/sipwitch
GNU SIP Witch - GNU Telephony 
http://www.gnutelephony.org/index.php/GNU_SIP_Witch
Features/SIP Witch Domain Telephony 
http://fedoraproject.org/wiki/Features/SIP_Witch_Domain_Telephony
Secure VoIP, GNU SIP Witch, and replacing Skype with free software
http://www.linuxtoday.com/it_management/2009082702235OSNT

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


Re: [asterisk-users] SIP Witch

2010-06-09 Thread Matthew J. Roth
 Matthew J. Roth wrote:
 
 Is anyone out there using SIP Witch in conjunction with Asterisk? It
 claims to be able to enhance existing IP-PBX solutions such as
 Asterisk, so maybe it can be used as a simple means to provide
 secure/encrypted calls.
 
 GNU SIP Witch - Summary http://savannah.gnu.org/projects/sipwitch
 GNU SIP Witch - GNU Telephony
 http://www.gnutelephony.org/index.php/GNU_SIP_Witch Features/SIP Witch
 Domain Telephony
 http://fedoraproject.org/wiki/Features/SIP_Witch_Domain_Telephony
 Secure VoIP, GNU SIP Witch, and replacing Skype with free software
 http://www.linuxtoday.com/it_management/2009082702235OSNT
 
 
 Michelle Dupuis wrote:
 
 I checked out the sites and can't figure out what this thing is!
 (Without delving into the documentation).

Michelle,

It was a bit unclear to me, as well.  That's why I was curious if anyone was 
actually using it.

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


Re: [asterisk-users] Queue_logs

2009-09-13 Thread Matthew J. Roth
Maria Cristina Bayno wrote:
 I'm here again and need your help. Regarding Queue logs in asterisk, 
 do anyone knows how can I get all the logs for the specific/particular 
 date? Example is I want to get all the logs from September 9-12?



Maria,

Here's a Bash script that will do what you're looking for.  If you 
redirect the output to a file it will only contain the queue_log records 
in the date range from start_epoch to end_epoch.  Note that it may take 
a while to complete, depending on the size of your queue_log.

--- Start getdates_ql 
--
#!/bin/bash

start_epoch=`date -d 'Sep 9 2009 00:00:00' +'%s'`
end_epoch=`date -d 'Sep 12 2009 23:59:59' +'%s'`

while read line; do
epoch=`echo $line | cut -d '|' -f 1`

if [ $epoch -ge $start_epoch -a $epoch -le $end_epoch ]; then
  echo $line
fi
done  /var/log/asterisk/queue_log

exit 0

--- End getdates_ql 


Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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

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


Re: [asterisk-users] Help with asterisk core dump

2009-06-08 Thread Matthew J. Roth
Miguel Molina wrote:
 I recently upgraded a production machine to asterisk 1.4.25. It seems 
 quite stable but after ~5 days of normal operation it core dumped with 
 this result:

 (gdb) bt
 #0  0x00516402 in __kernel_vsyscall ()
 #1  0x005b3d20 in raise () from /lib/libc.so.6
 #2  0x005b5631 in abort () from /lib/libc.so.6
 #3  0x005ebe6b in __libc_message () from /lib/libc.so.6
 #4  0x005f3b16 in _int_free () from /lib/libc.so.6
 #5  0x005f7070 in free () from /lib/libc.so.6
 #6  0x005e2876 in fclose@@GLIBC_2.1 () from /lib/libc.so.6
 #7  0x0809eb2a in filestream_destructor (arg=0xb1f0f200) at file.c:340
 #8  0x0806e412 in ao2_ref (user_data=0xb1f0f200, delta=-1) at astobj2.c:229
 #9  0x0809c1e9 in ast_closestream (f=0xb1f0f200) at file.c:902
 #10 0x00b03422 in local_ast_moh_stop (chan=0xb2150fd0) at 
 res_musiconhold.c:1058

 --- SNIP --- SNIP --- SNIP --- SNIP --- SNIP --- SNIP --- SNIP --- SNIP ---

 It looks like a very random situation, as this was not a high load moment.

 Also the asterisk log showed this message in the exact instant of the 
 failure:

 [Jun  8 13:21:13] ERROR[21601] astobj2.c: refcount -1 on object 0xb1f0f200

 I understand that a core dump generated by asterisk compiled with 
 (standard) optimized values is marked as useless information, but IMHO 
 it still helps to know what's failing inside it. I appreciate any input 
 about this, could be this a bug? A library problem? Or a server memory 
 problem?
Miguel,

It looks like you are running into an acknowledged bug.  There are open 
issues in the bug tracker for both the 1.4 and 1.6 branches:

  * https://issues.asterisk.org/view.php?id=15109
  * https://issues.asterisk.org/view.php?id=15195

Please create an account and add your information to the bug tracker.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] MeetMe echo problems with more than two participants

2008-12-15 Thread Matthew J. Roth
Alessandro Russo wrote:
 Unfortunately echo is not due to speakerphone. Each participant calls 
 a geographical number that is redirected from the PBX to a call 
 manager which pass the flow to the asterisk machine which creates a 
 meetme voice conference, so user calls via traditional either fixed or 
 mobile phone. Therefore they cannot mute their phone while they aren't 
 speak  :(
 Moreover the echo problem occurs when we do tests within the same 
 phone-cloud, in our organization phones are connected through some 
 cisco call managers, so when a phone calls the internal number ABCD 
 the flow arrives to the call manger which forward it to the asterisk, 
 this is the path done: phone = call manager = asterisk
 and also in internal cloud we experienced echo problems with more than 
 2 participants, not all the conversation is affected by echo, 
 sometimes there is echo and sometimes not.

 I performed the zttest and I obtained the following results:

 asterisk:~# zttest
 Opened pseudo zap interface, measuring accuracy...
 99.966690% 99.971863% 99.936729% 99.967766% 99.936913% 99.968163% 
 99.967667%
 99.936623% 99.969818% 99.937019% 99.967972% 99.937012% 99.968063% 
 99.967865% 99.936440%
 99.967766% 99.935356% 99.967667% 99.937401% 99.968460% 99.967667% 
 99.936333%
 --- Results after 22 passes ---
 Best: 99.972 -- Worst: 99.935 -- Average: 99.955330, Difference: 99.992836

Alessandro,

I'm sorry to hear that your problem isn't acoustic echo.  I'll be 
following this thread to see if anyone offers you any suggestions and 
I'll let you know if I discover anything that improves the echo problem 
in my installation.

What is the timing source in the conference server?  In general, it will 
be either a Zaptel/DAHDI hardware device or the ztdummy/dahdi-dummy 
module.  See this page 
http://www.voip-info.org/wiki/view/Asterisk+timer for details.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] MeetMe echo problems with more than two participants

2008-12-12 Thread Matthew J. Roth
Alessandro Russo wrote:

 we are using Asterisk 1.4.18.1 http://1.4.18.1/ on debian 4.0 etch, 
 pwlib 1.10 and openh323 1.18.

 We are using MeetMe for conference calls and with two participants 
 there is no echo problems, but with more than two participants there 
 is a lot of echo that sometimes disappear for a short time and all 
 function well.

 Someone have some suggestions??

 Do you ever used app_conference 
 http://sourceforge.net/projects/appconference/  ??


Alessandro,

Are you certain that the echo isn't being introduced by someone on the 
conference using a speakerphone?  This would cause what is known as 
acoustic echo 
http://en.wikipedia.org/wiki/Echo_cancellation#Acoustic_echo and it's 
always my first suspect in a situation like the one you are describing.

This is not a problem that is specific to Asterisk and I'm fairly 
certain there is nothing that can be done within your configuration to 
correct it.  Instructing the conference participants to mute their 
phones when they aren't speaking or to use their handsets should reduce 
acoustic echo.  Some phones 
http://www.voip-info.org/wiki/view/Uni-Ta+Technology also claim to 
have a full-duplex speakerphone with advanced acoustic echo 
cancellation, but caveat emptor.

That said, I'm not an expert on echo cancellation and I have an 
installation where the users are making similar complaints about echo 
during conference calls.  I'd greatly appreciate it if anyone on the 
list corrected any misunderstandings that I might have on the subject.

As an aside, how is the timing on your conference server.  The MeetMe 
application relies on it to mix the audio in conferences.  You should 
get at least 99.98% output from zttest (as shown below) or the audio 
quality will suffer.  This is an overall quality issue and is not 
necessarily related to your echo problems.

  [r...@astconf ~]# zttest
  Opened pseudo zap interface, measuring accuracy...
  99.999413% 99.995407% 99.995499% 99.998047% 99.996483% 99.997849% 
99.999008%
  ...
  --- Results after 107 passes ---
  Best: 100.000 -- Worst: 99.995 -- Average: 99.997687, Difference: 
99.997815

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Call Recording - Asterisk

2008-12-08 Thread Matthew J. Roth
Chris Rowson wrote:

 I wanted to setup Oreka to monitor calls on a trixbox box I have
 setup. Oreka doesn't seem to be catching all of the calls
 though I have port mirroring setup on the port that trixbox is
 connected to, mirrored to the port Oreka is connected to.

 I have read that Asterisk doesn't work as a SIP Proxy, so I
 wondered if this meant that some phones, after checking in with
 Asterisk would simply communicate via RTP between each other,
 without going media transport going through trixbox itself? If
 this is the case then I guess I'd need to mirror the full VoIP
 VLAN to the Oreka port wouldn't I? Or is there another reason that
 I'm missing here?


Chris,

Make sure that all of your SIP clients are set to canreinvite=no in 
sip.conf.  The default is canreinvite=yes, which allows RTP to 
bypass Asterisk.  Certain things (codec translation, playback of audio 
files, etc.) require Asterisk to be in the RTP path, which may explain 
why you're recording some of the calls.

If you're still missing calls, make sure Oreka is configured properly in 
config.xml.  In particular, the AllowedIpRanges and 
BlockedIpRanges settings provide IP address filtering at the Oreka 
level.  In general, I've had to configure these to prevent getting two 
recordings of each call (since Asterisk acts as a B2BUA) but your 
configuration may be too strict.

Running tcpdump/Wireshark on the Oreka server will let you see exactly 
what's being mirrored.  There is even a setting in Oreka named 
PcapFile that will let you playback the packet capture file over and 
over until you're satisfied with your configuration.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer




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

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


Re: [asterisk-users] How to escape DTMF?

2008-12-05 Thread Matthew J. Roth
Carsten Maass wrote:
 we are in the need to reach an external Conference-System, whos 
 numbering system is *2*. Unfortunately *2 is the featurecode for 
 attended transfer in our local asterisk, so the call doesn't come 
 through. Is there a way to somehow escape the featurecode, so we can 
 reach the external Conference?
Carsten,

Feature codes are configured in /etc/asterisk/features.conf.  In your 
case, you'll want to set:

  [featuremap]
  atxfer = *2   ; Attended transfer

to some other value.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer



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

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


Re: [asterisk-users] two sip listening ports for single asterisk

2008-11-20 Thread Matthew J. Roth
Mike wrote:
 I tried using this iptables sample, and did not see duplicate packets
 on '--to-ports' port

 Has some verified this is working for them?

 I listened on both ports with tcpdump command.

Mike,

I can confirm that it's working.  Admittedly, I never looked at the 
packets with tcpdump because this *just worked* for me.  Calls that were 
sent to both ports (5060 and 5062) made it to Asterisk which was only 
listening on port 5060.  What's your experience with actual calls?

As the original poster, I understand if you want third-party 
verification.  I *thought* this was a slamdunk but I'm not an iptables 
guru so I'd like it, too.

What does the output of iptables-save and lsmod look like?  Here's 
mine, trimmed for relevancy:

[EMAIL PROTECTED] ~]# iptables-save
# Generated by iptables-save v1.3.5 on Thu Nov 20 12:03:21 2008
*nat
:PREROUTING ACCEPT [5579:1727747]
:POSTROUTING ACCEPT [1943:176116]
:OUTPUT ACCEPT [1943:176116]
-A PREROUTING -i eth2 -p udp -m udp --dport 5062 -j REDIRECT --to-ports 5060
COMMIT
# Completed on Thu Nov 20 12:03:21 2008

[EMAIL PROTECTED] ~]# lsmod
Module  Size  Used by
ip_conntrack_netbios_ns36033  0
ipt_REDIRECT   35009  1
xt_tcpudp  36417  1
iptable_nat40773  1
ip_nat 53101  2 ipt_REDIRECT,iptable_nat
ip_conntrack   91237  3 
ip_conntrack_netbios_ns,iptable_nat,ip_nat
nfnetlink  40457  2 ip_nat,ip_conntrack
ip_tables  55329  1 iptable_nat
x_tables   50377  4 
ipt_REDIRECT,xt_tcpudp,iptable_nat,ip_tables

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] two sip listening ports for single asterisk

2008-11-18 Thread Matthew J. Roth
Rizwan Hisham wrote:
 Is it possible to make single asterisk server listen on two different 
 ports?


Rizwan,

There is no way to make a single instance of Asterisk listen on multiple 
ports.  However, you can use an iptables REDIRECT to achieve the same 
functionality.

To redirect a single port with iptables:

  iptables -t nat -A PREROUTING -i eth0 -p udp --dport 5062 -j REDIRECT 
--to-ports 5060

This example redirects UPD port 5062 to port 5060, which effectively 
allows Asterisk to listen on both of them.  Remember to save the rule so 
that it survives a reboot.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer



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

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


Re: [asterisk-users] Really destroying SIP dialog

2008-06-13 Thread Matthew J. Roth
c james wrote:
 I am trying to work in the console, figuring why it exits, but about 75% 
 is always taken up with
 Really destroying SIP dialog '' Method: OPTIONS

 Can anyone point me where I can stop this without turning down the 
 debugging/verbose on the entire console.

c james,

Your best option would be to address the source of the messages, but I 
know that's not always practical.  Here is a trivial patch that will 
only print the messages if verbosity is set to greater than 10.  Just 
apply it to 'channels/chan_sip.c' and rebuild Asterisk.

=== BEGIN PATCH 
--- chan_sip.c  2008-06-13 08:51:46.0 -0400
+++ chan_sip.c.patched  2008-06-13 08:56:37.0 -0400
@@ -3115,7 +3115,8 @@
struct sip_pkt *cp;

if (sip_debug_test_pvt(p) || option_debug  2)
-   ast_verbose(Really destroying SIP dialog '%s' Method: 
%s\n, p-callid, sip_methods[p-method].text);
+   if (option_verbose  10)
+   ast_verbose(VERBOSE_PREFIX_4 Really destroying 
SIP dialog '%s' Method: %s\n, p-callid, sip_methods[p-method].text);

if (ast_test_flag(p-flags[0], SIP_INC_COUNT) || 
ast_test_flag(p-flags[1], SIP_PAGE2_CALL_ONHOLD)) {
update_call_counter(p, DEC_CALL_LIMIT);
=== END PATCH ==

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Asterisk Database Handling

2008-05-24 Thread Matthew J. Roth
Tilghman and Jay,

Thanks for the licensing advice.  If anyone is interested in replicate, 
I'm now ready to distribute it under the GPL.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Asterisk Database Handling

2008-05-22 Thread Matthew J. Roth
Douglas Garstang wrote:
 Not at all, just offering a workaround.  If your master.csv is
 complete and correct then it makes sense to use that data unless
 someone can identify your problem and offer a fix.

 Unfortunately, not really feesible. I didn't design the system but we 
 are using CDR's not only for billing purposes, but also to keep state 
 on users. The state info (in a call, not in a call etc) needs to be 
 updated in as close to real time as possible. Files won't do it.
Douglas,

I've written a program named replicate that may be of interest to you.  
It replicates all writes to a file over a socket.  The core of the 
program is GNU tail, so it operates nearly in real time (it has 
inherited the --sleep-interval argument for fine-tuning).  I've been 
using it in production for over a year to push all writes to the 
queue_log to a remote reporting server and it has been rock solid.

It operates almost identically to tail -F except every new write to 
the file is written over a socket connection.  The remote end of the 
connection is responsible for sending back an acknowledgment.  If it 
doesn't, replicate will spool the write to a temporary file on the local 
machine.  Once the remote end is responding again, the spool file is 
written to it.  This allows us to have downtime (expected or unexpected) 
on the reporting server without losing any queue_log records.

I've never released replicate publicly, because I'm not sure how taking 
a program like tail and adapting it to a new purpose is handled by the 
GPL.  However, I'm sure someone on this list more knowledgeable than 
myself can help me understand that issue.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Asterisk Database Handling

2008-05-22 Thread Matthew J. Roth
Alex Balashov wrote:
 A program like netcat?
   
Alex,

You're not the first person to suggest nc for this purpose.  As I 
understand it, it's a TCP/UDP swiss army knife so I'm sure it's up to 
the task.  However, in reading the man page, I don't see any trivial way 
to buffer failed writes and retry them when the connection is 
reestablished.  I'd be glad to hear it if you know of a way.  As it is, 
I'm assuming that I'd have to write a script around nc to handle such 
situations.  If that's the case, I'll stick with my program because the 
development time is a sunk cost and it just works for my particular 
application.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Explain Cause of Error: manager.c:Accept returned -1: Too many open files

2008-02-26 Thread Matthew J. Roth
Dovid B wrote:
 Thanks. I like to know my errors and what cause them. Anyone available to 
 help me pick at their brain to see where its coming from or am I really 
 barking up the wrong tree ?
   

Dovid,

The number of concurrent calls on the server is tightly related to the 
number of file handles Asterisk opens, so that's the first place that I 
would look.

Take a look at 'ls -l /proc/`cat /var/run/asterisk.pid`/fd/' if you 
really want to analyze the file handles Asterisk has open.  Doing this 
on a server that has experienced the problem and one that hasn't might 
be revealing.

You could also try running 'lsof | egrep ^asterisk ' periodically on 
one of the affected servers and capturing the output to timestamped 
files.  Comparing the data in the files leading up to a Too many open 
files error should be revealing.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Monitor Asterisk

2008-02-15 Thread Matthew J. Roth
Johansson Olle E wrote:
 In the long run we're trying to move to using the manager for all
 parsing by adding a lot of new manager events and actions.
 If there's something missing that you only can do or information you
 only can get in the CLI, please tell us.
Olle,

How does what you are describing compare to the action command 
http://www.voip-info.org/wiki/index.php?page=Asterisk+Manager+API+Action+Command?

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Monitor Asterisk

2008-02-14 Thread Matthew J. Roth
Soumya Kat wrote:
 Thank you to all those who replied to my last query. For them and for 
 the suggestion, I can monitor asterisk using the asterisk -r -x 
 command option. What I would like to know is that using asterisk 
 -r -x way I can only use the *CLI commands. Is there any other way in 
 which I can monitor asterisk?
Soumya,

Yes, asterisk -rx will only allow you to execute CLI commands.  It 
also tends to spew out a bunch of garbage that makes parsing difficult 
unless verbosity is always set to 0.

I recommend taking a look at the Asterisk Manager Interface (AMI) 
http://www.voip-info.org/wiki-Asterisk+manager+API.  It's a cleaner 
interface that will allow you to read events and issue commands.  All of 
the CLI commands are available through the AMI, as well as an array of 
additional manager actions.

I recently wrote a program that maps the SIP call IDs of the two legs 
that make up a call using the 
POE::Component::Client::Asterisk::Manager Perl module 
http://search.cpan.org/~xantus/POE-Component-Client-Asterisk-Manager/.  
It provides a simple interface for filtering events, so if you're 
familiar with Perl I recommend taking a look at it.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Enterprise or Fedora?

2008-02-01 Thread Matthew J. Roth
love U.all wrote:
 i wanna build a production Asterisk box ,will RedHat Linux Enterprise 
 Server be more stable than Fedora core Linux  or it makes no 
 significant difference
I started out running Fedora, but I have migrated away from it for a few 
reasons.  Fedora has a very short life cycle and since the demise of the 
legacy project there is no support for releases that are over a year 
old.  It is also considered a bleeding-edge distribution and is a 
testing ground for new applications and features.  As such, it has 
frequent updates (including the kernel) that aren't guaranteed not to 
break your system.

If stability and long-term support are your goals, I recommend taking a 
look at CentOS http://www.centos.org/.  It is a binary-compatible 
clone of Red Hat Enterprise Linux that's free and has a very long 
support period.  It's basically RHEL without the paid support contract.  
My migration to CentOS was painless, because the file system and 
configuration are practically identical to those of Fedora.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer



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

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


Re: [asterisk-users] Meetme voice quality problems

2008-02-01 Thread Matthew J. Roth
Administrator TOOTAI wrote:
 This is not true if you're using B410P cards. We always face timing 
 problem as we can't -Asterisk stability issues- add X100P or TDM400P 
 with those cards
Daniel,

I thought that using an empty TDM400P as a timing source may no longer 
be the best solution due to the emergence of new stable timing sources 
(such as HPET), but this is an interesting issue.  Are you stating that 
you can't put an X100P or a TDM400P with no lines attached alongside a 
B410P because it impacts the stability of Asterisk?  Do you have any 
idea why?  Can't the B410P be used as a timing source?  What have you 
done to provide stable timing?

I know that's a lot of questions, but I'm genuinely curious.  It seems 
very strange that a TDM400P in timingonly mode and no lines attached 
would have any impact on Asterisk's stability.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


[asterisk-users] Pros and cons of internal_timing

2008-01-31 Thread Matthew J. Roth
List users,

A recent post on MeetMe timing mentioned the internal_timing option, 
which can be configured to have Asterisk asynchronously generate 
outgoing RTP when a timing device (ie. ztdummy) is available.  This 
allows Asterisk to produce outgoing audio in situations where no 
incoming audio is arriving due to, for example, silence suppression.

This seems like a major improvement to the core functionality of 
Asterisk, but a search of the lists, the wiki, and the book didn't 
produce much information about the option.  We are a Business Edition 
shop running ABE-B, which is based on the 1.2 codebase.  However, the 
1.4-based ABE-C was recently released so I'm interested in the potential 
pros and cons of internal_timing.

For instance, how much does turning on silence suppression on a phone 
typically lower the bandwidth requirements per call and what are the 
effects on features such as VAD and CNG?

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

PS - I apologize for the threadjack, but it seems that my posts never 
make it to the list when I try to start a new thread.



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

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


Re: [asterisk-users] Meetme voice quality problems

2008-01-31 Thread Matthew J. Roth
Tomasz Zieleniewski wrote:
 ztttest results show value below 99,98:

 [EMAIL PROTECTED]:~/src/zaptel-1.4$ ./zttest -v -c 5
 snip
 --- Results after 11 passes ---
 Best: 50.003 -- Worst: 49.612 -- Average: 49.931827, Difference: 
 49.931827 
This is the first thing I would address.  Get that average to at least 
99.98% and it's likely that your problem will go away.
 Do You know how can  I check and set kernel timer frequency?
You can check the timer frequency as follows:

  # grep -e ^CONFIG_HZ /boot/config-`uname -r`
  CONFIG_HZ_1000=y
  CONFIG_HZ=1000

Setting it requires configuring and rebuilding the kernel.  Try setting 
CONFIG_HZ=1000 and checking the results of zttest.  Depending on how 
new your kernel is there are more options, but this is a good place to 
start.

I settled on using an empty TDM400P as a timing source, because it is a 
simple solution that just works.  This may still be your best bet, but 
I'll defer judgment on that to the list because Asterisk has evolved 
quite a bit since I made that decision.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Meetme voice quality problems

2008-01-30 Thread Matthew J. Roth
Tomasz Zieleniewski wrote:
 I am using Debian OS kernel  2.6.22-3-amd64
 and zaptel driver 1.4 with ztdummy module for meetme application.
 I use meetme with SIP channels.

 I have such problem that when one connects to the conference voice is 
 cut.
 Each voice sequence is disturbed.

 Does any one have similar issue and could give me some advice??
Tomasz,

Have you run zttest on the system?  It verifies the accuracy of your 
timing source.  Digium recommends an accuracy of at least 99.98%.  If 
your accuracy is less than that it's probably the source of your problem.

Luckily, it's a problem with multiple solutions.  The following thread 
documents some kernel configuration changes that you can make to improve 
the quality of ztdummy as a timing source:

  Recommendations for kernel config 
http://lists.digium.com/pipermail/asterisk-users/2007-October/197778.html

My preferred solution is to use an empty TDM400P as a timing source.  It 
will cost you a little bit of money, but it's an easy way to reliably 
solve your problem.  You'll find a few posts about it if you search the 
list, but this one has most of the information you'll need:

  Empty Wildcard TDM400P as a MeetMe timer. 
http://lists.digium.com/pipermail/asterisk-users/2007-March/182005.html

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] What do you do to keep asterisk alive?

2007-11-07 Thread Matthew J. Roth
Per Jessen wrote:
 I don't know why it's stopping, but I'm pretty certain it's a segfault. 
 Next time it happens, I should be getting the core dump.
 I'm running 1.4.13, no AGI scripts.
Per,

You should be able to determine if it was a segfault by looking at your 
system log.  For example, on one of my CentOS systems:

  [EMAIL PROTECTED] ~]# grep segfault /var/log/messages
  Jul 31 11:10:41 ast01 kernel: asterisk[11548]: segfault at 
0010 rip 00420450 rsp 41c670e0 error 4

Hopefully, you don't have enough segfaults occurring on your system to 
require a more complex search.  I also recommend the safe_asterisk 
script if your failures are all segfaults.  Unfortunately, the other way 
Asterisk dies (the process is still alive, but not really doing 
anything) isn't as easy to diagnose.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Is there real benefits on a SMP machine for Asterisk?

2007-10-15 Thread Matthew J. Roth
Raúl Gómez C. wrote:
 Thinking about my original post, I was reluctant of installing my PBX 
 on a shared system, is a Dell PowerEdge 2950 with 2 Intel Xeon Dual 
 Core CPUs @2GHz (4 totals cores) and 4GB RAM which serves as Domain 
 Controller and File Server (Samba), central backup server (Bacula with 
 a LTO2 external tape drive), it has dual NIC in a bonding alb mode and 
 redundant PSU (each one connected to a different UPS). It has a PCI 
 slots in which I can install my Sangoma Remora A400D card.

 Or its better to install the PBX on a dedicated system? Let me know 
 your opinions!
Raúl,

The short answer is yes, it's better to install Asterisk on a dedicated 
system.  The long answer is that you could probably get away with it, 
but if you have problems you'll be dealing with a lot of variables 
during troubleshooting.  When that time comes, I wouldn't be surprised 
if the first piece of advice people give you is to offload the non-VoIP 
related tasks from the server.

For 35 simultaneous calls, I'd recommend a dedicated server with a 3.0 
GHz dual-core CPU, 2 GB of RAM, and fast SCSI disks.  In my experience, 
the FSB can be just as important as processor speed so keep that in mind 
as you lay out your budget.  You should be able to buy something from 
Dell with redundant power supplies (and other convenient features like a 
remote access controller) for an affordable price.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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

Re: [asterisk-users] Is there real benefits on a SMP machine for Asterisk?

2007-10-11 Thread Matthew J. Roth
Erik Anderson wrote:
 For this load level (even with high-load transcoding), a multi-core
 machine certainly would not be needed.  That said, it certainly
 wouldn't hurt anything to add on extra cores, especially if they're
 free ;-)
Raul,

The points concerning overall load are valid, but I agree with Erik's 
statement about getting the extra cores if they are free.  Asterisk is 
heavily multi-threaded (one thread per channel plus several core 
threads), so a system with 35 simultaneous calls will happily balance 
the load across 8 (or more) cores.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Recommendations for kernel config

2007-10-05 Thread Matthew J. Roth
Alan Lord wrote:
 I'm building a test asterisk server and building the latest kernel I got 
 to wonder if there are any specific recommendations about schedulers and 
 so forth for optimum performance.

 There are a few areas that raise questions in my mind and I wonder if 
 anyone has any opinions/comments on which settings are most suitable for 
 use with asterisk:

 SLAB Allocator (SLAB or SLUB?)
 Tickless System (?)
 Preemption model (?)
 IO Scheduler (Anticipatory, Deadline or CFQ?)
 Flat or Sparse Memory (?)
 Timer Frequency (100Hz .. 1000hz)
   
Alan,

Good post!  I've wondered about the preemption model and I/O scheduler 
myself, so I'll be keeping an eye on this thread.  As the Linux kernel 
evolves to allow configuration as a fully deterministic real-time OS, it 
will be interesting to see what settings provide the optimal environment 
for Asterisk.

As for my contribution to the thread, I have a few tips for configuring 
the kernel if you plan on using ztdummy for timing:

  1. The kernel version must be at least 2.6.13
  2. The kernel must be configured with a timer frequency of 1000 HZ
  3. The kernel must be configured to provide RTC interrupts
  4. The kernel must be configured with enhanced real time clock support

Remember to use zttest to verify the accuracy of your timing source.  
The goal is to obtain at least 99.98% output from zttest

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Queue serializes call delivery ?

2007-09-19 Thread Matthew J. Roth
Atis Lezdins wrote:
 This is available starting from 1.4, see UPGRADE.txt:

 * ... The new behavior, enabled by setting autofill=yes in queues.conf
   either at the [general] level to default for all queues or
   to set on a per-queue level, makes sure that when the waiting
   callers are connecting with available members in a parallel fashion
   until there are no more available members or no more waiting callers,
   whichever comes first. This is probably more along the lines of how
   one would expect a queue should work and in most cases, you will want
   to enable this new behavior ...
If you are still running 1.2, there is a patch available that backports 
the autofill feature.  It is available at 
http://bugs.digium.com/view.php?id=9132 as the autofill.1.2.new 
http://bugs.digium.com/file_download.php?file_id=13602type=bug 
attachment.

Note that the patch passed the functionality test, but wasn't applied to 
the 1.2 branch because it was considered a new feature.  I reviewed it 
thoroughly, comparing it to the current app_queue.c in the 1.4 branch, 
and found no problems with it.  It is currently running in our 
production inbound call center environment and has been stable against 
150+ concurrent calls.

If you want a pure backport of the autofill feature, remove the code 
that references the dialing variable because it isn't present in the 
1.4 branch.  However, after reading the bug report comments I decided to 
keep the dialing code, because it seemed like a safe change designed 
to increase the efficiency of call distribution.

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


___

Sign up now for AstriCon 2007!  September 25-28th.  http://www.astricon.net/ 

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

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


Re: [asterisk-users] Poor sound quality on incoming calls

2007-07-24 Thread Matthew J. Roth
Ryan Parlee wrote:
 I am experiencing extreme jitter/slowdown on Playback() or Background().
 I've looked thoroughly on voip-info.org and elsewhere for help regarding
 this issue but cannot figure this out.  I can make outgoing calls with no
 problems.

 When I run zttest I get the following:

 Opened pseudo zap interface, measuring accuracy...
 -34.204102% -20.263672% -24.218750% -26.586914% -23.852539% -13.256836%
 -25.207520%
 -13.366699% -15.441895% -14.550781% -22.351074% -21.765137%
 --- Results after 12 passes ---
 Best: 0.00 -- Worst: -34.204102 -- Average: -21.255493
   
Ryan,

For some tips on fixing the playback issues, see this post: 
http://lists.digium.com/pipermail/asterisk-users/2007-June/189978.html

First, you may want to investigate why you are getting such poor 
accuracy from zttest.  It seems that you have an underlying problem.

Regards,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] Basic asterisk Autodialer?

2007-07-09 Thread Matthew J. Roth
Call files and app_amd (Answering Machine Detection) come to mind.  
app_amd can take a little time to tune, but you can get it to be pretty 
reliable in most cases.

See: http://www.voipinfo.org/wiki/index.php?page=Asterisk+cmd+AMD
 http://www.voipinfo.org/wiki/view/Asterisk+auto-dial+out

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


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

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


Re: [asterisk-users] choppy sound with playback, background, etc... but not with musiconhold

2007-06-12 Thread Matthew J. Roth

Paco Brufal wrote:

I have an asterisk 1.2.18 working fine, the only problem is that all
applications that play audio, sound like tremolo or vibrato, but
musiconhold plays fine.

The same audio file (wav, mp3, ...) works fine with Musiconhold()
but not with Playback() or Background()...

Do you know what is happening and how can I fix it? It's an only SIP
system, no fxo/fxs cards.
  

Paco,

You are in luck, because we just solved this problem.  It turned out to 
be a timing issue, which surprised me because I thought timing was only 
important for IAX trunks, meetme rooms, and music-on-hold.  Now I know 
that anything playing back audio files, except native music-on-hold, 
needs a reliable timing source.  This includes the Playback() and 
Background() applications, as well as queue announcements.


You have two options.  One of them is free and might work and the other 
will cost about $75 per server but should work reliably.  The first 
option is to use ztdummy, but there are a few points that you have to be 
aware of:


 1. The kernel version must be at least 2.6.13
 2. The kernel must be configured with a timer frequency of 1000 HZ
 3. The kernel must be configured to provide RTC interrupts
 4. The kernel must be configured with enhanced real time clock support

With a properly configured 2.6.13 or greater kernel, ztdummy will use 
the RTC instead of kernel jiffies.  This method is more accurate and 
should help alleviate your problems.  Just remember that if you install 
a new kernel you'll have to rebuild Zaptel against it.


We tried this and it helped, but it introduced another problem.  The 
Playback() application would intermittently lock up.  We are running on 
Dell PowerEdge 6850s, so I'm assuming the following issue documented at 
http://www.voip-info.org/wiki/view/Asterisk+Zaptel+Installation was 
the cause:
Mar 2006: Specifically, with many Dell servers, RTC will fail to give 
out interrupts, causing ztdummy to give no timing information. If you 
are using ztdummy, and having issues with the Playback() command 
causing the application to hang, then try the above step of disabling 
acpi. In addition, a recompiled kernel, with HPET_EMULATE_RTC option 
enabled, may solve the problem. (This option was removed in 2.6.13 kernel)
The second option is to install a TDM400P without any FXS/FXO modules as 
a timing source.  We've been running like this since Saturday and 
everything seems good so far.  In this case, there are two points to 
keep in mind:


 1.  The server must have an available PCI slot that is compatible with 
the TDM400P

 2.  The wctdm module must be passed the 'timingonly=1' parameter at load

Bare TDM400Ps are available from Atacomm at 
http://voipstore.atacomm.com/Shops/ViewItem.aspx/27934028032-45624523776.htm 
for under $75, which is pretty cheap for a just works solution.


Remember that you can use zttest to verify the accuracy of your timing 
source.  I ran it on each of the servers I installed a TDM400P in, and 
they all reported an average accuracy of better than 99.99%.  Digium 
recommends an accuracy of at least 99.98%, which ztdummy using the RTC 
wasn't able to provide.


Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: High volume benchmarks (0 to 450 calls)

2007-06-07 Thread Matthew J. Roth

Remco Post wrote:

I guess that if I read these stats correctly, the bottleneck for * is
not so much cpu power, it's the cpu cache. As I see it, the cpu cache
becomes far less efficient for larger call volumes, eg. the cache is
unable to keep the most frequently used code and data in cache, due to
the sheer amount of call date going through the cpu. I guess that you do
have some gain from going from single core to dual-core but is dwarfed
by the very limited effect on the cache.

But that is just a guess. Maybe for pure voip solutions cpu's with a
huge cache like eg Power5+ would perform much better that ia32/x64 cpu's.

Remco,

Allow me to add some extra information about the processors on each server.

Dual-Core/8 CPU Server
==
CPU Manufacturer: Intel
 CPU Family: Xeon MP
   Codename: Tulsa
Processor Number: 7120M
  CPU Speed: 3.00 GHz
  Bus Speed: 800 MHz
  CPU Cores: 2
   L1 Cache: 32 KB
   L2 Cache: 2048 KB (1024 KB Per Core)
   L3 Cache: 4096 KB (Shared)
  More Info: http://processorfinder.intel.com/details.aspx?sSpec=SL9HC

Single-Core/4 CPU Server

CPU Manufacturer: Intel
 CPU Family: Xeon MP
   Codename: Cranford
Processor Number: N/A
  CPU Speed: 3.16 GHz
  Bus Speed: 667 MHz   
  CPU Cores: 1

   L1 Cache: 16 KB
   L2 Cache: 1024 KB
   L3 Cache: 0 KB
  More Info: http://processorfinder.intel.com/details.aspx?sSpec=SL84U

As you can see, the dual-core server not only has more processing power 
it also has much more CPU cache.  While I don't doubt that CPU cache may 
eventually limit Asterisk's scalability, I don't think it's the 
bottleneck I'm hitting.  Moving up to a 2.6.17 kernel with multi-core 
scheduling support (IIRC this considers the shared cache when making 
scheduling decisions) would likely gain me a small performance benefit, 
but nothing in the range of what we were expecting when we went to 
dual-core.


One difference that really stands out between the performance of the 
single-core and dual-core servers is the ratio of system to user time at 
similar loads.  Note that a load that would bring the single-core server 
to 50% idle would bring the dual-core server to roughly 74% idle.  We 
used sar to capture these loads on both types of servers when they were 
in production (the output is shown below).  The system to user time 
ratio on the single-core server is 2.3 to 1, but it is 14.6 to 1 on the 
dual-core server.


Stephen Davies has suggested using oprofile to determine where the 
system time is being spent, but I haven't gotten a chance to do so yet.  
I'm also considering strace.  Any other possible explanations or 
suggestions for diagnosing this problem would be appreciated.


Mon Apr  2 12:15:01 EDT 2007
Idle (sar -P ALL 60 14) (60 seconds 14 slices)
Linux 2.6.12-1.1376_FC3smp (4core.imminc.com) 04/02/07

12:24:01  CPU %user %nice   %system   %iowait %idle
12:25:02  all 14.97  0.03 34.25  0.92 49.82
12:25:020  8.83  0.05 33.60  1.28 56.24
12:25:021 17.50  0.02 34.60  0.57 47.32
12:25:022 19.94  0.02 33.52  1.31 45.22
12:25:023 13.62  0.02 35.29  0.52 50.55

Fri May 11 12:00:01 EDT 2007
Idle (sar -P ALL 60 14) (60 seconds 14 slices)
Linux 2.6.12-1.1376_FC3smp (8core.imminc.com) 05/11/07

12:08:02  CPU %user %nice   %system   %iowait %idle
12:09:02  all  1.69  0.00 24.70  0.08 73.52
12:09:020  2.08  0.02 30.16  0.00 67.74
12:09:021  1.95  0.00 25.59  0.62 71.85
12:09:022  1.73  0.00 25.12  0.00 73.15
12:09:023  1.55  0.02 24.70  0.00 73.73
12:09:024  1.67  0.00 23.54  0.02 74.78
12:09:025  1.57  0.02 23.13  0.00 75.29
12:09:026  1.45  0.02 22.90  0.00 75.64
12:09:027  1.48  0.00 22.54  0.00 75.98

Thank you for your response,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


[asterisk-users] Scaling Asterisk: High volume benchmarks (0 to 450 calls)

2007-06-06 Thread Matthew J. Roth

List users,

This post contains the benchmarks for Asterisk at high call volumes on a 
4 CPU, dual-core (8 cores total) server.  It's a continuation of the 
posts titled Scaling Asterisk: Dual-Core CPUs not yielding gains at 
high call volumes.  They contain a fair amount of information, 
including details about our servers and the software on them.  I'm happy 
to answer any questions you might have, but please take a moment to 
review those posts to make sure they don't contain the information 
you're seeking.


Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


Conclusions
---
Once again, I'm presenting the conclusions first. Scroll down if you're 
more interested in the raw data.


 1. Asterisk scales quite well up to a certain number of calls.  At 
this point, the cost in CPU cycles per call starts to increase more 
drastically.  A graph of the Avg Used% values can be used to demonstrate 
this.  It can be described as consisting of two roughly linear 
segments.  The first segment is from 0 to 110 calls.  The rest of the 
graph is a second, steeper segment.  This is not entirely true, as in 
fact each new call costs a little more than the last, but it is a useful 
simplification.
 2. Even at very high call volumes, Asterisk uses less than 512 KB of 
memory.  2 GB of RAM would probably avoid swapping and excessive disk 
activity on most Asterisk installations.
 3. Future benchmarks should be based on the number of active channels, 
not active calls.


I'm relying on you to point out my mistakes and omissions, so please 
take a look at the data and respond with your own analysis and conclusions.


Benchmarking Methodology

The benchmarks are based on data I collected over the period of 
5/12/2007 to 05/30/2007 from two production servers used in our inbound 
call center.  The servers are identical 8-core Dell PowerEdge 6850s as 
documented in my prior posts.  They are meant to be used as a 
primary/backup pair, but both were used in production in order to rule 
out a hardware failure as the cause of our scaling issues.


The data was collected by a bash script executed from cron every 2 
minutes.  This script utilizes some basic Linux tools (such as sar, 
free, df, and the proc filesystem) to record information about the 
system, and 'asterisk -rx show channels' to record information about 
the number of active calls and channels within Asterisk.


Unfortunately, the sample sizes this produced are relatively small for 
the 300-450 call range.  This is due to two factors:


 1. The majority of the time we don't operate at such high call volumes.
 2. Asterisk intermittently fails to report call and channel statistics 
when the CPU idle is low.


This means that the benchmarking results are somewhat erratic for the 
300-450 call range.  The good news is that they are pretty consistent 
for 0 to 300 calls, and I'd imagine that covers the range most people 
are interested in.


Keep in mind that the impetus behind this benchmarking was the lack of a 
performance boost on the dual-core server at high call volumes, so the 
high call range may also be skewed by whatever bottleneck is being hit 
on the 8-core servers.  In the near future, we will be adding one of our 
4-core PowerEdge 6850s to our production environment.  I'll collect and 
analyze the same data, which I believe will show similar performance (as 
defined by cumulative idle CPU percentage) at around 200-300 calls.


In the end, I hope to understand this problem well enough to overcome it 
or determine what the optimal point is for achieving the highest call 
volume without over-dimensioning the hardware.


Call Types and a Note on Channels
-
All of the calls are SIP-to-SIP using the uLaw codec.  The vast majority 
of the calls are either in queue or connected to an agent, but there are 
also a small number of regular outbound calls and transfers.  Every call 
that is connected to an agent is recorded via the Monitor() application 
in PCM format to a RAM disk.  In short, there was no transcoding, 
protocol bridging, or TDM hardware involved on the servers being 
benchmarked.


At any given time, the makeup of the calls varied (ie. calls in queue 
vs. calls connected to agents).  The calls connected to agents involve 
bridging two SIP channels, so they are more resource intensive.  This 
means that the number of active channels is probably a better base 
benchmarking unit than the number of active calls.  Fortunately, the 
ratio of calls to channels is somewhat consistent so this round of 
benchmarking still produced useful results.


Future Tests

I'm aware that using a live environment isn't ideal for testing.  I have 
some ideas for setting up more controlled tests using SIPp, VICIDIAL, or 
call files.  I think I have the necessary hardware, but I haven't had 
the time to do much research, let alone implement anything.


If 

Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes - Low volume benchmarks

2007-06-01 Thread Matthew J. Roth

John Hughes wrote:

For me all these numbers look too small to be useful for benchmarking.

John,

They are small, and they are probably more useful as baseline numbers.

I'm working on writing up some data I've collected off of our production 
switch.  The call range is 0-450 at 10 call increments.  Unfortunately, 
it's a live environment so it's less than ideal for benchmarking.  The 
makeup of the calls varies, I'm relying on historical data (ie. I can't 
reproduce the scenarios), and my sample sizes are much bigger for 0-300 
calls than they are for 300-450.


Nonetheless, there is some knowledge to be gained by studying the 
numbers and I'm sure that 300 calls constitutes large scale for most 
people.  In the future, I'd like to recreate these numbers using 
something like SIPp to give me more control.  Until then, I'm working 
with what I have.


Thank you for your replies,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-06-01 Thread Matthew J. Roth

John Hughes wrote:

OpenSSI can't (at the moment) migrate threads between compute nodes.  It
can migrate separate processes, but doesn't Asterisk use threads?

John,

Asterisk uses 1 thread per call, plus about 10 to 15 background threads 
that persist throughout the life of the process.


I'm curious if the 1 thread per call model is efficient as the number of 
calls increases.  It's possible that in the 100+ call range that there 
is a significant overhead to managing all of those threads without much 
gain since most servers have 1 to 8 processors to actually schedule them 
on.  Acquiring locks on shared resources between the threads could be 
pretty nasty at that point, too.


I wonder if pooling the calls in X threads, where X is a value that is 
determined at compile time by looking at the number of processors 
available, would be more efficient?  This is probably just an academic 
question, because I'd imagine it would require an overhaul of the 
codebase to accomplish.


Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-06-01 Thread Matthew J. Roth

John Hughes wrote:

Matthew J. Roth wrote:
  

As far as Asterisk is concerned, at low call volumes the dual-core
server outperforms the single-core server at a similar rate.


Outperforms in what sense?
  
At low call volumes the cumulative CPU utilization, expressed as a 
percentage of available processor, is lower on the dual-core server.  
This is the expected behavior.  What I'm proposing (and hope to back up 
with numbers in the near future) is that as the number of calls rises to 
the 300-400 range, the cumulative CPU utilization starts to approach the 
same number on both servers.


Unfortunately, I wasn't collecting as much data when the single-core 
server was in production so some of this is speculation based on my 
memory of the system's performance.  The environment is also different, 
because we have added agents so the ratio of calls connected vs. calls 
in queue has changed.  Nonetheless, the dual-core server is not 
performing anywhere near our expectations.


Here is something we recently noticed that may explain why the dual-core 
server is under-performing at high call volumes.  The following numbers 
were collected off both servers while they were in production.  Note 
that while they have similar cumulative idle values, the ratio of system 
time to user time on the single-core server is roughly 2.3 to 1, but on 
the dual-core server it is roughly 19.6 to 1.  I'm not quite sure what 
to make of this, but it seems to be very relevant to the problem.


 Mon Apr  2 12:15:01 EDT 2007
 Idle (sar -P ALL 60 14) (60 seconds 14 slices)
 Linux 2.6.12-1.1376_FC3smp (4core.imminc.com) 04/02/07

 12:24:01  CPU %user %nice   %system   %iowait %idle
 12:25:02  all 14.97  0.03 34.25  0.92 49.82
 12:25:020  8.83  0.05 33.60  1.28 56.24
 12:25:021 17.50  0.02 34.60  0.57 47.32
 12:25:022 19.94  0.02 33.52  1.31 45.22
 12:25:023 13.62  0.02 35.29  0.52 50.55

 Thu May 10 15:30:01 EDT 2007
 Idle (sar -P ALL 60 14) (60 seconds 14 slices)
 Linux 2.6.12-1.1376_FC3smp (8core.imminc.com) 05/10/07

 15:38:01  CPU %user %nice   %system   %iowait %idle
 15:39:01  all  2.47  0.01 48.29  0.00 49.23
 15:39:010  2.92  0.00 53.17  0.00 43.91
 15:39:011  2.98  0.00 48.68  0.02 48.33
 15:39:012  2.47  0.02 48.61  0.00 48.91
 15:39:013  2.27  0.00 48.35  0.00 49.38
 15:39:014  2.38  0.02 47.38  0.00 50.22
 15:39:015  2.37  0.02 46.94  0.00 50.67
 15:39:016  2.23  0.02 46.63  0.00 51.12
 15:39:017  2.17  0.02 46.54  0.00 51.27


I'm working on a follow-up post that will demonstrate this with some
benchmarks for a small number of calls in various scenarios on each
machine.  However, to our surprise as the number of concurrent calls
increases, the performance gains begin to flatten out.  In fact, it
seems that somewhere between 200 and 300 calls, the two servers start
to exhibit similar idle times despite one of them having twice as many
cores.


What do you mean by idle here?

Idle percentage as shown in top's or sar's cumulative view.

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes - Low volume benchmarks - Correction

2007-05-28 Thread Matthew J. Roth

Luki wrote:

Perhaps a naive question, but how does 0.137% CPU utilization per call
equal 1735 MHz per call?

If 1735 MHz / 0.137% = 1735 MHz / 0.00137 = 1266423 MHz at 100%
utilization ??! Even with 4 CPUs, those would be 316 GHz CPUs.

I think you meant:
Average CPU utilization per call: 0.137% (~17 MHz)

Luki,

You are absolutely right.  Thank you for pointing out and correcting my 
mistake.


The corrected statistics are below.  Note that the MHz per call 
statistic is calculated with the following formula:


MHzPerCall = (numCPUs * CPUspeed) * (avgCPUperCall * .01)

Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


The Numbers (Corrected)
---

DC - Incoming SIP to the Playback() application
===
calls   %user   %system   %iowait %idle
   00.00  0.01  0.01 99.98
   10.02  0.04  0.00 99.94
   20.02  0.06  0.00 99.92
   30.03  0.11  0.00 99.86
   40.04  0.13  0.00 99.83
   50.05  0.16  0.00 99.80
   60.05  0.20  0.00 99.75
   70.07  0.24  0.00 99.70
   80.07  0.25  0.00 99.67
   90.08  0.27  0.00 99.65
  100.09  0.33  0.00 99.58

Average CPU utilization per call: 0.040% (~9.60 MHz)

SC - Incoming SIP to the Playback() application
===
calls   %user   %system   %iowait %idle
   00.01  0.02  0.00 99.98
   10.02  0.10  0.00 99.88
   20.03  0.17  0.00 99.80
   30.06  0.21  0.00 99.73
   40.08  0.28  0.00 99.63
   50.10  0.34  0.01 99.55
   60.11  0.48  0.00 99.41
   70.14  0.49  0.00 99.37
   80.16  0.57  0.00 99.28
   90.17  0.63  0.01 99.19
  100.18  0.75  0.00 99.07

Average CPU utilization per call: 0.091% (~11.52 MHz)

DC - Incoming SIP to the Queue() application - In queue
===
calls   %user   %system   %iowait %idle
   00.00  0.01  0.00 99.99
   10.01  0.03  0.00 99.96
   20.01  0.05  0.00 99.94
   30.01  0.08  0.00 99.91
   40.02  0.10  0.00 99.88
   50.03  0.12  0.00 99.84
   60.04  0.16  0.00 99.80
   70.03  0.17  0.00 99.80
   80.04  0.20  0.00 99.76
   90.03  0.22  0.00 99.75
  100.05  0.27  0.00 99.68

Average CPU utilization per call: 0.031% (~7.44 MHz)

SC - Incoming SIP to the Queue() application - In queue
===
calls   %user   %system   %iowait %idle
   00.02  0.02  0.00 99.96
   10.03  0.07  0.00 99.91
   20.03  0.13  0.00 99.83
   30.04  0.18  0.00 99.78
   40.05  0.23  0.00 99.72
   50.06  0.27  0.00 99.67
   60.07  0.33  0.00 99.60
   70.09  0.38  0.00 99.53
   80.09  0.40  0.00 99.51
   90.11  0.46  0.01 99.43
  100.11  0.48  0.00 99.41

Average CPU utilization per call: 0.055% (~6.97 MHz)

DC - Incoming SIP to the Queue() application - Bridged to an agent
==
calls   %user   %system   %iowait %idle
   00.00  0.01  0.00 99.99
   10.01  0.06  0.00 99.93
   20.02  0.14  0.00 99.84
   30.03  0.16  0.00 99.81
  
Average CPU utilization per call: 0.060% (~14.40 MHz)
 
SC - Incoming SIP to the Queue() application - Bridged to an agent

==
calls   %user   %system   %iowait %idle
   00.01  0.02  0.00 99.98
   10.02  0.16  0.00 99.82
   20.04  0.28  0.00 99.68
   30.07  0.36  0.00 99.57

Average CPU utilization per call: 0.137% (~17.35 MHz)

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] RE: Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-05-28 Thread Matthew J. Roth

JR Richardson wrote:

Do you get any errors at max call capacity about too many open files?  You
may try increasing your file descriptors.

JR,

Thanks for the response, but I have the maximum number of open files 
available to Asterisk set to 65536.


Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes - Low volume benchmarks

2007-05-28 Thread Matthew J. Roth

William Moore wrote:

Are you recording memory figures as well and have you checked the
total used memory?  Or did I miss it somewhere?  Thanks for doing
this, scalability testing is always good.


William,

This round of benchmarking is heavily focused on CPU utilization,
because it is causing an immediate problem for me.  However, I am
tracking some other statistics on a daily basis including memory
utilization, swap utilization, load averages, and active channels and calls.

One of my colleagues takes the text file I produce and creates graphs
using Cacti and rrdtool.  You'll be interested in these two (sorry for 
the format of the URLS, but otherwise the list was eating my posts):


- Percent CPU Used With No. Calls and No. Channels
img509DOTimageshackDOTusSLASHimg509SLASH3927SLASHastcpuandcallsbf4DOTpng
- Asterisk Memory Used (KB)
img47DOTimageshackDOTusSLASHimg47SLASH7615SLASHastmemusedgq9DOTpng

Note that even with a peak call volume of approximately 400 active calls
and 550 active SIP channels, the memory utilization never surpasses 600
KB.  I'd estimate that most Asterisk installations would avoid swapping
with 1 GB of RAM.  A 2nd GB might be useful to provide plenty of room
for file caching so that your hard disk doesn't become a bottleneck.  We
also record all of our calls to a 6 GB RAM disk, so our server has a
total of 8 GB of RAM but that isn't necessary in most circumstances.

Overall, Asterisk seems to be very efficiently coded as far as memory is
concerned.  Note that for other reasons we perform a nightly reboot, so
I don't know if there are any memory leaks that would surface over time.

Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer




___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] RE: Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-05-28 Thread Matthew J. Roth

JR Richardson wrote:

The Dual-Core system you are working with must have cost a bundle, several
thousand.  My approach has been to stick with single cpu, single core
servers and add more servers to the cluster, versus building bigger, faster
Proc servers. With sub $1000 servers, I can achieve 150-200 calls per
server, cluster several servers together and for the same price as a quad
proc dual-core server have 700-1000 call capacity.

Now, with that said, a cluster becomes harder to build and operate than a 1
server Asterisk implementation and does not work well in some environments,
such as with large call queues.  But when you are talking straight call
capacity, multiple servers will usually dominate singe servers in relation
to cost.
At the start of our Asterisk project, scaling vertically seemed like the 
simpler approach and to a certain extent it is necessary because of our 
call queues.  Now that it seems like we've pushed this approach as far 
as it will go, my eagerness to study and implement Asterisk clusters is 
growing.  I know that horizontal scaling will have its own set of 
problems, but at this point I think they will be more manageable than 
what we're currently dealing with.


Could you please give me a rough overview of your clustering 
architecture?  I don't need too many details, but a list of the 
technologies/programs you are using would be a great basis for my 
research.  I currently planning to look into SER and DUNDi, and another 
poster suggested looking at OpenSSI. 

Nice discussion, and thanks for posting your benchmark results and feedback.
  
You're welcome.  I'll post some large scale numbers off of our 
production server soon.  I'm also going to start looking at SIPp, which 
may give me a way to gather large scale statistics in a more controlled 
environment.


Thank you for your responses,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-05-28 Thread Matthew J. Roth

Mark Coccimiglio wrote:
Sounds like you are running into the hardware limitations of your 
systems PCI or Front Side Bus (FSB) and not necessarily an issue of 
asterisk.  In short there is a limited amount of bandwidth on the 
computer's PCI Bus (33 MHz)  and the FSB (100-800MHz).  One thing to 
remember is that ALL cores and data streams need to share the PCI and 
FSB.Asterisk is very processor and memory intensive.  At the 
extreme level of usage more cores won't help if data is stuck in the 
pipe.  So the performance planing you described would be expected.

Mark,

That is a great theory and I'd like to follow up on it.  Do you know if 
the PCI or FSB buses are instrumented by Linux?  If not, are you aware 
of any way to gather statistics about their utilization?   I'd like to 
see if the numbers support your idea and, if so, which bus is saturated.


Let me add a little bit of extra information to this discussion.  The 
CPU utilization does not flatten out at 50%.  In fact, as more calls are 
added, Asterisk will eventually drive the idle percentage down to single 
digits with surprisingly few problems.  If PCI or FSB bandwidth were the 
limiting factor, wouldn't the CPU utilization top out at the point that 
the available bandwidth was used?


Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


[asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-05-25 Thread Matthew J. Roth

List users,

Using Asterisk in an inbound call center environment has led us to 
pushing the limits of vertical scaling.  In order to treat each caller 
fairly and to utilize our agents as efficiently as possible, it is 
desirable to configure each client as a single queue.  As far as I know, 
Asterisk's queues cannot be distributed across servers, so the size of 
the largest queue we service is our vertical scaling goal.  In our case, 
that queue must be able to hold in excess of 300 calls regardless of 
their makeup (ie. number of calls in queue vs. number of calls connected 
to an agent).  In reality, we are servicing more than one client on our 
server, so on busy days the total number of calls we're handling is 
greater than 300.


Recently, we were pushing our server to almost full CPU utilization.  
Since we've observed that Asterisk is CPU bound, we upgraded our server 
from a PowerEdge 6850 with four single-core Intel Xeon CPUs running at 
3.16GHz, to a PowerEdge 6850 with 4 dual-core Intel Xeon CPUs running at 
3.00GHz.  The software installed is identical and a kernel build 
benchmark yielded promising results.  The new dual-core server ran 
roughly 80% faster, which is about what we expected.


As far as Asterisk is concerned, at low call volumes the dual-core 
server outperforms the single-core server at a similar rate.  I'm 
working on a follow-up post that will demonstrate this with some 
benchmarks for a small number of calls in various scenarios on each 
machine.  However, to our surprise as the number of concurrent calls 
increases, the performance gains begin to flatten out.  In fact, it 
seems that somewhere between 200 and 300 calls, the two servers start to 
exhibit similar idle times despite one of them having twice as many cores.


Once I collect the data, I will add a second follow-up post with a 
performance curve tracking the full range of call volumes we 
experience.  Unfortunately, from day to day there are some variables 
that I'm sure affect performance, such as the number of agents logged in 
and the makeup of the calls.  I'll do my best to choose a sample size 
that smooths out these bumps.


In the meantime, I'm looking for insights as to what would cause 
Asterisk (or any other process) to idle at the same value, despite 
having similar workloads and twice as many CPUs available to it.  I'll 
be working on benchmarking Asterisk from very low to very high call 
volumes so any suggestions or tips, such as how to generate a large 
number of calls or what statistics I should gather, would also be 
appreciated.


Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


___
--Bandwidth and Colocation provided by Easynews.com --

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


Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes - Low volume benchmarks

2007-05-25 Thread Matthew J. Roth

List users,

This post contains the benchmarks for Asterisk at low call volumes on 
similar single and dual-core servers.  I'd appreciate it greatly if you 
took the time to read and comment on it.


Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer


Conclusions
---
I'm presenting the conclusions first, because they are the most 
important part of the benchmarking.  If you like details and numbers, 
scroll down.


I've drawn three conclusions from this set of benchmarks.

 1. At low call volumes, the dual-core server outperforms the 
single-core server by the expected margin.
 2. Calls bridged to an agent are more CPU intensive than calls 
listening to audio via the Playback() application or calls in queue.  
This is expected, because they involve more SIP channels and more work 
is done on the RTP frames (bridging, recording, etc.).
 3. For all call types, the majority of the CPU time is spent in the 
kernel (servicing system calls, etc.).  I've observed this to be true at 
all call volumes on our production server, with the ratio sometimes in 
the range of 20 to 1.  This may suggest that the popular perception that 
Asterisk doesn't scale well because of its extensive use of linked lists 
doesn't tell the whole story.


So far there are no surprises, but over the next week or so I'll be 
collecting data that I expect to reveal that at high call volumes 
(200-300 concurrent calls) the idle percentage on both machines starts 
to approach the same value.  In the end, my goal is to break through 
(or, at the least, understand) this scaling issue, so I welcome all 
forms of critique.  It's quite possible that the problem lies in my 
setup or that I'm missing something obvious, but I suspect it is deeper 
than that.


Benchmarking Methodology

I collected each type of data as follows.

- Active channel and call counts: 'asterisk -rx show channels' and 
'asterisk -rx sip show channels'

- Thread counts: 'ps -eLf' and 'ps axms'
- Idle time values: 'sar 30 1'
- Average CPU utilization per call: (startIdle - endIdle) / numCalls

The servers were rebooted between tests.

Call Types
--
I tested the following three call types.

- Incoming SIP to the Playback() application
  - 1 active SIP channel per call
- From the originating Asterisk server to the Playback() application

- Incoming SIP to the Queue() application - In queue
  - 1 active SIP channel per call
- From the originating Asterisk server to the Queue() application

- Incoming SIP to the Queue() application - Bridged to an agent
  - 2 active SIP channels per call
- From the originating Asterisk server to the Queue() application
- Bridged from the Queue() application to the agent

All calls were pure VOIP (SIP/RTP) and originated from another Asterisk 
server.  Calls that were bridged to agents terminated at SIP hardphones 
(Snom 320s) and were recorded to a RAM disk via the Monitor() 
application.  All calls were in the uLaw codec and all audio files 
(including the call recordings, the native MOH, and the periodic queue 
announcements which played approximately every 60 seconds) were in the 
PCM file format.  There was no transcoding, protocol bridging, or TDM 
hardware involved on the servers being benchmarked.  


A Note on Asterisk and Threads
--
On both systems, a freshly started Asterisk process consisted of 10 
threads.  Some events, such as performing an 'asterisk -rx reload' 
triggered the creation of a new persistent thread.  The benchmarking 
revealed that in general, the Asterisk process will consist of 10-15 
persistent background threads plus exactly 1 additional thread per 
active call.


This means that at even modest call volumes, Asterisk will utilize all 
of the CPUs in most modern PC-based servers.


Server Profiles
---
The servers I performed the benchmarking on are described below.  Note 
that the CPUs support hyperthreading, but it is disabled.  This is 
reflected in the CPU count, which is the number of physical processors 
available to the OS.


 Short Name: DC
Manufacturer: Dell Computer Corporation
Product Name: PowerEdge 6850
 Processors: Four Dual-Core Intel Xeon MP CPUs at 3.00GHz
  CPU Count: 8
  FSB Speed: 800 MHz
 OS: Fedora Core 3 - 2.6.13-ztdummy SMP x86_64 Kernel
Asterisk Ver: ABE-B.1-3

 Short Name: SC
Manufacturer: Dell Computer Corporation
Product Name: PowerEdge 6850
 Processors: Four Single-Core Intel Xeon MP CPUs at 3.16GHz
  CPU Count: 4
  FSB Speed: 667 MHz
 OS: Fedora Core 3 - 2.6.13-ztdummy SMP x86_64 Kernel
Asterisk Ver: ABE-B.1-3

The kernel is a vanilla 2.6.13 kernel with enhanced realtime clock 
support and a timer frequency of 1000 HZ (earning it the EXTRAVERSION of 
'-ztdummy').  I am aware that the 2.6.17 kernel introduced multi-core 
scheduler support, but it exhibited negligible gains in the kernel build 
benchmark.  Nonetheless, I am open to any 

Re: [asterisk-users] Scaling Asterisk: Dual-Core CPUs not yielding gains at high call volumes

2007-05-25 Thread Matthew J. Roth

Sean M. Pappalardo wrote:
Just curious if you've checked out Linux clustering software such as 
OpenSSI ( http://www.openssi.org/ ) and run Asterisk on it? It 
features a multi-threaded cluster-aware shell (and custom kernel) that 
will automatically cluster-ize any regular Linux executable (such as 
the main Asterisk process.) If it works as advertised, it should just 
be a matter of adding boxes to the cluster to speed up processing.


As for Asterisk itself, is it multi-threaded enough to take advantage 
of 4+ way systems?

Sean,

Thanks for your response.  I'm going to take a look into OpenSSI.  It'd 
be amazing if it ran Asterisk without any side effects.


I've addressed the number of threads that Asterisk uses in my first 
follow-up post.  In short, the answer is yes because it uses a 1 thread 
per call model.


Thank you,

Matthew Roth
InterMedia Marketing Solutions
Software Engineer and Systems Developer

___
--Bandwidth and Colocation provided by Easynews.com --

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


  1   2   >