Re: [asterisk-users] Setting codec on originating (calling) channel with chan_pjsip (SIP_CODEC_INBOUND equivalent)

2023-07-05 Thread Michael Ulitskiy

Well, I'm trying to migrate to chan_pjsip so that I don't have to do that.

It's so surprising that the issue so seemingly obvious and trivial 
hasn't been addressed yet that I wanted to query the collective wisdom 
of this list to verify my observations.


Thanks for github pointer.

Michael

On 7/5/23 16:46, aster...@phreaknet.org wrote:

On 7/5/2023 4:19 PM, Michael Ulitskiy wrote:


Hi Michael,

Thanks for the reply.

I was referring to the scenario you named as 'outbound broken'. I 
didn't get to look at inbound call behavior yet, as I got stuck with 
inability to avoid transcoding on outbound calls.


To be more specific the scenario is as follows:

1. a phone initiates a call offering g722,g711 to asterisk
2. asterisk creates outbound call to carrier offering g711 only 
(carrier only supports g711)

3. carrier accepts the call and outbound call leg is now running on g711
4. asterisk accepts a phone's call with g722 since it's allowed on 
phone's endpoint and was indicated as preferred in phone's INVITE and 
now initial call leg is running on g722, resulting in transcoding


This is very disappointing. Since developers announced their plans to 
drop chan_sip from future asterisk versions



It's already been removed and won't be in any future major releases.
If you still need chan_sip after removal, you can continue adding it 
from out of tree and building it. I maintain a working version of it 
out of tree.


I was under impression that chan_pjsip has reached feature paritiy 
with chan_sip.



It has mostly, but not completely, no.


What is needed is an ability to tell asterisk which codecs are 
allowed to be included in "200 OK" asterisk sends back to the phone. 
I guess we need to submit a feature request. How do we go about it 
these days?


I'm not sure about the particulars of this issue at all, but to answer 
the question at hand, there's a repo for it: 
https://github.com/asterisk/asterisk-feature-requests.-- 
_
-- 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] Setting codec on originating (calling) channel with chan_pjsip (SIP_CODEC_INBOUND equivalent)

2023-07-05 Thread Michael Ulitskiy

Hi Michael,

Thanks for the reply.

I was referring to the scenario you named as 'outbound broken'. I didn't 
get to look at inbound call behavior yet, as I got stuck with inability 
to avoid transcoding on outbound calls.


To be more specific the scenario is as follows:

1. a phone initiates a call offering g722,g711 to asterisk
2. asterisk creates outbound call to carrier offering g711 only (carrier 
only supports g711)

3. carrier accepts the call and outbound call leg is now running on g711
4. asterisk accepts a phone's call with g722 since it's allowed on 
phone's endpoint and was indicated as preferred in phone's INVITE and 
now initial call leg is running on g722, resulting in transcoding


This is very disappointing. Since developers announced their plans to 
drop chan_sip from future asterisk versions I was under impression that 
chan_pjsip has reached feature paritiy with chan_sip. What is needed is 
an ability to tell asterisk which codecs are allowed to be included in 
"200 OK" asterisk sends back to the phone. I guess we need to submit a 
feature request. How do we go about it these days?


Thanks,
Michael

On 7/5/23 14:59, Michael Maier wrote:

Hello Michael,

you are referring to the following behavior - did I get it correctly?:

outbound broken: asterisk offers g722 / g711 to provider (callee), 
callee answers g711. Asterisk now transcodes between caller and callee 
(g722 <-> g711).


inbound works: call from provider: g711 -> asterisk drops g722 and 
passes g711 to internal callee -> no transcoding.



As far as I know, there is no working solution as of now. I discussed 
this problem years ago already here but unfortunately nothing usable 
happened so far (which I would know off). The priority is not high 
enough. I need a solution, too. I understand that this behavior is a 
nogo if you have a lot of calls because transcoding is expensive.



Thanks
Michael



On 05.07.23 at 17:58 Michael Ulitskiy wrote:

Hello,

Anyone? I have hard time to believe this is not possible with 
chan_pjsip.


Anyway, may I ask how people handle the following scenario which I 
imagine should be quite common:


- I have internal extensions talk to each other using g722. so their 
codec setting (with chan_sip now) is "allow=g722,ulaw"

- I have carriers trunks that handle ulaw only (allow=ulaw)
- calls between internal extensions naturally happen over g722 as its 
their preferred codec
- for external calls I now set SIP_CODEC_INBOUND=ulaw to influence 
codec selection on calling channel and the calls set up using ulaw 
end-to-end


Can somebody please advise how to achieve the same with chan_pjsip?

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] Setting codec on originating (calling) channel with chan_pjsip (SIP_CODEC_INBOUND equivalent)

2023-07-05 Thread Michael Maier

Hello Michael,

you are referring to the following behavior - did I get it correctly?:

outbound broken: asterisk offers g722 / g711 to provider (callee), 
callee answers g711. Asterisk now transcodes between caller and callee 
(g722 <-> g711).


inbound works: call from provider: g711 -> asterisk drops g722 and 
passes g711 to internal callee -> no transcoding.



As far as I know, there is no working solution as of now. I discussed 
this problem years ago already here but unfortunately nothing usable 
happened so far (which I would know off). The priority is not high 
enough. I need a solution, too. I understand that this behavior is a 
nogo if you have a lot of calls because transcoding is expensive.



Thanks
Michael



On 05.07.23 at 17:58 Michael Ulitskiy wrote:

Hello,

Anyone? I have hard time to believe this is not possible with chan_pjsip.

Anyway, may I ask how people handle the following scenario which I 
imagine should be quite common:


- I have internal extensions talk to each other using g722. so their 
codec setting (with chan_sip now) is "allow=g722,ulaw"

- I have carriers trunks that handle ulaw only (allow=ulaw)
- calls between internal extensions naturally happen over g722 as its 
their preferred codec
- for external calls I now set SIP_CODEC_INBOUND=ulaw to influence codec 
selection on calling channel and the calls set up using ulaw end-to-end


Can somebody please advise how to achieve the same with chan_pjsip?

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] Getvar of CHANNEL not working for a couple of items

2023-07-05 Thread Joshua C. Colp
On Wed, Jul 5, 2023 at 12:50 PM TTT  wrote:

>   Channel A: "1688509741.112" , name:  "PJSIP/111-0064" , is
> originator:  Y , call-Id:  "u.l6kcou25ca...@mydomain.com" , local_uri:  "<
> sip:2...@mydomain.com;user=phone>" , local_tag:
> "1734d973-c4da-4ae8-a37d-5f7065f1fe54" , local_addr:  "172.31.253.4:5060"
> , remote_uri:  "\\\"TestPhone x111\\\" " ,
> remote_tag:  "yinue4v5ufa4" , remote_addr:  "172.31.253.20:5060"
>
>
>
>
>
>   Channel B: "1688509741.113" , name:  "PJSIP/222-0065" , is
> originator:  N , call-Id:  "1f104544-fc1a-4414-ba74-68c526e294de" ,
> local_uri:  "\\\"TestPhone\\\" " , local_tag:
> "ac5eeb59-f559-4bb7-a3c2-170ca7f05f8b" , local_addr:  "" , remote_uri:  "<
> sip:222@172.31.253.20;line=46922>" , remote_tag:  "klwqxe1fvt5wk" ,
> remote_addr:  ""
>
>
>
> And here's what seems strange:
>
> Channel A's local_uri looks like Channel B's uri
>
> Channel A's remote_uri looks like channel A's uri
>
> Channel B's local_uri looks like channel A's uri
>
> Channel B's remote_uri looks like channel B;s uri
>
>
>
> These aren't strange. They look alike because of callerid and target
> dialed information. They are still independent call legs.
>
>
>
>
>
> I’m having trouble understanding your explanation (googling just led me to
> generic callerid and target info).  I thought a phone’s local_uri would be
> how to reach that phone (not the other party), and vice versa for the
> remote_uri.  If the above URI info is correct then I must misunderstand
> their meaning.  Could you provide more explanation on how to interpret them
> (why they seems reversed to me), or a link?
>
>
>
> I assumed the remote & local URI where equivalent to the to & from lines
> (respectively) in the invite…
>

They are the From and To header, but what remote_uri and local_uri refers
to changes depending on the direction of the SIP dialog.

Received call: From = remote_uri, To = local_uri
Sent call: From = local_uri, To = remote_uri

The contents of each depend on callerid information, settings, the Contact
of the target when doing an outgoing call, what the remote endpoint chose
for To URI on a received call.

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and 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] Setting codec on originating (calling) channel with chan_pjsip (SIP_CODEC_INBOUND equivalent)

2023-07-05 Thread Michael Ulitskiy

Hello,

Anyone? I have hard time to believe this is not possible with chan_pjsip.

Anyway, may I ask how people handle the following scenario which I 
imagine should be quite common:


- I have internal extensions talk to each other using g722. so their 
codec setting (with chan_sip now) is "allow=g722,ulaw"

- I have carriers trunks that handle ulaw only (allow=ulaw)
- calls between internal extensions naturally happen over g722 as its 
their preferred codec
- for external calls I now set SIP_CODEC_INBOUND=ulaw to influence codec 
selection on calling channel and the calls set up using ulaw end-to-end


Can somebody please advise how to achieve the same with chan_pjsip?

Thanks,

Michael

On 6/30/23 09:30, Michael Ulitskiy wrote:


Hello,

I finally got to look at chan_sip to chan_pjsip migration again. This 
time I’m having problems with influencing codec selection on 
originating (calling) channel. It looks like PJSIP_MEDIA_OFFER only 
works on outbound (called) channel and has no affect on calling 
channel. My experiments and function documentation (which says “Media 
and codec offerings to be set on an outbound SIP channel prior to 
dialing.”) seem to confirm it.
So PJSIP_MEDIA_OFFER is supposed to be (and it works) chan_pjsip’s 
equivalent of ${SIP_CODEC_OUTBOUND}, but what is chan_pjsip’s 
equivalent of ${SIP_CODEC_INBOUND}? Or, in other words, what are we 
supposed to do to influence /calling/ channel codec selection from 
dialplan?

I’m working with asterisk 20.3.0.

Thank you,
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] Getvar of CHANNEL not working for a couple of items

2023-07-05 Thread TTT
  Channel A: "1688509741.112" , name:  "PJSIP/111-0064" , is originator:  Y 
, call-Id:  "u.l6kcou25ca...@mydomain.com  
" , local_uri:  "mailto:sip%3a...@mydomain.com> 
;user=phone>" , local_tag:  "1734d973-c4da-4ae8-a37d-5f7065f1fe54" , 
local_addr:  "172.31.253.4:5060  " , remote_uri:  
"\\\"TestPhone x111\\\" mailto:sip%3a...@mydomain.com> 
>" , remote_tag:  "yinue4v5ufa4" , remote_addr:  "172.31.253.20:5060 
 "

 

 

  Channel B: "1688509741.113" , name:  "PJSIP/222-0065" , is originator:  N 
, call-Id:  "1f104544-fc1a-4414-ba74-68c526e294de" , local_uri:  
"\\\"TestPhone\\\" mailto:sip%3A111@172.31.253.4> >" , 
local_tag:  "ac5eeb59-f559-4bb7-a3c2-170ca7f05f8b" , local_addr:  "" , 
remote_uri:  "mailto:sip%3A222@172.31.253.20> 
;line=46922>" , remote_tag:  "klwqxe1fvt5wk" , remote_addr:  ""

 

And here's what seems strange:

Channel A's local_uri looks like Channel B's uri

Channel A's remote_uri looks like channel A's uri

Channel B's local_uri looks like channel A's uri

Channel B's remote_uri looks like channel B;s uri

 

These aren't strange. They look alike because of callerid and target dialed 
information. They are still independent call legs.

 

 

I’m having trouble understanding your explanation (googling just led me to 
generic callerid and target info).  I thought a phone’s local_uri would be how 
to reach that phone (not the other party), and vice versa for the remote_uri.  
If the above URI info is correct then I must misunderstand their meaning.  
Could you provide more explanation on how to interpret them (why they seems 
reversed to me), or a link?

 

I assumed the remote & local URI where equivalent to the to & from lines 
(respectively) in the invite…

-- 
_
-- 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] Getvar of CHANNEL not working for a couple of items

2023-07-05 Thread Joshua C. Colp
On Tue, Jul 4, 2023 at 7:52 PM TTT  wrote:

> Building on my last message, I am trying to get CHANNEL data using getvar
> (through the AMI).  And although I'm getting responses, some  values
> returned seem illogical.  For example, phone 111 calls phone 222 via the
> PBX.  Here's the data I get back
>
>
>
>
>
>   Channel A: "1688509741.112" , name:  "PJSIP/111-0064" , is
> originator:  Y , call-Id:  "u.l6kcou25ca...@mydomain.com" , local_uri:  "<
> sip:2...@mydomain.com;user=phone>" , local_tag:
> "1734d973-c4da-4ae8-a37d-5f7065f1fe54" , local_addr:  "172.31.253.4:5060"
> , remote_uri:  "\\\"TestPhone x111\\\" " ,
> remote_tag:  "yinue4v5ufa4" , remote_addr:  "172.31.253.20:5060"
>
>
>
>
>
>   Channel B: "1688509741.113" , name:  "PJSIP/222-0065" , is
> originator:  N , call-Id:  "1f104544-fc1a-4414-ba74-68c526e294de" ,
> local_uri:  "\\\"TestPhone\\\" " , local_tag:
> "ac5eeb59-f559-4bb7-a3c2-170ca7f05f8b" , local_addr:  "" , remote_uri:  "<
> sip:222@172.31.253.20;line=46922>" , remote_tag:  "klwqxe1fvt5wk" ,
> remote_addr:  ""
>
>
>
> And here's what seems strange:
>
> Channel A's local_uri looks like Channel B's uri
>
> Channel A's remote_uri looks like channel A's uri
>
> Channel B's local_uri looks like channel A's uri
>
> Channel B's remote_uri looks like channel B;s uri
>

These aren't strange. They look alike because of callerid and target dialed
information. They are still independent call legs.


> Channel B's local_addr is blank
>
> Channel B's remote_addr is blank
>

I don't know why they're blank.

-- 
Joshua C. Colp
Asterisk Project Lead
Sangoma Technologies
Check us out at www.sangoma.com and 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