[asterisk-users] Quick patch for updated NL-ips

2023-08-22 Thread Dirk-Willem van Gulik
Thanks to those on IRC confirming quickly that this was not something supported 
(yet) in Asterisk.

Below is a quick fix/patch to tcptls.c for Asterisk 18 against this particular 
provider.

Dw


static int check_tcptls_cert_name(ASN1_STRING *cert_str, const char *hostname, 
const char *desc)
{
unsigned char *str;
int ret;

ret = ASN1_STRING_to_UTF8(, cert_str);
if (ret < 0 || !str) {
return -1;
}

if (strlen((char *) str) != ret) {
ast_log(LOG_WARNING, "Invalid certificate %s length (contains 
NULL bytes?)\n", desc);

ret = -1;
} else if (!strcasecmp(hostname, (char *) str)) {
ret = 0;
} else if (strlen(str) > 2 && str[0] == '*' && str[1] == '.' && 
strlen(str) - 2 <= strlen(hostname) && 
strcasecmp(hostname+strlen(hostname)-strlen(str)+2, str+2) == 0) {
ast_log(LOG_WARNING,"Warning: allowing match on wildcard (%s =~ 
%s)\n", hostname, str);
ret = 0;
} else {
ret = -1;
}

ast_debug(3, "SSL %s compare s1='%s' s2='%s'\n", desc, hostname, str);
OPENSSL_free(str);

return ret;
}



-- 
_
-- 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] Question about Sip Trunks who support Stir Shaken

2023-08-21 Thread Dirk-Willem van Gulik

> On 18 Aug 2023, at 04:50, Federico  wrote:
> 
> I am looking for a decent provider of SIP Trunks but it has to pass the Stir 
> Shaken token to the next carrier. Does anybody know about any? Sipstation 
> from Sangoma, does not support Stir Shaken. ( Case #01466843 / 
> 001300G8PLG / MAIN / Open [ ref:_00D306mPe._5004U1BlBLF:ref ])
> 
> 
> 
I’d try Telnyx - where this works for me. 

And their online SIP debugging tool is second to none. Absolutely excels at 
finding issues with this sort of stuff. 

Dw. -- 
_
-- 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] Parallel dialoog with different Alert-Info headers

2023-07-23 Thread Dirk-Willem van Gulik


> On 23 Jul 2023, at 19:02, aster...@phreaknet.org wrote:
> 
> On 7/23/2023 12:32 PM, Dirk-Willem van Gulik wrote:
>>> On 22 Jul 2023, at 23:40, aster...@phreaknet.org wrote:
>>> 
>>> I'm assuming you mean at the device level, and that you want to send only 
>>> the relevant header to each device?
>>> Use pre-dial handlers; a unique handler runs on each destination channel. 
>>> With PJSIP, you're forced to do this anyways, but SIPAddHeader adds these 
>>> to the calling channel first, which explains the problem you have now.
>> 
>> Aye - problem is - I have some 79XX phones for which I am very reliant on 
>> functionality from https://usecallmanager.nz/documentation-overview.html 
>> that is not in PJSIP.
> 
> I hear you... you're not the first person that's told me that. It's one of 
> the top reasons I hear for staying on chan_sip.
> Unfortunately, the author of those patches hasn't expressed interest in 
> porting the functionality to PJSIP due to some misconceptions about PJSIP 
> development. Some of it I might take a stab at to allow some of my users to 
> move over, but not until outstanding patches have cleared; I have some of 
> these phones but don't really use them, so it's lower on my priority list.

Aye - no worries - it is what it is & there is a moment that either enough 
people want to scratch the itch its of adding the functionality to PJSIP -- or 
that these phones naturally fade into history.

That is always the problem with things that are stable and good enough. 

With kind regards,

Dw.


-- 
_
-- 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] Parallel dialoog with different Alert-Info headers

2023-07-23 Thread Dirk-Willem van Gulik


> On 22 Jul 2023, at 23:40, aster...@phreaknet.org wrote:
> 
> On 7/22/2023 4:51 PM, Dirk-Willem van Gulik wrote:
>> We have a couple of parallel ring settings (and this has worked well for 
>> eons).
>> 
>> Either in the form of
>> 
>>  same => n,Dial(SIP/1001 & SIP/1002 & SIP/1003 …..)
>> 
>> Or via a subroutine (below) that has a bit of extra logic:
>> 
>>  FOO = 1010 & 1019 & 1017 & 1033
>>  ...
>>  same => n,gosub(sub-callout,s,1,(${FOO},”Ringing all class FOO 
>> telefons"))
>> 
>> Now I have two types of phones (different) era’s that require slightly 
>> different Alert-Info headers.
>> 
>> How can one introduce a layer of indirection at phone (extension) level that 
>> adds those headers ?
> I'm assuming you mean at the device level, and that you want to send only the 
> relevant header to each device?
> Use pre-dial handlers; a unique handler runs on each destination channel. 
> With PJSIP, you're forced to do this anyways, but SIPAddHeader adds these to 
> the calling channel first, which explains the problem you have now.

Aye - problem is - I have some 79XX phones for which I am very reliant on 
functionality from https://usecallmanager.nz/documentation-overview.html that 
is not in PJSIP.

> How you determine the right header to send on each channel is something you 
> still need to do. For example, you could detect the user agent in your 
> pre-dial handler and add the appropriate header. This is a common enough 
> scenario for things like setting the ring cadence that I wrote an application 
> to handle this for me.

OK - that is not quite as neat as I had hoped - but perfectly doable. And easy 
to wrap.

Thanks,

Dw.-- 
_
-- 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] Parallel dialoog with different Alert-Info headers

2023-07-22 Thread Dirk-Willem van Gulik
We have a couple of parallel ring settings (and this has worked well for eons).

Either in the form of

same => n,Dial(SIP/1001 & SIP/1002 & SIP/1003 …..)

Or via a subroutine (below) that has a bit of extra logic:

FOO = 1010 & 1019 & 1017 & 1033
...
same => n,gosub(sub-callout,s,1,(${FOO},”Ringing all class FOO 
telefons"))

Now I have two types of phones (different) era’s that require slightly 
different Alert-Info headers.

How can one introduce a layer of indirection at phone (extension) level that 
adds those headers ?

E.g. something like above 1010 mapping to

; map internal virtual number to the real SIP dial
[1010]
..  SIPAddHeader(Alert-Info: 
\;info=alert-internal)
..  Dail(SIP/2010)

But still have the phones all ring in parallel. Any and all suggestions welcome.

With kind regards,

Dw.





[sub-callout]
exten =>s, 1,Log(NOTICE, Ringing ${ARG2})
same => n,Set(DIALGROUP(allgroup)=)
same => n,While($[${LEN(${ARG1})} != 0])
same => n,Set(PEERNAME=${SHIFT(ARG1,&)})
   ; Skip any peer that is currently not connected
same => n,ExecIf($[0${SIPPEER(${PEERNAME},port)} != 
0]?Set(DIALGROUP(allgroup,add)=SIP/${PEERNAME}))
same => n,EndWhile()
   ; Play congestion tone if there are no peers connected 
in this list
same => n,ExecIf($[${LEN(${DIALGROUP(allgroup)})} = 
0]?Congestion(10))
same => n,Log(Notice, to ${DIALGROUP(allgroup)})
   ; For the 95XX phones; prevent a ‘missed call’ entry.
same => n,Set(_CISCO_HUNTPILOT="Ring All" <${EXTEN}>)
same => n,Dial(${DIALGROUP(allgroup)},120,ic)
same => n,Hangup()
same => n,Return()


-- 
_
-- 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