Re: [asterisk-users] multiple softphone clients and same/different account credentials

2019-11-27 Thread C.Maj
On 2019-11-26 20:05, Greg Troxel wrote:
> "C.Maj"  writes:
> 
>> Another option for a patch would be to extend the PJSIP_DIAL_CONTACTS
>> function with an argument such as 'please' to minimally return the
>> endpoint name in a Dialable format when no reachable contacts are found
>> eg. "PJSIP/bar" -- instead of the current empty string, which is not
>> Dialable.
> 
> I thought of that also while considering if patching the way Dial
> behaves was feasible.  I think you are right that having
> PJSIP_DIAL_CONTACTS reduce to a single PJSIP/aor string will follow the
> principle of least astonishment.

Thanks, I put together a patch:

https://issues.asterisk.org/jira/browse/ASTERISK-28638

>> Also the empty string is somewhat in conflict with the Synopsis "Return
>> a dial string for dialing all contacts on an AOR." (Maybe add " Or
>> returns empty string if no reachable contacts. Do not Dial directly." ?)
>>
>> Regardless of patch status, I'd recommend looking at the PUSH function
>> to build up the dial list one line item at a time -- please pardon the
>> AEL format on my example:
>>
>>   Set(rgrp=);
>>   Set(PUSH(rgrp,&)=PJSIP/foo);
>>   Set(PUSH(rgrp,&)=PJSIP/baz);
>>   if( "${PJSIP_DIAL_CONTACTS(bar)}" != "" ) {
>> Set(PUSH(rgrp,&)=${PJSIP_DIAL_CONTACTS(bar)});
>>   }
>>   Dial(${rgrp});
> 
> That looks workable.  Is there a multiprocessing hazard here?  Could
> ${PJSIP_DIAL_CONTACTS(bar)} change between check and use.

Yes, if you put the Dial() further away, maybe after a Wait(), then it
could be a problem. But in this example, it is not going to be that much
slower than more 'direct' substitution Dial(${PJSIP_DIAL_CONTACTS(bar)})
because either way the PJSIP_DIAL_CONTACTS function is being evaluated
first and separately from the Dial() application itself. The application
only sees the results of the function.

Kind Regards,

-- 
鸞 C. Maj, Technology Captain @ Penguin PBX Solutions
 USA Toll Free 1-833-PNGNPBX (1-833-764-6729)
酪 International & SMS Texting +1.720.32.42.72.9
 Visit on the World Wide Web at PENGUINPBX.COM

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] Faxes stopped working - AMI issue?

2019-11-27 Thread D'Arcy Cain
I recently upgraded from Asterisk 13.19 to 16.6.1.  Everything is
working fine with a few minor tweaks except outgoinf fax.  Incoming
works fine.

I do outgoing faxing through an AMI call.  Here is the output from the
security log:

[Nov 27 06:16:05] SECURITY[101222] res_security_log.c:
SecurityEvent="ChallengeSent",EventTV="2019-11-27T06:16:05.566-0500",Severity="Informational",Service="SIP",EventVersion="1",AccountID="alex",SessionID="0x80ba54820",LocalAddress="IPV4/UDP/98.158.139.74/5060",RemoteAddress="IPV4/UDP/72.143.94.110/5060",Challenge="215351b4"
[Nov 27 06:16:05] SECURITY[101222] res_security_log.c:
SecurityEvent="SuccessfulAuth",EventTV="2019-11-27T06:16:05.591-0500",Severity="Informational",Service="SIP",EventVersion="1",AccountID="alex",SessionID="0x80ba54820",LocalAddress="IPV4/UDP/98.158.139.74/5060",RemoteAddress="IPV4/UDP/72.143.94.110/5060",UsingPassword="1"

So I know that AMI is listening and I can talk to it.  Here is the main log"

[Nov 27 06:16:00] VERBOSE[101155] asterisk.c: Remote UNIX connection
[Nov 27 06:16:00] VERBOSE[101245] asterisk.c: Remote UNIX connection
disconnected
[Nov 27 06:16:01] VERBOSE[101244] manager.c: Manager 'asterisk' logged
on from 127.0.0.1

The AMI command, after the login, looks like this:

Action: Originate
Channel: SIP/outgoing/%%(destination)s
Context: LocalSets
CallerID: Vybe Consulting Inc Fax Service <551212>
Exten: sendfax
Priority: 1
Timeout: 3
Variable: faxfile=%%(faxfile)s
Variable: uid=%%(uid)s
Variable: destination=%%(destination)s
Variable: sender_name=Vybe Consulting Inc Fax Service
Variable: sender_num=551212

Those "%%" strings get replaced by real data.  My sendfax extension has
a bunch of stuff but the very first line is this:

exten => sendfax,1,Verbose(0,FAX ${faxfile} to ${destination})

So, regardless of what follows, shouldn't I be seeing that message in my
logs?

-- 
D'Arcy J.M. Cain
Vybe Networks Inc.
A unit of Excelsior Solutions Corporation - Propelling Business Forward
http://www.VybeNetworks.com/
IM:da...@vex.net VoIP: sip:da...@vybenetworks.com

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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

Re: [asterisk-users] Avoid transcoding if both ends support same coded

2019-11-27 Thread Joshua C. Colp
On Tue, Nov 26, 2019 at 12:11 PM Benoit Panizzon 
wrote:

> Hi Gang
>
> I offer:
>
> g722
> g711a
>
> g711a is mandatory. g722 is becoming more and more popular.
>
> Now if a call originates from a device which support g722 and ends on a
> device which does not. I see that asterisk is transcoding between g722
> and g711a despite both ends supporting g711a.
>
> Google tells me, that in this scenario asterisk should have selected
> g711a as this is the codec common for both sides.
>
> So why is my asterisk instance choosing to transcode instead of trying
> to natively and even remotely bridge the calls?
>
> I have nothing in the dial plan which would force asterisk to listen to
> the audio and I have set direct_media=yes on both endpoints.
>

Each call leg is independently negotiated, from Asterisk to the device.
This can yield results such as what you are seeing. There have been
requests to improve this, but noone has taken that on as a project because
it's not as easy as one would initially think (you have to define
configuration options to define behavior in scenarios, go through
everything making it aware, etc).

-- 
Joshua C. Colp
Senior Software Developer
Sangoma Technologies
Check us out at www.sangoma.com
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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