Re: [asterisk-users] pjsip: Inbound calls: selecting the correct trunk with one provider and different numbers

2017-06-09 Thread Joshua Colp
On Fri, Jun 9, 2017, at 03:44 PM, Michael Maier wrote:



> 
> Further investigation showed, that Telekom provides the line info in the
> Request Line (as seen by Wireshark):
> 
> Request-Line: INVITE sip:+49@46.37.15.4:5060;line=azpreyb SIP/2.0
> 
> You can't find it if you expect it in contact header - or do you expect
> it in the Request-Line?

Recent code checks the To URI and the Request URI.

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

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] pjsip: Inbound calls: selecting the correct trunk with one provider and different numbers

2017-06-09 Thread Michael Maier
On 06/09/2017 at 08:44 PM Michael Maier wrote:
> On 06/08/2017 at 10:22 PM Michael Maier wrote:
>> Hello Joshua,
>>
>> thank you very much for your extremely quick answer! I really appreciate
>> your work and your friendly and your patient support!
>>
>>
>> On 06/07/2017 at 10:33 PM, Joshua Colp wrote:
>>> On Wed, Jun 7, 2017, at 05:28 PM, Michael Maier wrote:
 Hello!

 I've got a problem to select the correct trunk if there is one provider
 and different numbers with different configurations for this same
 provider.

 Example:

 trunk-prov1-2345
 trunk-prov1-2346
 trunk-prov1-2347

 Each trunk registers an own number (at the same provider) and provides
 own configuration: they have different allowed codecs e.g..

 What I'm experiencing now, is, that each incoming call is provided by
 trunk-prov1-2346, no matter which number has been dialed.

 The problem isn't the routing (this is done on base of the correct DID),
 but the problem is, that wrong codices are used if the wrong trunk is
 selected.

 Is this a problem of asterisk or is it caused by the provider, which
 always addresses the same "trunk" regardless which number has been
 called?
>>>
>>> Asterisk is the one who associates an incoming message with an endpoint.
>>> In the case of providers you can use IP based matching - which would
>>> behave as you see, only one can be matched. The second option is the
>>> line option[1] which may or may not work (it depends on the behavior of
>>> the provider). If it works then the right endpoint would be chosen. Out
>>> of those two options there's nothing else applicable built in to match.
>>>
>>> [1]
>>> http://blogs.asterisk.org/2016/01/27/the-pjsip-outbound-registration-line-option/
>>>
>>
>> Unfortunately Deutsche Telekom doesn't support this solution :-(.
> 
> Further investigation showed, that Telekom provides the line info in the
> Request Line (as seen by Wireshark):
> 
> Request-Line: INVITE sip:+49@46.37.15.4:5060;line=azpreyb SIP/2.0
> 
> You can't find it if you expect it in contact header - or do you expect
> it in the Request-Line?

Ok - got it.

It's necessary, that the value given for endpoint= is exactly the same
name as used for the trunk name itself and the match option for this
trunk should be omitted completely.


Thanks,
Michael

-- 
_
-- 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] pjsip: Inbound calls: selecting the correct trunk with one provider and different numbers

2017-06-09 Thread Michael Maier
On 06/08/2017 at 10:22 PM Michael Maier wrote:
> Hello Joshua,
> 
> thank you very much for your extremely quick answer! I really appreciate
> your work and your friendly and your patient support!
> 
> 
> On 06/07/2017 at 10:33 PM, Joshua Colp wrote:
>> On Wed, Jun 7, 2017, at 05:28 PM, Michael Maier wrote:
>>> Hello!
>>>
>>> I've got a problem to select the correct trunk if there is one provider
>>> and different numbers with different configurations for this same
>>> provider.
>>>
>>> Example:
>>>
>>> trunk-prov1-2345
>>> trunk-prov1-2346
>>> trunk-prov1-2347
>>>
>>> Each trunk registers an own number (at the same provider) and provides
>>> own configuration: they have different allowed codecs e.g..
>>>
>>> What I'm experiencing now, is, that each incoming call is provided by
>>> trunk-prov1-2346, no matter which number has been dialed.
>>>
>>> The problem isn't the routing (this is done on base of the correct DID),
>>> but the problem is, that wrong codices are used if the wrong trunk is
>>> selected.
>>>
>>> Is this a problem of asterisk or is it caused by the provider, which
>>> always addresses the same "trunk" regardless which number has been
>>> called?
>>
>> Asterisk is the one who associates an incoming message with an endpoint.
>> In the case of providers you can use IP based matching - which would
>> behave as you see, only one can be matched. The second option is the
>> line option[1] which may or may not work (it depends on the behavior of
>> the provider). If it works then the right endpoint would be chosen. Out
>> of those two options there's nothing else applicable built in to match.
>>
>> [1]
>> http://blogs.asterisk.org/2016/01/27/the-pjsip-outbound-registration-line-option/
>>
> 
> Unfortunately Deutsche Telekom doesn't support this solution :-(.

Further investigation showed, that Telekom provides the line info in the
Request Line (as seen by Wireshark):

Request-Line: INVITE sip:+49@46.37.15.4:5060;line=azpreyb SIP/2.0

You can't find it if you expect it in contact header - or do you expect
it in the Request-Line?


Regards,
Michael

-- 
_
-- 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] Upgraded server crashes on voicemail storage

2017-06-09 Thread Adrian Serafini



On 06/09/2017 12:37 PM, Mike Diehl wrote:

Well, I guess my assumption has been proven wrong. It is NOT the odbc drive.

I recompiled Asterisk w/o odbc voicemail storage and I'm still getting

crashes when someone leave voicemail.


This is probably not it BUT.  A long time ago, voicemail lost it's mind 
when codecs were changed and they did not exist in the config file. 
Maybe the config file was changed during the upgrade?


Maybe test it with a fresh voicemail db?

Adrian Serafini

--
_
-- 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] Upgraded server crashes on voicemail storage

2017-06-09 Thread Mike Diehl
Well, I guess my assumption has been proven wrong.  It is NOT the odbc drive.
I recompiled Asterisk w/o odbc voicemail storage and I'm still getting 
crashes when someone leave voicemail.

I tried to run strace on the server, but didn't get much:

=
voip11 ~ # ps -auxw | grep asterisk
root  9339  0.0  0.0   9604  2548 ?Ss   10:35   0:00 /bin/sh 
/home/phones/commands/safe_asterisk
root  9346 13.1 10.9 104155439880 443704 ? Sl   10:35   0:13 
/usr/sbin/asterisk -v
root  9480  0.0  0.0  12824  2372 pts/11   S+   10:36   0:00 grep 
--colour=auto asterisk
root 11129  0.0  0.2 104153027592 10600 pts/6 S+ Jun07   0:08 rasterisk 
Rv

voip11 ~ # strace -p 9346
strace: Process 9346 attached
restart_syscall(<... resuming interrupted poll ...>

=

So, if I could find out what syscall was being interrupted That MIGHT 
tell me what was wrong, but this is all I get from strace.

Any ideas would be welcome.

Mike.

On Wednesday, June 07, 2017 04:34:10 PM Mike Diehl wrote:
> Thank you for your time.  I've put my replies to your questions in-line, 
> below.
> 
> 
> On Wednesday, June 07, 2017 10:19:41 AM Antony Stone wrote:
> > On Tuesday 06 June 2017 17:54:59 Mike Diehl wrote:
> > 
> > > Hi all,
> > > 
> > > I'm upgrading to Asterisk 13.14.0 x86_64.  During my beta testing, I've
> > > discovered that my server crashes as soon as I leave a voicemail message. 
> > > I'm using odbc voicemail storage as well as mysql dynamic configuration.
> > > 
> > > I'm using unixODBC 2.3.2-r2 with myodbc 5.2.7-r1
> > > 
> > > I suspect that the odbc drivers are the problem.  Is ther an alternative
> > > drive that I should be using?
> > > 
> > > Failing that, any other ideas?
> > 
> > Give us more details of what you mean by "crashes".
> 
> My remote console gets disconnected from the Asterisk server, waits a few 
> seconds, 
> reconnects and shows me the start-up log.  It's just like if you told 
> asterisk to 
> restart now.
> 
> 
> > What happens, what do you get in the Asterisk logs, what do you get in 
> > syslog, 
> > what state is the machine in afterwards, is there a kernel panic, what 
> > information leads you to suspect the ODBC drivers...?
> 
> What I see in the log is:
> 
> 
> [Jun  7 14:23:58] VERBOSE[11347][C-0001] app_dial.c: Everyone is 
> busy/congested at this time (1:0/0/1)
> [Jun  7 14:23:58] VERBOSE[11347][C-0001] res_agi.c: magic_switch.pl: 
> --- jmd (CHANUNAVAIL)
> [Jun  7 14:23:58] VERBOSE[11347][C-0001] res_agi.c: AGI Script Executing 
> Application: (voicemail) Options: (1505903@default,su)
> [Jun  7 14:23:58] VERBOSE[11347][C-0001] file.c: 
>  Playing 
> '/var/spool/asterisk/voicemail/default/15059035700/unavail.slin' (language 
> 'en')
> [Jun  7 14:24:08] VERBOSE[11347][C-0001] file.c: 
>  Playing 'beep.ulaw' (language 'en')
> [Jun  7 14:24:09] VERBOSE[11347][C-0001] app_voicemail.c: Recording the 
> message
> [Jun  7 14:24:09] VERBOSE[11347][C-0001] app.c: x=0, open writing:  
> /var/spool/asterisk/voicemail/default/15059035700/tmp/x8hgQD format: wav, 
> 0x7d380013d750
> [Jun  7 14:24:12] VERBOSE[11347][C-0001] app.c: User ended message by 
> pressing #
> [Jun  7 14:24:12] VERBOSE[11347][C-0001] file.c: 
>  Playing 'auth-thankyou.ulaw' (language 'en')
> [Jun  7 14:24:13] VERBOSE[11347][C-0001] config.c: Parsing 
> '/var/spool/asterisk/voicemail/default/15059035700/INBOX/msg0004.txt': Found
> 
> +++ CRASH! +++
> 
> [Jun  7 14:24:15] Asterisk 13.14.0 built by root @ voip11 on a x86_64 running 
> Linux on 2017-06-06 21:26:05 UTC
> [Jun  7 14:24:15] VERBOSE[11362] config.c: Parsing 
> '/etc/asterisk/logger.conf': Found
> 
> 
> I am thinking it's the odbc driver because I believe the server was stable 
> before 
> I rebuilt it with odbc voicemail storage support; it had been using the file 
> system
> for storage.  I'm in the process of migrating all of my servers to database 
> storage.
> 
> 
> 
> > Also, what have you upgraded from, what machine specs are you running on, 
> > what's the dialplan section dealing with leaving voicemail...?
> 
> The ONLY thing I changed from the previous configuration was to convert to 
> odbc voicemail 
> storage.
> 
> > The more info you give us, the more likely it is we can suggest something 
> > useful.
> 
> Ya, I understand; I was just tired... and frustrated.  Thanks again for your 
> time.
> 
> 
> 

-- 
Mike Diehl
Diehlnet Communications, LLC. 
Sales: (800) 254-6105   
Support: (505) 903-5700 
Fax: (505) 903-5701  

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

Check out the 

Re: [asterisk-users] pjsip user_eq_phone adds user=phone to anonymous user bug?

2017-06-09 Thread Daniel Tryba
On Fri, Jun 09, 2017 at 11:40:01AM -0300, Joshua Colp wrote:
> What seems to be happening is that the session is being set up and the
> user=phone parameter added. It's only after that the values are updated
> to be Anonymous and the user=phone parameter is left there. Please file
> an issue[1] with the description above.

Issue created:
https://issues.asterisk.org/jira/browse/ASTERISK-27047


-- 
_
-- 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] pjsip user_eq_phone adds user=phone to anonymous user bug?

2017-06-09 Thread Joshua Colp
On Fri, Jun 9, 2017, at 11:30 AM, Daniel Tryba wrote:
> With pjsip (asterisk 13.14.1) I see the problem that an anonymous from
> header gets user=phone appendend to the URI if user_eq_phone=yes is
> specified:
> 
> On the incoming leg:
> From: anonymous
> ;tag=Q5zBj7BMnvI6Fe6O2866fox3ZHmn-smt
> Get transformed to 
> From: "Anonymous"
> ;tag=fa3cb748-6af9-485f-8a70-a2b9ad40b13a
> on the outgoing leg.
> 
> Setting user_eq_phone = no will result in user=phone not being added.
> The upstream provide demands user=phone in URIs if the username
> resembles a phonenumber, but declines the INVITE if user=phone is
> present on an anonymous username.



> sip_uri->user should be "anonymous"
> AST_DIGIT_ANY is: #define AST_DIGIT_ANYNUM "0123456789"
> 
> So in the for loop the first char of sip_uri->user should result in a
> NULL from strchr. Leaving i at the value 0, which is smaller than the
> length of sip_uri->user. And thus the function should return before
> adding the user=phone. So why is user=phone being added?

What seems to be happening is that the session is being set up and the
user=phone parameter added. It's only after that the values are updated
to be Anonymous and the user=phone parameter is left there. Please file
an issue[1] with the description above.

[1] https://issues.asterisk.org/jira

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

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] pjsip user_eq_phone adds user=phone to anonymous user bug?

2017-06-09 Thread Daniel Tryba
With pjsip (asterisk 13.14.1) I see the problem that an anonymous from
header gets user=phone appendend to the URI if user_eq_phone=yes is
specified:

On the incoming leg:
From: anonymous 
;tag=Q5zBj7BMnvI6Fe6O2866fox3ZHmn-smt
Get transformed to 
From: "Anonymous" 
;tag=fa3cb748-6af9-485f-8a70-a2b9ad40b13a
on the outgoing leg.

Setting user_eq_phone = no will result in user=phone not being added.
The upstream provide demands user=phone in URIs if the username
resembles a phonenumber, but declines the INVITE if user=phone is
present on an anonymous username.

Looking at the code,res/res_pjsip.c function ast_sip_add_usereqphone is
the only place I see that might add user=phone:

=
int i = 0;
//.
if (pj_strbuf(_uri->user)[0] == '+') {
i = 1;
}

/* Test URI user against allowed characters in AST_DIGIT_ANY */
for (; i < pj_strlen(_uri->user); i++) {
if (!strchr(AST_DIGIT_ANYNUM, pj_strbuf(_uri->user)[i])) {
break;
}
}

if (i < pj_strlen(_uri->user)) {
return;
}

  //add user=phone if we get to the code below
=

sip_uri->user should be "anonymous"
AST_DIGIT_ANY is: #define AST_DIGIT_ANYNUM "0123456789"

So in the for loop the first char of sip_uri->user should result in a
NULL from strchr. Leaving i at the value 0, which is smaller than the
length of sip_uri->user. And thus the function should return before
adding the user=phone. So why is user=phone being added?

-- 
_
-- 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] Asterisk 13 attended transfer alcatel

2017-06-09 Thread Olivier
How are both machines connected to each other ?
Through a SIP trunk ? A TDM one ?

2017-06-09 9:59 GMT+02:00 Jason TOMLINSON :

> Hello,
>
>
>
> Since upgrading from asterisk 11 to asterisk 13 (I have tested up to the
> latest 13.16.0 release), we have a problem with attended transfers to an
> alcatel pbx in which the call being transferred still has music on hold
> even after the transfer has completed.
>
> Is this a known issue? Any new flags that need setting, etc?
>
>
>
> Thanks
>
> Jason
>
> --
> _
> -- 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
>
-- 
_
-- 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] Asterisk 13 attended transfer alcatel

2017-06-09 Thread Joshua Colp
On Fri, Jun 9, 2017, at 04:59 AM, Jason TOMLINSON wrote:
> Hello,
> 
> Since upgrading from asterisk 11 to asterisk 13 (I have tested up to the
> latest 13.16.0 release), we have a problem with attended transfers to an
> alcatel pbx in which the call being transferred still has music on hold
> even after the transfer has completed.
> Is this a known issue? Any new flags that need setting, etc?

There's no filed issues about it that come to mind and no new flags that
need setting. I'd suggest providing console output and SIP traffic.

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

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] Asterisk 13 attended transfer alcatel

2017-06-09 Thread Jason TOMLINSON
Hello,

Since upgrading from asterisk 11 to asterisk 13 (I have tested up to the latest 
13.16.0 release), we have a problem with attended transfers to an alcatel pbx 
in which the call being transferred still has music on hold even after the 
transfer has completed.
Is this a known issue? Any new flags that need setting, etc?

Thanks
Jason
-- 
_
-- 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] Working around missing libmyodbc in Debian Stretch

2017-06-09 Thread Olivier
I found this [1], downloaded a tar file from [2], hand copied a single
libmyodbc5a.so into appropriate /usr/lib/x86_64-linux-gnu/odbc/
directory and adapted /etc/odbcinst.ini file accordingly.
After all this, it seemed to work OK but I'm still not too confident.

Shall I trust a couple of successful isql queries to declare the above work
around as successful ?
I don't know.


While at it, I also found a source tar file from [2].
Transforming it into a proper deb package is not an easy task for me but
doing it would help to have MySQL/ODBC connectivity to the
many platforms Debian supports.

[1]
https://askubuntu.com/questions/800216/installing-ubuntu-16-04-lts-how-to-install-odbc
[2] https://dev.mysql.com/downloads/connector/odbc/

2017-06-08 16:17 GMT+02:00 Administrator TOOTAI :

> Le 08/06/2017 à 15:15, J Montoya or A J Stiles a écrit :
>
>> On Thursday 08 Jun 2017, Olivier wrote:
>>
>>> Hello,
>>>
>>> I'm building a new Asterisk system from source on Debian Stretch.
>>> My building script fails as package libmyodbc is currently missing from
>>> Debian Stretch repo.
>>>
>>> Is there a work around this without leaving MySQL/MariaDB galaxy ?
>>>
>>
>> This is why you should not use Debian testing for a server!  Testing is
>> kept
>> "always installable" by the crude method of REMOVING broken packages
>> until a
>> compatible version is ready.  This means you will occasionally find a
>> package
>> with no install candidate.
>>
>
> Well, Stretch will be the new stable as of 17 june 2017 which for me is no
> more a testing version.
>
> --
> Daniel
>
>
> --
> _
> -- 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
>
-- 
_
-- 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