Re: [asterisk-dev] [Code Review] 4413: Testsuite: Simulate phones and control from YAML.

2015-02-12 Thread Mark Michelson

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4413/#review14450
---



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24971

I think this is a good case for using is instead of equality. I imagine 
that callers of this function are going to be passing a reference to the same 
account object that is stored on the phone_obj rather than a separate object 
with equivalent properties.

Also, to avoid the continue statement, you can just use a positive 
comparison instead of a negative one:

if account is phone_obj.account:
return phone_obj



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24970

A couple of PEP 8 points:

1) When catching exceptions, use the syntax except ErrorType as 
ErrorInstance instead of except ErrorType, ErrorInstance. So here, it would 
be except pj.Error as err

2) A PEP 8 checker will complain about the indentation of str(err)) on the 
final line I've highlighted. It will claim it should be lined up like this:

raise Exception(Exception occurred while making call: '%s' %
str(err))

See how str is lined up to show how it belongs to the parentheses?



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24972

I suggest breaking this into two separate functions: blind_transfer and 
attended_transfer.

1) The nomenclature for the transfer_type has to be looked up in the source 
in order to know what values are accepted.

2) The transfer_uri is only useful for blind transfers. By having two 
separate functions, you can more clearly group which parameters are relevant 
and which are irrelevant for a specific type of transfer. So the attended 
transfer, as currently defined, would take no parameters and a blind transfer 
would take a transfer URI. If it became useful later to optionally specify that 
an attended transfer should go the other direction or should affect different 
calls, that could be added solely to the attended transfer function.



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24973

self.current_call doesn't seem to be used for anything.



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24974

Should this only be done if self.phone is None? Seems like this would be 
redundant after the initial setting.



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24975

I suspect it's not an issue, but is there ever a chance that self.call 
could be None when the on_state() callback is called?



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24976

This seems overly complicated for what you are trying to do here. Why not 
just

try:
self.phone.calls.remove(self.call)
except ValueError:
# Log an error or something

If that doesn't work because equality of calls doesn't evaluate as you'd 
expect, then this is a situation where I expect that a single object reference 
is being passed around everywhere rather than separate call objects. You could 
take the approach of reconstructing the self.phone.calls list like this:

self.phone.calls = [call for call in self.phone.calls if call is not 
self.call]



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24977

I think this needs to be altered to always call self.call.hangup() if final 
is 1. If a transfer attempt fails, the phone is still responsible for hanging 
up the call in that situation. So if you perform a blind transfer to a 
non-existent extension in the dialplan, or you perform a blind transfer to an 
extension that exists but hangs up with Congestion() or Busy() for some reason, 
the phone still needs to hang up the call when receiving the final transfer 
response.



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24978

This function's name is misleading because it does not actually log 
anything. It should either

1) Be renamed to something indicating that it is just gathering call 
information into a string

or

2) Be altered to actually log the call info using LOGGER.debug()



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24979

Can you add a comment about why the lock is being used here?



/asterisk/trunk/lib/python/asterisk/phones.py
https://reviewboard.asterisk.org/r/4413/#comment24980

If this exception occurs, does lock get properly unlocked?



/asterisk/trunk/lib/python/asterisk/phones.py

[asterisk-dev] Reject incoming call

2015-02-12 Thread Raj Roy Ghandhi
Hi Friends,

I am trying to implement a simple dial plan with asterisk.
1. Ring the inbound call
2. wait for 2 seconds
3. call agi script with cli
4. hangup

But when it gets hangup I see the Declined is passed from the asterisk.
But my PSTN provider keep waiting in dialing state with no noise until 60
seconds.

any idea what I have done wrong.

here is my dial plan

exten = 01,1,Ringing()
exten = 01,2,Wait(2)
exten =
01,3,Set(vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=${CALLERID(num)})
exten = 01,4,Agi(agi://127.0.0.1/url=${vxmlurl})
exten = 01,5,Hangup()

Please advice,

Best Regards,
Roy.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-dev] Reject incoming call

2015-02-12 Thread bala murugan
Who is responsible to answer ??
On Feb 12, 2015 6:05 AM, Raj Roy Ghandhi roy.gan...@gmail.com wrote:

 Hi Friends,

 I am trying to implement a simple dial plan with asterisk.
 1. Ring the inbound call
 2. wait for 2 seconds
 3. call agi script with cli
 4. hangup

 But when it gets hangup I see the Declined is passed from the asterisk.
 But my PSTN provider keep waiting in dialing state with no noise until 60
 seconds.

 any idea what I have done wrong.

 here is my dial plan

 exten = 01,1,Ringing()
 exten = 01,2,Wait(2)
 exten =
 01,3,Set(vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=${CALLERID(num)})
 exten = 01,4,Agi(agi://127.0.0.1/url=${vxmlurl}
 http://127.0.0.1/url=$%7Bvxmlurl%7D)
 exten = 01,5,Hangup()

 Please advice,

 Best Regards,
 Roy.

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

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

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

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

[asterisk-dev] asterisk + voiceglue in Rasbery PI

2015-02-12 Thread Raj Roy Ghandhi
Hi Friends,
would like to know if anybody did install Asterisk + voiceglue into
Raspberry PI B module.

Is it possible?

Please let em know.

Best Regards,
Roy.
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-dev] Reject incoming call

2015-02-12 Thread Pavel Troller
Hi Roy,

 Hi Friends,
 
 I am trying to implement a simple dial plan with asterisk.
 1. Ring the inbound call
 2. wait for 2 seconds
 3. call agi script with cli
 4. hangup
 
 But when it gets hangup I see the Declined is passed from the asterisk.
 But my PSTN provider keep waiting in dialing state with no noise until 60
 seconds.
 
 any idea what I have done wrong.
 
 here is my dial plan
 
 exten = 01,1,Ringing()
 exten = 01,2,Wait(2)
 exten =
 01,3,Set(vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=${CALLERID(num)})
 exten = 01,4,Agi(agi://127.0.0.1/url=${vxmlurl})
 exten = 01,5,Hangup()

Did you try to put a specific Clear Cause code to the Hangup command ?
For example, Hangup(17) means User Busy, i.e. 486 Busy Here on SIP, or
Hangup(1) means Unallocated Number or 404 Not Found etc. If you want to
find more codes, search for ISDN Cause Codes. Your PSTN provider will
probably react better to other causes than the default one, which is
probably 16 Normal Call Clearing.

With regards,
  Pavel

 
 Please advice,
 
 Best Regards,
 Roy.


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

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


Re: [asterisk-dev] [Code Review] 4352: testsuite: Add tests for ARI redirect; PJSIP Transfer

2015-02-12 Thread Matt Jordan

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4352/
---

(Updated Feb. 12, 2015, 2:47 p.m.)


Status
--

This change has been marked as submitted.


Review request for Asterisk Developers.


Changes
---

Committed in revision 6397


Bugs: ASTERISK-24015 and ASTERISK-24703
https://issues.asterisk.org/jira/browse/ASTERISK-24015
https://issues.asterisk.org/jira/browse/ASTERISK-24703


Repository: testsuite


Description
---

This patch adds tests for https://reviewboard.asterisk.org/r/4316/, which 
includes both tests for PJSIP's .transfer channel callback and the ARI 
/channels/[id]/redirect operation.

*PJSIP Tests*
 - Test transferring an unanswered channel to a PJSIP endpoint, which responds 
to the initial INVITE request with a 302
 - Test transferring an answered channel to a PJSIP endpoint, which sends a 
REFER request to the target
 - Test transferring an unanswered channel to a SIP URI via PJSIP, which 
responds to the initial INVITE request with a 302
 - Test transferring an answered channel to a SIP URI via PJSIP, which sends a 
REFER request to the target

*ARI Tests*
 - Off-nominal testing of the new operation, verifying that the various off 
nominal error response codes are returned as expected
 - Nominal testing of the operation. For fun, this spawns four Asterisk 
instances (one call generator, one load balancer, and two destinations) - and 
proceeds to load balance 'calls' between the two destination instances.

As a pre-emptive note:
(1) The off-nominal test makes use of the ARI event matcher, as it requires a 
PJSIP channel and tests off nominal error response codes. Along with needing to 
originate a second channel, the Python callback for this is relatively self 
contained and limited, both of which remove most of the benefit of driving the 
whole thing in YAML.
(2) The nominal test is written in old style - a single run-test. I can't 
really see how anyone would re-use portions of it, but it was a fun test to 
write to show the power of the new operation - plus it does exercise the 
operation quite a lot.


Diffs
-

  /asterisk/trunk/tests/rest_api/channels/tests.yaml 6332 
  /asterisk/trunk/tests/rest_api/channels/redirect/tests.yaml PRE-CREATION 
  /asterisk/trunk/tests/rest_api/channels/redirect/off-nominal/test-config.yaml 
PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/off-nominal/redirect_off_nominal.py
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/off-nominal/configs/ast1/pjsip.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/off-nominal/configs/ast1/extensions.conf
 PRE-CREATION 
  /asterisk/trunk/tests/rest_api/channels/redirect/nominal/test-config.yaml 
PRE-CREATION 
  /asterisk/trunk/tests/rest_api/channels/redirect/nominal/run-test 
PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast4/pjsip.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast4/http.conf 
PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast4/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast3/pjsip.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast3/http.conf 
PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast3/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast2/pjsip.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast2/http.conf 
PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast2/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast1/pjsip.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast1/http.conf 
PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/channels/redirect/nominal/configs/ast1/extensions.conf
 PRE-CREATION 
  /asterisk/trunk/tests/channels/pjsip/transfers/tests.yaml 6332 
  /asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/tests.yaml 
PRE-CREATION 
  
/asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/refer/test-config.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/refer/sipp/alice.xml
 PRE-CREATION 
  
/asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/refer/configs/ast1/pjsip.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/refer/configs/ast1/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/redirect/test-config.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/channels/pjsip/transfers/asterisk/uri/redirect/sipp/alice.xml
 PRE-CREATION 
  

Re: [asterisk-dev] [Code Review] 4316: ARI/PJSIP: Add the ability to redirect (transfer) a channel in a Stasis dialplan application to another system; improve and fix PJSIP's transfer ability

2015-02-12 Thread Matt Jordan

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4316/
---

(Updated Feb. 12, 2015, 2:33 p.m.)


Status
--

This change has been marked as submitted.


Review request for Asterisk Developers and Joshua Colp.


Changes
---

Committed in revision 431717


Bugs: ASTERISK-24015 and ASTERISK-24703
https://issues.asterisk.org/jira/browse/ASTERISK-24015
https://issues.asterisk.org/jira/browse/ASTERISK-24703


Repository: Asterisk


Description
---

This patch adds a new feature to ARI to redirect a channel to another server, 
and fixes a few bugs in PJSIP's handling of the Transfer dialplan 
application/ARI redirect capability.

*New Feature*
A new operation has been added to the ARI channels resource, redirect. With 
this, a channel in a Stasis application can be redirected to another endpoint 
of the same underlying channel technology.

- Preemptive question: why 'redirect', and not 'transfer'? Mostly because 
'transfer' was always kind of a bad name. If the channel isn't answered, we 
aren't transferring, we're forwarding. If it is answered, the type of transfer 
being performed is somewhat vague - is it blind? Is it attended? 'redirect' - 
while also a slightly loaded term - is a bit more generic and yet descriptive 
of what is happening: we're redirecting the channel to somewhere else. 
Answered, not answered, it doesn't matter: your channel is no good here!

*Bug fixes*
In the process of writing this new feature, two bugs were fixed in the PJSIP 
stack:
(1) The existing .transfer channel callback had the limitation that it could 
only transfer channels to a SIP URI, i.e., you had to pass 
'PJSIP/sip:foo@my_provider.com' to the dialplan application. While this is 
still supported, it is somewhat unintuitive - particularly in a world full of 
endpoints. As such, we now also support specifying the PJSIP endpoint to 
transfer to.
(2) res_pjsip_multihomed was, unfortunately, trying to 'help' a 302 redirect by 
updating its Contact header. Alas, that resulted in the forwarding destination 
set by the dialplan application/ARI resource/whatever being rewritten with very 
incorrect information. Hence, we now don't bother updating an outgoing response 
if it is a 302. Since this took a looong time to find, some additional debug 
statements have been added to those modules that update the Contact headers.


Diffs
-

  /branches/13/rest-api/api-docs/channels.json 430839 
  /branches/13/res/stasis/control.c 430839 
  /branches/13/res/res_pjsip_transport_websocket.c 430839 
  /branches/13/res/res_pjsip_nat.c 430839 
  /branches/13/res/res_pjsip_multihomed.c 430839 
  /branches/13/res/res_ari_channels.c 430839 
  /branches/13/res/ari/resource_channels.c 430839 
  /branches/13/res/ari/resource_channels.h 430839 
  /branches/13/include/asterisk/stasis_app.h 430839 
  /branches/13/channels/chan_pjsip.c 430839 

Diff: https://reviewboard.asterisk.org/r/4316/diff/


Testing
---

Tests were written both for the PJSIP stack as well as the new ARI operation. 
See https://reviewboard.asterisk.org/r/4352.


Thanks,

Matt Jordan

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

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

Re: [asterisk-dev] [Code Review] 4414: res_pjsip_session: Fix double re-INVITE collision crash.

2015-02-12 Thread Mark Michelson

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4414/#review14452
---

Ship it!


Ship It!

- Mark Michelson


On Feb. 11, 2015, 10:37 p.m., rmudgett wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/4414/
 ---
 
 (Updated Feb. 11, 2015, 10:37 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Bugs: ASTERISK-24727
 https://issues.asterisk.org/jira/browse/ASTERISK-24727
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 A multi-asterisk box setup with direct media enabled would occasionally
 crash when two re-INVITE collisions on a call leg happen in a row.
 
 The re-INVITE logic only had one timer struct to defer the re-INVITE.
 When the second collision happens the timer struct is overwritten and put
 into the timer heap again.  Resources for the first timer are leaked and
 the heap has two positions occupied by the same timer struct.  Now the
 heap ordering is potentially corrupted, the timer will fire twice, and any
 resources allocated for the second timer will be released twice.
 
 * The solution is to put the collided re-INVITE into the delayed requests
 queue with all the other delayed requests and cherry pick the next request
 that can come off the queue when an event happens.
 
 * Changed to put delayed BYE requests at the head of the delayed queue.
 There is no sense in processing delayed UPDATEs and re-INVITEs when a BYE
 has been requested.
 
 * Made the start of a BYE request flush the delayed requests queue to
 prevent a delayed request from overlaping the BYE transaction.  I saw a
 few cases were a delayed re-INVITE got started after the BYE transaction
 started.
 
 * Changed the delayed_request struct to use an enum instead of a string
 for the request method.  Cherry picking the queue is easier with an enum
 than string comparisons and the compiler can warn if a switch statement
 does not cover all defined enum values.
 
 * Improved the debug output to give more information.  It helps to know
 which channel is involved with an endpoint.  Trunks can have many channels
 associated with the endpoint at the same time.
 
 
 Diffs
 -
 
   /branches/13/res/res_pjsip_session.c 431716 
 
 Diff: https://reviewboard.asterisk.org/r/4414/diff/
 
 
 Testing
 ---
 
 Ran the full testsuite with the patch.  All but one test passes and the 
 failing test fails with or without the patch.
 
 Setup a test environment with two asterisk boxes and direct media enabled for 
 all legs to perform this call repeatedly:
 PJSIP/100 -- box 1 -- box 2 -- box 1 -- PJSIP/200
 
 1) 100 calls 200
 2) 200 answers
 3) 100 hangs up
 4) repeat call
 
 A crash no longer happens on either Asterisk box with the patch.
 
 
 Thanks,
 
 rmudgett
 


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

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

Re: [asterisk-dev] [Code Review] 4415: Testsuite: Attended transfers from non-Stasis to a Stasis bridge

2015-02-12 Thread Mark Michelson

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4415/#review14453
---

Ship it!


I had comments on the PJSUA phone controller code, but I believe none of the 
findings would have any effect on how this test would be written. So, once the 
PJSUA phone controller is committed, I say commit away on this as well.

- Mark Michelson


On Feb. 12, 2015, 6:34 a.m., jbigelow wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/4415/
 ---
 
 (Updated Feb. 12, 2015, 6:34 a.m.)
 
 
 Review request for Asterisk Developers and Mark Michelson.
 
 
 Bugs: ASTERISK-24578, ASTERISK-24755 and ASTERISK-24782
 https://issues.asterisk.org/jira/browse/ASTERISK-24578
 https://issues.asterisk.org/jira/browse/ASTERISK-24755
 https://issues.asterisk.org/jira/browse/ASTERISK-24782
 
 
 Repository: testsuite
 
 
 Description
 ---
 
 This adds the Attended Transfers from non-Stasis to a Stasis bridge tests 1.1 
  1.2 as described on the StasisStart/StasisEnd Test Plan at: 
 https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=30279826
 
 Notes:
 * These tests use the phones.py module that is up for review at 
 https://reviewboard.asterisk.org/r/4413/
 * The tests may occasionally fail due to bug ASTERISK-24755.
 * These tests constantly fail due to ASTERISK-24782. The YAML config 
 'expected-result: False' has been set for the tests. Once the bug has been 
 resolved the config line should be removed from both.
 
 
 Diffs
 -
 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/tests.yaml
  6379 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/test-config.yaml
  PRE-CREATION 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/pjsip.conf
  PRE-CREATION 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_bridge_to_stasis_bridge/configs/ast1/extensions.conf
  PRE-CREATION 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/test-config.yaml
  PRE-CREATION 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/pjsip.conf
  PRE-CREATION 
   
 /asterisk/trunk/tests/rest_api/external_interaction/attended_transfer/non_stasis_app_to_stasis_bridge/configs/ast1/extensions.conf
  PRE-CREATION 
 
 Diff: https://reviewboard.asterisk.org/r/4415/diff/
 
 
 Testing
 ---
 
 * Because of bug ASTERISK-24782, a few ARI/AMI events aren't received and 
 actions don't fire. Therefore those events/actions in the YAML haven't been 
 tested.
 * Executed tests multiple times.
 * Reviewed logs to ensure the tests were executing as expected.
 
 
 Thanks,
 
 jbigelow
 


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

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

Re: [asterisk-dev] [Code Review] 4379: Example configuration scenario - Super Awesome Company: Phase 1 - Patch 1

2015-02-12 Thread rnewton


 On Jan. 29, 2015, 10:23 p.m., Mark Michelson wrote:
  /branches/13/configs/examples/super_awesome_company/pjsip.conf, line 41
  https://reviewboard.asterisk.org/r/4379/diff/1/?file=71114#file71114line41
 
  I'm curious why you elected to use MAC addresses as the endpoint names.
  
  I'd personally find things a lot easier to configure/maintain if the 
  SIP endpoint/aor/auth name is the same as the voicemail box number is the 
  same as the extension number, etc.
  
  This also means that if Lindsey does some crazy extreme stunt that 
  smashes her phone, then when she replaces it with a new one, you're going 
  to have to change config values everywhere to have the new MAC address of 
  the phone.
 
 Matt Jordan wrote:
 Hm. I think that's usually one of those best practices. You generally 
 don't want the auth user to be easily guessed.
 
 Of course, we could split the concept of the endpoint name from the auth 
 user, which would then allow the endpoints to be named 107 (for example) and 
 the auth user to be her MAC address.
 
 Joshua Colp wrote:
 I think in practice this would just cause problems. Not all devices allow 
 those two things to be separate. It's annoying.
 
 Mark Michelson wrote:
 SAC uses Digium phones, and Digium phones allow separate user and 
 authuser to be specified.
 
 Joshua Colp wrote:
 Your statement is true but it would be nice if we could err on the side 
 of not falling into a trap of doing fundamental stuff which isn't applicable 
 to the wide world.
 
 rnewton wrote:
 I used MAC addresses as that is what we use as an example in our security 
 best practices document: 
 http://svnview.digium.com/svn/asterisk/trunk/README-SERIOUSLY.bestpractices.txt?view=markup
 
 Perhaps this is a moot point. SAC's Asterisk system is behind NAT and 
 firewall, so we could change the spec to specify that IT has locked down 
 traffic between Asterisk and the public internet to only allow inbound 
 traffic from the ITSP addresses.
 
 Or, on Asterisk we can use ACL's to limit traffic allowed to the internal 
 network and ITSP addresses.
 
 With either of those approaches we should be able to use the less secure 
 extension numbered auth users.
 
 What would be the issues either of these approaches other than an 
 attacker on the internal network?
 
 Matt Jordan wrote:
 I think we need to come to some concurrence here so that the diffs can 
 get updated. I suspect there are going to be additional rounds of review.
 
 The purpose of this set of example configs is to provide a base for a 
 recommended deployment. Regardless of the scheme chosen, the example 
 absolutely should use the best practices so that people have a secure system. 
 If someone wants to use 'alice' and 'bob' for their names, that may be 
 suitable for some examples, but not suitable for a recommended deployment.
 
 I don't care if we use MAC address or something else that is suitably 
 difficult to guess, but MAC address is what A:TDG recommends [1] as well as 
 our README-SERIOUSLY [2], and that feels like a decent starting point.
 
 [1] 
 http://www.asteriskdocs.org/en/3rd_Edition/asterisk-book-html-chunk/DeviceConfig_id216341.html#DeviceConfig_id291081
 [2] 
 http://svn.asterisk.org/svn/asterisk/trunk/README-SERIOUSLY.bestpractices.txt

Looks like the best compromise is splitting out the user ID and auth name. 
Therefore the endpoint,aor,auth objects will be the extension number and the 
auth usernames will be the MAC address. We still have security, things are 
easier to administrate and the only downside is the config won't work as well 
for some phones. That being said, even some cheap generic phones I had laying 
around were able to configure a separate user id/account and auth name.

This also makes other parts of the dialplan easier, hints and no crazy variable 
mapping for the endpoint names.


- rnewton


---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4379/#review14377
---


On Jan. 27, 2015, 7:15 p.m., rnewton wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/4379/
 ---
 
 (Updated Jan. 27, 2015, 7:15 p.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 One of things discussed at the last AstriDevCon was better documentation (for 
 everything!), but in particular, we mentioned needing some example 
 configurations that pertain to a real-world scenario. That is, as opposed to 
 the current sample files which are sort of all over the place at this point.
 
 This patch proposes a basic and minimal configuration of Asterisk 

Re: [asterisk-dev] [Code Review] 4379: Example configuration scenario - Super Awesome Company: Phase 1 - Patch 1

2015-02-12 Thread rnewton

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4379/
---

(Updated Feb. 13, 2015, 12:46 a.m.)


Review request for Asterisk Developers.


Changes
---

Basically, review it again from head to toe.

Re-tested, same testing as described in initial post.


Repository: Asterisk


Description
---

One of things discussed at the last AstriDevCon was better documentation (for 
everything!), but in particular, we mentioned needing some example 
configurations that pertain to a real-world scenario. That is, as opposed to 
the current sample files which are sort of all over the place at this point.

This patch proposes a basic and minimal configuration of Asterisk to satisfy 
the requirements for the first phase of Super Awesome Company's implementation 
of Asterisk.

I will submit four separate patches for the first phase, so that we don't have 
to review the entire thing all at once. This review is for the first patch.

Who is Super Awesome Company? See 
https://wiki.asterisk.org/wiki/display/AST/Super+Awesome+Company

For the first patch, I am attempting to satisfy the below requirements. The 
patch does not include a new make target, as I believe Matt Jordan offered to 
handle that.

SAC requires:

* PJSIP connectivity for all employee desk phones.
* The ability for employees to call one another inside of the office.
* Voicemail boxes for each of the employees.

Basic configuration

We want SAC to have a clean system. That means:

* No 'autoload' in modules.conf. Explicitly load a basic configuration. If 
SAC doesn't need the module, don't load it.
* Every module loaded should have a configuration file that is appropriate 
for it. This includes all the 'core' things that need configuration.

pjsip.conf

* A PJSIP configuration for their desk phones. Assume every endpoint that 
is a phone has:
* A voicemail mailbox that they can subscribe to
* A hint for their device
* Note that the PJSIP configuration should adhere to best practices. 
That means MAC addresses for device names, etc.

extensions.conf

* A safe dialplan for intra-company communication. This should be templated 
out so that it is trivial to add additional devices (use pattern 
matching/pattern matching hints, etc.)
* Receiving a Busy/Unavailable should result in going to VoiceMail
* A user should be able to dial something and get to their VoiceMailMain 
without having to enter in their extension number 
* Note that mapping of MAC address endpoints to extension numbers should be 
done in some fashion that is easily extensible.

voicemail.conf

* Set up mailboxes for every person in SAC. Assign 'default' pins. Create 
reasonable basic settings.
* Do not set up e-mail or pager addresses.


REVIEW?

Please, if possible look at this from a few angles:

 * Use the configuration, configure a couple phones and call between them. 
Leave voicemails and retrieve them.
 * Have I created any security issues?
 * Is my dialplan easy to understand?
 * Could anything be done more efficiently without making it over-complicated?
 * Have I over-complicated anything?
 * Are there any critical settings I'm missing from any of the files?

A couple, more specific questions:

 * We have sample configs in /configs/samples; what directory do we want these 
configurations in? (I used /configs/examples for now, but I don't really like 
it)
 * We have the make target make samples for the current samples; what do we 
want for these new configs?


Diffs (updated)
-

  /branches/13/configs/examples/awesome/voicemail.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/pjsip.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/musiconhold.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/modules.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/logger.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/indications.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/extensions.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/asterisk.conf PRE-CREATION 
  /branches/13/configs/examples/awesome/README PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/4379/diff/


Testing
---

Setup Asterisk with configuration, connected up three phones using the first 
three users. Made calls between them all, left voicemails and retrieved them 
with all users. Verified MWI working with all phones.


Thanks,

rnewton

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

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

Re: [asterisk-dev] [Code Review] 4413: Testsuite: Simulate phones and control from YAML.

2015-02-12 Thread jbigelow

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4413/
---

(Updated Feb. 12, 2015, 6:27 p.m.)


Review request for Asterisk Developers and Mark Michelson.


Changes
---

Addressed all but one issue which I'm looking for feedback on.


Bugs: ASTERISK-24578
https://issues.asterisk.org/jira/browse/ASTERISK-24578


Repository: testsuite


Description
---

Pluggable modules to place, receive, and transfer (blind/attended) calls to 
simulate phones using PJSUA and YAML configuration. Calls are placed and/or 
transferred using the new pluggable action module. This should allow many 
currrent and future tests to easily send/receive calls to/from Asterisk along 
with transferring calls within YAML configuration.

The pluggable test module (phones.PjsuaPhoneController) initializes the PJSUA 
accounts and once all have registered, the account callbacks are setup and are 
ready to receive calls. The pluggable action module 
(pluggable_modules.PjsuaPhoneActionModule) provides the ability to place calls 
and transfer calls using the accounts from YAML and the action is referenced 
with 'pjsua_phone'. The only time a call is hung up by this is when a transfer 
is performed and a 200 OK sipfrag NOTIFY is received. None of the modules set a 
pass/fail result and are only for driving and manipulating calls.

See attached file for YAML demo.


Diffs (updated)
-

  /asterisk/trunk/lib/python/asterisk/pluggable_modules.py 6379 
  /asterisk/trunk/lib/python/asterisk/pjsua_mod.py 6379 
  /asterisk/trunk/lib/python/asterisk/phones.py PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/4413/diff/


Testing
---

* Tested placing calls, receiving calls, transfering via blind  attended.
* Pylint score of 9.40/10 for phones.py
* See attached test-config.yaml for a demonstration.


File Attachments


Demonstration
  
https://reviewboard.asterisk.org/media/uploaded/files/2015/02/11/659ab31f-8401-4f24-be5e-da1db0be3156__test-config.yaml


Thanks,

jbigelow

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

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

Re: [asterisk-dev] [Code Review] 4379: Example configuration scenario - Super Awesome Company: Phase 1 - Patch 1

2015-02-12 Thread rnewton

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4379/#review14456
---



/branches/13/configs/examples/awesome/extensions.conf
https://reviewboard.asterisk.org/r/4379/#comment24995

Re-phrase this and remove trailing whitespace.


- rnewton


On Feb. 13, 2015, 12:46 a.m., rnewton wrote:
 
 ---
 This is an automatically generated e-mail. To reply, visit:
 https://reviewboard.asterisk.org/r/4379/
 ---
 
 (Updated Feb. 13, 2015, 12:46 a.m.)
 
 
 Review request for Asterisk Developers.
 
 
 Repository: Asterisk
 
 
 Description
 ---
 
 One of things discussed at the last AstriDevCon was better documentation (for 
 everything!), but in particular, we mentioned needing some example 
 configurations that pertain to a real-world scenario. That is, as opposed to 
 the current sample files which are sort of all over the place at this point.
 
 This patch proposes a basic and minimal configuration of Asterisk to satisfy 
 the requirements for the first phase of Super Awesome Company's 
 implementation of Asterisk.
 
 I will submit four separate patches for the first phase, so that we don't 
 have to review the entire thing all at once. This review is for the first 
 patch.
 
 Who is Super Awesome Company? See 
 https://wiki.asterisk.org/wiki/display/AST/Super+Awesome+Company
 
 For the first patch, I am attempting to satisfy the below requirements. The 
 patch does not include a new make target, as I believe Matt Jordan offered to 
 handle that.
 
 SAC requires:
 
 * PJSIP connectivity for all employee desk phones.
 * The ability for employees to call one another inside of the office.
 * Voicemail boxes for each of the employees.
 
 Basic configuration
 
 We want SAC to have a clean system. That means:
 
 * No 'autoload' in modules.conf. Explicitly load a basic configuration. 
 If SAC doesn't need the module, don't load it.
 * Every module loaded should have a configuration file that is 
 appropriate for it. This includes all the 'core' things that need 
 configuration.
 
 pjsip.conf
 
 * A PJSIP configuration for their desk phones. Assume every endpoint that 
 is a phone has:
 * A voicemail mailbox that they can subscribe to
 * A hint for their device
 * Note that the PJSIP configuration should adhere to best practices. 
 That means MAC addresses for device names, etc.
 
 extensions.conf
 
 * A safe dialplan for intra-company communication. This should be 
 templated out so that it is trivial to add additional devices (use pattern 
 matching/pattern matching hints, etc.)
 * Receiving a Busy/Unavailable should result in going to VoiceMail
 * A user should be able to dial something and get to their VoiceMailMain 
 without having to enter in their extension number 
 * Note that mapping of MAC address endpoints to extension numbers should 
 be done in some fashion that is easily extensible.
 
 voicemail.conf
 
 * Set up mailboxes for every person in SAC. Assign 'default' pins. Create 
 reasonable basic settings.
 * Do not set up e-mail or pager addresses.
 
 
 REVIEW?
 
 Please, if possible look at this from a few angles:
 
  * Use the configuration, configure a couple phones and call between them. 
 Leave voicemails and retrieve them.
  * Have I created any security issues?
  * Is my dialplan easy to understand?
  * Could anything be done more efficiently without making it over-complicated?
  * Have I over-complicated anything?
  * Are there any critical settings I'm missing from any of the files?
 
 A couple, more specific questions:
 
  * We have sample configs in /configs/samples; what directory do we want 
 these configurations in? (I used /configs/examples for now, but I don't 
 really like it)
  * We have the make target make samples for the current samples; what do we 
 want for these new configs?
 
 
 Diffs
 -
 
   /branches/13/configs/examples/awesome/voicemail.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/pjsip.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/musiconhold.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/modules.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/logger.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/indications.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/extensions.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/asterisk.conf PRE-CREATION 
   /branches/13/configs/examples/awesome/README PRE-CREATION 
 
 Diff: https://reviewboard.asterisk.org/r/4379/diff/
 
 
 Testing
 ---
 
 Setup Asterisk with configuration, connected up three phones using the first 
 three users. Made calls between them all, left voicemails and retrieved them 
 with 

Re: [asterisk-dev] [Code Review] 4413: Testsuite: Simulate phones and control from YAML.

2015-02-12 Thread jbigelow


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, lines 86-88
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line86
 
  I think this is a good case for using is instead of equality. I 
  imagine that callers of this function are going to be passing a reference 
  to the same account object that is stored on the phone_obj rather than a 
  separate object with equivalent properties.
  
  Also, to avoid the continue statement, you can just use a positive 
  comparison instead of a negative one:
  
  if account is phone_obj.account:
  return phone_obj

Yup, that's what I meant to do :)


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, lines 115-117
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line115
 
  A couple of PEP 8 points:
  
  1) When catching exceptions, use the syntax except ErrorType as 
  ErrorInstance instead of except ErrorType, ErrorInstance. So here, it 
  would be except pj.Error as err
  
  2) A PEP 8 checker will complain about the indentation of str(err)) on 
  the final line I've highlighted. It will claim it should be lined up like 
  this:
  
  raise Exception(Exception occurred while making call: '%s' %
  str(err))
  
  See how str is lined up to show how it belongs to the parentheses?

I blame my python plugin for vim which just shifts twice. I installed the pep8 
utility which pointed out a couple others which I have also fixed.


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, line 156
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line156
 
  self.current_call doesn't seem to be used for anything.

Removed.


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, lines 190-191
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line190
 
  Should this only be done if self.phone is None? Seems like this would 
  be redundant after the initial setting.

That would make sense.


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, line 192
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line192
 
  I suspect it's not an issue, but is there ever a chance that self.call 
  could be None when the on_state() callback is called?

As far as I know self.call would never be None when a pjsua callback is called 
such as on_state().


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, lines 197-204
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line197
 
  This seems overly complicated for what you are trying to do here. Why 
  not just
  
  try:
  self.phone.calls.remove(self.call)
  except ValueError:
  # Log an error or something
  
  If that doesn't work because equality of calls doesn't evaluate as 
  you'd expect, then this is a situation where I expect that a single object 
  reference is being passed around everywhere rather than separate call 
  objects. You could take the approach of reconstructing the self.phone.calls 
  list like this:
  
  self.phone.calls = [call for call in self.phone.calls if call is not 
  self.call]

The first suggestion is actually what I initially was using. However I found 
that the call object wasn't always being removed from the list. Debugging 
showed the id() of self.call not matching any in the list which I believe is 
because self.call is set to weakref.proxy(call) in pjsua.CallCallback(). 
Comparing the SIP Call-ID of the call objects should be unique enough to find 
the one to remove from the list.


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, line 246
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line246
 
  This function's name is misleading because it does not actually log 
  anything. It should either
  
  1) Be renamed to something indicating that it is just gathering call 
  information into a string
  
  or
  
  2) Be altered to actually log the call info using LOGGER.debug()

Renamed.


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, line 270
  https://reviewboard.asterisk.org/r/4413/diff/1/?file=71348#file71348line270
 
  Can you add a comment about why the lock is being used here?

Fixed this by removing the locking :)

Apparently a lock isn't needed when making call. Unless perhaps a callback 
isn't passed and then set later using call.set_callback() but that's not the 
case here.


 On Feb. 12, 2015, 12:42 p.m., Mark Michelson wrote:
  /asterisk/trunk/lib/python/asterisk/phones.py, lines 272-275
  

Re: [asterisk-dev] Advanced feature query

2015-02-12 Thread Olle E. Johansson

On 12 Feb 2015, at 09:55, David Radcliffe david.radcli...@clockworkit.co.uk 
wrote:

 Hi,
  
 Does anyone know if Asterix has the ability to send a network message (TCP/IP 
 packet) indicating that a call is in progress through the PBX?
This is not really a question about asterisk development - so you are on the 
wrong mailing list. This mailing list is for developers of the asterisk source 
code.
  
 I need a message to say “pbx has at least one call in progress”,
 and another to say “pbx has no calls in progress” when it is idle.
Please check the asterisk management interface where you get events like this.

Regards
/Olle
  
 If it can do this, can someone please let me know how to configure Asterix to 
 do this.
  
 Thanks
  
 David W. Radcliffe
 Senior Developer
 image001.jpg
 Clockwork IT Ltd
 tel: 08448 040950
 mob: 07764 155251
 image002.jpg 
  WWW.SUPPORTDESKPRO.CO.UK
 image003.png  image004.pngimage005.jpg
 image006.gif
 Clockwork IT Ltd, Saturn Business Centre, 101 Lockhurst Lane, Coventry, CV6 
 5SF
 NOTICE-This message contains information intended only for the use of the 
 addressee named above. It may also be confidential and/or privileged. If you 
 are not the addressee, you should not disclose, copy, distribute, take any 
 action or rely on this E-mail and should notify us immediately by return 
 E-mail to i...@clockworkit.co.uk The views expressed in this communication 
 may not necessarily be the views held by Clockwork IT
  
 -- 
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-dev mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev

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

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

[asterisk-dev] Advanced feature query

2015-02-12 Thread David Radcliffe
Hi,

 

Does anyone know if Asterix has the ability to send a network message
(TCP/IP packet) indicating that a call is in progress through the PBX?

 

I need a message to say pbx has at least one call in progress,

and another to say pbx has no calls in progress when it is idle.

 

If it can do this, can someone please let me know how to configure Asterix
to do this.

 

Thanks

 

David W. Radcliffe

Senior Developer



Clockwork IT Ltd

tel: 08448 040950

mob: 07764 155251

 

  http://www.supportdeskpro.co.uk/ WWW.SUPPORTDESKPRO.CO.UK

 
http://www.linkedin.com/company/clockwork-it-ltd?trk=fc_badge%22%3e%3cimg%2
0src=%22http://static01.linkedin.com/scds/common/u/img/webpromo/btn_cofollow
_badge.png%22%20locale=%22en%22%20alt=%22Clockwork%20IT%20Ltd%20on%20LinkedI
n%22%3e%3c/ahttp://twitter.com/ClockworkIT
http://facebook.com/pages/Clockwork-It/104091779694342 

 callto://david.radcliffe/ 

Clockwork IT Ltd, Saturn Business Centre, 101 Lockhurst Lane, Coventry, CV6
5SF

NOTICE-This message contains information intended only for the use of the
addressee named above. It may also be confidential and/or privileged. If you
are not the addressee, you should not disclose, copy, distribute, take any
action or rely on this E-mail and should notify us immediately by return 
E-mail to  mailto:i...@clockworkit.co.uk i...@clockworkit.co.uk The views
expressed in this communication may not necessarily be the views held by
Clockwork IT

 

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

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

Re: [asterisk-dev] Reject incoming call

2015-02-12 Thread Raj Roy Ghandhi
Hi,
Thanks for the response.
no one going to answer this call. We treat it as miss call.
we catch the CLI, call AGI to execute .sjp and hangup.

Regrads,
Roy

On Thu, Feb 12, 2015 at 5:14 PM, bala murugan fightwit...@gmail.com wrote:

 Who is responsible to answer ??
 On Feb 12, 2015 6:05 AM, Raj Roy Ghandhi roy.gan...@gmail.com wrote:

 Hi Friends,

 I am trying to implement a simple dial plan with asterisk.
 1. Ring the inbound call
 2. wait for 2 seconds
 3. call agi script with cli
 4. hangup

 But when it gets hangup I see the Declined is passed from the asterisk.
 But my PSTN provider keep waiting in dialing state with no noise until 60
 seconds.

 any idea what I have done wrong.

 here is my dial plan

 exten = 01,1,Ringing()
 exten = 01,2,Wait(2)
 exten =
 01,3,Set(vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=${CALLERID(num)})
 exten = 01,4,Agi(agi://127.0.0.1/url=${vxmlurl}
 http://127.0.0.1/url=$%7Bvxmlurl%7D)
 exten = 01,5,Hangup()

 Please advice,

 Best Regards,
 Roy.

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

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


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

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

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

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

Re: [asterisk-dev] Reject incoming call

2015-02-12 Thread Raj Roy Ghandhi
Hi Pavel,
Thanks for the reply,
I tried with Hangup(16) but same result

what I get in console is

 -- Executing [01XXX@public:1] Ringing(SIP/10.2.2.75-0004, ) in
new stack
-- Executing [01XXX@public:2] Wait(SIP/10.2.2.75-0004, 1)
in new stack
-- Executing [01XXX@public:3] Set(SIP/10.2.2.75-0004,
vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=07XX) in
new stack
-- Executing [01XXX@public:4] AGI(SIP/10.2.2.75-0004, agi://
127.0.0.1/url=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=07XX)
in new stack
-- SIP/10.2.2.75-0004AGI Script agi://
127.0.0.1/url=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=07XX
completed,
returning 4
[Feb 13 10:25:24] ERROR[10111][C-0004]: utils.c:1321 ast_carefulwrite:
write() returned error: Broken pipe


--- Reliably Transmitting (no NAT) to 11.200.1.53:9131 ---
SIP/2.0 603 Declined
Via: SIP/2.0/UDP 11.200.1.53:9131
;branch=z9hG4bKkcw3bikyw336f07x6xt6wbbc6;received=10.200.1.53
From: sip:07XX@11.2.2.75;user=phone;tag=sbc0403xbxkbx6w-CC-22
To: sip:01XXX@11.2.2.75;user=phone;tag=as02deb6c4
Call-ID: isbcyc60z60kyw17fk6e1y36i7ey7tz33y3i@SoftX3000
CSeq: 1 INVITE
Server: Asterisk PBX 11.8.0
Allow: INVITE, ACK, CANCEL, OPTIONS, BYE, REFER, SUBSCRIBE, NOTIFY, INFO,
PUBLISH
Supported: replaces, timer
Content-Length: 0




--- SIP read from UDP:11.200.1.53:9131 ---
ACK sip:01XXX@11.2.2.75:5060;user=phone SIP/2.0
Via: SIP/2.0/UDP 11.200.1.53:9131
;branch=z9hG4bKkcw3bikyw336f07x6xt6wbbc6;received=11.200.1.53
Call-ID: isbcyc60z60kyw17fk6e1y36i7ey7tz33y3i@SoftX3000
From: sip:07XX@11.2.2.75;user=phone;tag=sbc0403xbxkbx6w-CC-22
To: sip:01XXX@11.2.2.75;user=phone;tag=as02deb6c4
CSeq: 1 ACK
Max-Forwards: 70
Content-Length: 0

I am running Asterisk 11.8.0 with voiceglue 0.14

When I try the .jsp page with wget, it works fine without any error.

Regards,
Roy.


On Thu, Feb 12, 2015 at 4:58 PM, Pavel Troller pat...@sinus.cz wrote:

 Hi Roy,

  Hi Friends,
 
  I am trying to implement a simple dial plan with asterisk.
  1. Ring the inbound call
  2. wait for 2 seconds
  3. call agi script with cli
  4. hangup
 
  But when it gets hangup I see the Declined is passed from the asterisk.
  But my PSTN provider keep waiting in dialing state with no noise until 60
  seconds.
 
  any idea what I have done wrong.
 
  here is my dial plan
 
  exten = 01,1,Ringing()
  exten = 01,2,Wait(2)
  exten =
 
 01,3,Set(vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=${CALLERID(num)})
  exten = 01,4,Agi(agi://127.0.0.1/url=${vxmlurl})
  exten = 01,5,Hangup()

 Did you try to put a specific Clear Cause code to the Hangup command ?
 For example, Hangup(17) means User Busy, i.e. 486 Busy Here on SIP, or
 Hangup(1) means Unallocated Number or 404 Not Found etc. If you want to
 find more codes, search for ISDN Cause Codes. Your PSTN provider will
 probably react better to other causes than the default one, which is
 probably 16 Normal Call Clearing.

 With regards,
   Pavel

 
  Please advice,
 
  Best Regards,
  Roy.


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

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

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

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

Re: [asterisk-dev] [Code Review] 4413: Testsuite: Simulate phones and control from YAML.

2015-02-12 Thread jbigelow

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4413/
---

(Updated Feb. 12, 2015, 10:25 a.m.)


Review request for Asterisk Developers and Mark Michelson.


Bugs: ASTERISK-24578
https://issues.asterisk.org/jira/browse/ASTERISK-24578


Repository: testsuite


Description (updated)
---

Pluggable modules to place, receive, and transfer (blind/attended) calls to 
simulate phones using PJSUA and YAML configuration. Calls are placed and/or 
transferred using the new pluggable action module. This should allow many 
currrent and future tests to easily send/receive calls to/from Asterisk along 
with transferring calls within YAML configuration.

The pluggable test module (phones.PjsuaPhoneController) initializes the PJSUA 
accounts and once all have registered, the account callbacks are setup and are 
ready to receive calls. The pluggable action module 
(pluggable_modules.PjsuaPhoneActionModule) provides the ability to place calls 
and transfer calls using the accounts from YAML and the action is referenced 
with 'pjsua_phone'. The only time a call is hung up by this is when a transfer 
is performed and a 200 OK sipfrag NOTIFY is received. None of the modules set a 
pass/fail result and are only for driving and manipulating calls.

See attached file for YAML demo.


Diffs
-

  /asterisk/trunk/lib/python/asterisk/pluggable_modules.py 6379 
  /asterisk/trunk/lib/python/asterisk/pjsua_mod.py 6379 
  /asterisk/trunk/lib/python/asterisk/phones.py PRE-CREATION 

Diff: https://reviewboard.asterisk.org/r/4413/diff/


Testing
---

* Tested placing calls, receiving calls, transfering via blind  attended.
* Pylint score of 9.40/10 for phones.py
* See attached test-config.yaml for a demonstration.


File Attachments


Demonstration
  
https://reviewboard.asterisk.org/media/uploaded/files/2015/02/11/659ab31f-8401-4f24-be5e-da1db0be3156__test-config.yaml


Thanks,

jbigelow

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

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

Re: [asterisk-dev] DNS Support in Asterisk

2015-02-12 Thread Brad Watkins
Looking at this, I'm inclined to say that libunbound is the better of
the two options in spite of it being somewhat more difficult to
consume DNS records than it would be with c-ares.  In my estimation a
(seemingly?) more-active community and the inclusion of a cache are
more important.  DNSSEC isn't a huge deal, at least not for me at this
time, but is a nice bonus as well.

- Brad

On Thu, Feb 12, 2015 at 10:01 AM, Joshua Colp jc...@digium.com wrote:
 Greetings all,

 I've extended the sections of my wiki page for c-ares[1] and libunbound[2]
 to include further information about documentation, general usage
 experience, and other aspects. Personally I lean towards libunbound because
 it was straight forward to experiment with, supports DNSSEC, and has a
 cache.

 Cheers,

 [1]
 https://wiki.asterisk.org/wiki/display/~jcolp/DNS+Support+in+Asterisk#DNSSupportinAsterisk-c-ares
 [2]
 https://wiki.asterisk.org/wiki/display/~jcolp/DNS+Support+in+Asterisk#DNSSupportinAsterisk-libunbound


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

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

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

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

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


Re: [asterisk-dev] DNS Support in Asterisk

2015-02-12 Thread Joshua Colp

Greetings all,

I've extended the sections of my wiki page for c-ares[1] and 
libunbound[2] to include further information about documentation, 
general usage experience, and other aspects. Personally I lean towards 
libunbound because it was straight forward to experiment with, supports 
DNSSEC, and has a cache.


Cheers,

[1] 
https://wiki.asterisk.org/wiki/display/~jcolp/DNS+Support+in+Asterisk#DNSSupportinAsterisk-c-ares
[2] 
https://wiki.asterisk.org/wiki/display/~jcolp/DNS+Support+in+Asterisk#DNSSupportinAsterisk-libunbound


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

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

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


Re: [asterisk-dev] DNS Support in Asterisk

2015-02-12 Thread Olle E. Johansson
There is one version of c-ares in resiprocate as well.

C-ares has been in use for a long time and is in use every single day for you 
as part of 
most curl installs. I am not sure there is much to do there.

Libunbound adds a lot if that is what we want.

Why is a cache a good thing? You surely have a caching resolver running
on your system, right?

DNSsec is a huge deal - and the foundation for a lot of security things coming 
up.
Someone wrote an IETF draft about that and SIP.

https://tools.ietf.org/html/draft-johansson-sipcore-dane-sip-00

I got a patch sent to me that implements that in Asterisk with unbound,
but haven't gotten time to go through it and test it.

/O

On 12 Feb 2015, at 16:25, Brad Watkins marqui...@gmail.com wrote:

 Looking at this, I'm inclined to say that libunbound is the better of
 the two options in spite of it being somewhat more difficult to
 consume DNS records than it would be with c-ares.  In my estimation a
 (seemingly?) more-active community and the inclusion of a cache are
 more important.  DNSSEC isn't a huge deal, at least not for me at this
 time, but is a nice bonus as well.
 
 - Brad
 
 On Thu, Feb 12, 2015 at 10:01 AM, Joshua Colp jc...@digium.com wrote:
 Greetings all,
 
 I've extended the sections of my wiki page for c-ares[1] and libunbound[2]
 to include further information about documentation, general usage
 experience, and other aspects. Personally I lean towards libunbound because
 it was straight forward to experiment with, supports DNSSEC, and has a
 cache.
 
 Cheers,
 
 [1]
 https://wiki.asterisk.org/wiki/display/~jcolp/DNS+Support+in+Asterisk#DNSSupportinAsterisk-c-ares
 [2]
 https://wiki.asterisk.org/wiki/display/~jcolp/DNS+Support+in+Asterisk#DNSSupportinAsterisk-libunbound
 
 
 --
 Joshua Colp
 Digium, Inc. | Senior Software Developer
 445 Jan Davis Drive NW - Huntsville, AL 35806 - US
 Check us out at: www.digium.com  www.asterisk.org
 
 --
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-dev mailing list
 To UNSUBSCRIBE or update options visit:
  http://lists.digium.com/mailman/listinfo/asterisk-dev
 
 -- 
 _
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-dev mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-dev


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

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


Re: [asterisk-dev] Reject incoming call

2015-02-12 Thread Matthew Jordan
On Thu, Feb 12, 2015 at 5:44 AM, bala murugan fightwit...@gmail.com wrote:

 Who is responsible to answer ??
 On Feb 12, 2015 6:05 AM, Raj Roy Ghandhi roy.gan...@gmail.com wrote:

 Hi Friends,

 I am trying to implement a simple dial plan with asterisk.
 1. Ring the inbound call
 2. wait for 2 seconds
 3. call agi script with cli
 4. hangup

 But when it gets hangup I see the Declined is passed from the asterisk.
 But my PSTN provider keep waiting in dialing state with no noise until 60
 seconds.

 any idea what I have done wrong.

 here is my dial plan

 exten = 01,1,Ringing()
 exten = 01,2,Wait(2)
 exten =
 01,3,Set(vxmlurl=http%3A%2F%2F127.0.0.1:8080%2Ftest%2Findex.jsp?ani=${CALLERID(num)})
 exten = 01,4,Agi(agi://127.0.0.1/url=${vxmlurl}
 http://127.0.0.1/url=$%7Bvxmlurl%7D)
 exten = 01,5,Hangup()

 Please advice,

 Best Regards,
 Roy.


This question belongs on asterisk-users [1]. You're far more likely to get
help there than on the asterisk-dev mailing list, which is used to discuss
the actual source code and development of Asterisk.

[1] http://lists.digium.com/mailman/listinfo/asterisk-users

-- 
Matthew Jordan
Digium, Inc. | Engineering Manager
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA
Check us out at: http://digium.com  http://asterisk.org
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

Re: [asterisk-dev] [Code Review] 4408: Testsuite: Add external bridging tests for Stasis (two channel) interactions

2015-02-12 Thread jbigelow

---
This is an automatically generated e-mail. To reply, visit:
https://reviewboard.asterisk.org/r/4408/
---

(Updated Feb. 12, 2015, 10:48 a.m.)


Status
--

This change has been marked as submitted.


Review request for Asterisk Developers and Mark Michelson.


Changes
---

Committed in revision 6389


Bugs: ASTERISK-24611
https://issues.asterisk.org/jira/browse/ASTERISK-24611


Repository: testsuite


Description
---

This adds external bridging tests for Stasis (two channel) interactions as 
defined on the StasisStart/StasisEnd Test Plan (tests 2.5, 2.6, 2.7, and 2.8) 
at: 
https://wiki.asterisk.org/wiki/pages/viewpage.action?pageId=30279826#StasisStart/StasisEndTestplan-ExternalBridging

This also renames (move to sub directory) the test 
'tests/rest_api/external_interaction/ami_bridge/stasis_app/' to 
'tests/rest_api/external_interaction/ami_bridge/stasis_app/non_stasis_app/'.

NOTE: The files for the renamed test don't appear just because of how things 
work.


Diffs
-

  /asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/tests.yaml 
6377 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/two_channel_same_stasis_app/test-config.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/two_channel_same_stasis_app/configs/ast1/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/two_channel_different_stasis_app/test-config.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/two_channel_different_stasis_app/configs/ast1/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_bridge/tests.yaml
 6377 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/two_channel_same_stasis_app/test-config.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/two_channel_same_stasis_app/configs/ast1/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/two_channel_different_stasis_app/test-config.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/two_channel_different_stasis_app/configs/ast1/extensions.conf
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/tests.yaml
 PRE-CREATION 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/test-config.yaml
 6377 
  
/asterisk/trunk/tests/rest_api/external_interaction/ami_bridge/stasis_app/configs/ast1/extensions.conf
 6377 

Diff: https://reviewboard.asterisk.org/r/4408/diff/


Testing
---

* Executed each test in a loop of 100 iterations with no failures.
* Reviewed logs to ensure the tests were executing as expected.


Thanks,

jbigelow

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

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