Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread KoltogyanU2 SergeyU2
Thank. it has been configured:
$ cat /etc/asterisk/pjsip.conf | grep -i "external"
external_media_address=11.22.33.44
external_signaling_address=11.22.33.44

As a result - in the "Contact" field of the request "INVITE" is indicated IP 
ddress and not FQDN:
Contact: 

It is necessary for me that instead of IP Address there was a FQDN, example:
Contact: 

How i can do this ?
Where in the source code to make a change?

Serg



From: asterisk-dev  on behalf of Mani 
Kanta Gadde 
Sent: Tuesday, October 30, 2018 8:03
To: asterisk-dev@lists.digium.com
Subject: Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

Use the external_media_address and external_signalling_address in PJSIP in 
general section.

These variables will explicitly put the required IP in SIP messages, so that 
other SIP phone/VoIP server know where to reply.


Thanks & Regards
Manikanta


On Tue, Oct 30, 2018 at 10:08 AM KoltogyanU2 SergeyU2 
mailto:u...@amintegrator.com>> wrote:

PJSIP . How to force use FQDN in the "Contact" field ( INVITE) ?

In the INVITE the "Contact" field looks like this:
Contact: 

How to reconfigure Asterisk, or where in the source code to make a change, so 
that the "Contact" always use FQDN 
=ast.firma.org
  and looked like this:
Contact: 

?

Description of the problem:
Asterisk 16 (use PJSIP. asterisk build with:
./configure --with-pjproject-bundled  -sysconfdir=/etc --libdir=/usr/lib64
)

Asterisk sends a INVITE to the 
sip.pstnhub.microsoft.com
 in this form:
<--- Transmitting SIP request (806 bytes) to 
TLS:52.114.75.24:5061
 --->
INVITE 
sip:+380770...@sip.pstnhub.microsoft.com:5061
 SIP/2.0
Via: SIP/2.0/TLS 
11.22.33.44:5061;rport;branch=z9hG4bKPjd2417f6c-8788-4d40-b666-3244b903d886;alias
From: 
mailto:sip%3a6...@ast.firma.org>>;tag=9912223a-ff74-4ba6-8a0f-c3225e70eaba
To: 
mailto:sip%3a%2b380770...@sip.pstnhub.microsoft.com>>
Contact: 
Call-ID: ee581ee7-e624-41cb-a486-b06cf233c63c
CSeq: 19204 INVITE
Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE, CANCEL, 
UPDATE, PRACK, MESSAGE, REFER
Supported: 100rel, timer, replaces, norefersub
Session-Expires: 1800
Min-SE: 90
Max-Forwards: 70
User-Agent: Asterisk PBX 16.0.0
Content-Type: application/sdp
Content-Length:92

v=0
o=- 233177990 233177990 IN IP4 11.22.33.44
s=Asterisk
c=IN IP4 40.127.205.7
t=0 0


Where 11.22.33.44 - Asterisk public IP Address ( Asterisk over NAT ):
Asterisk(172.18.1.16)--->NAT(11.22.33.44)>ISP

In the INVITE the "Contact" field looks like this:
Contact: 

How to reconfigure Asterisk, or where in the source code to make a change,
so that the "Contact" always use FQDN 
=ast.firma.org
  and looked like this:
Contact: 

Serg
?


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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread Mani Kanta Gadde
I think you can also set the DNS instead of IP itself. Try it
Thanks & Regards
Manikanta


On Tue, Oct 30, 2018 at 1:35 PM KoltogyanU2 SergeyU2 
wrote:

> Thank. it has been configured:
> $ cat /etc/asterisk/pjsip.conf | grep -i "external"
> external_media_address=11.22.33.44
> external_signaling_address=11.22.33.44
>
> As a result - in the "Contact" field of the request "INVITE" is indicated
> IP ddress and not FQDN:
> Contact: 
>
> It is necessary for me that instead of IP Address there was a FQDN,
> example:
> Contact: 
>
> How i can do this ?
> Where in the source code to make a change?
>
> Serg
>
>
> --
> *From:* asterisk-dev  on behalf of
> Mani Kanta Gadde 
> *Sent:* Tuesday, October 30, 2018 8:03
> *To:* asterisk-dev@lists.digium.com
> *Subject:* Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field
> and FQDN
>
> Use the external_media_address and external_signalling_address in PJSIP in
> general section.
>
> These variables will explicitly put the required IP in SIP messages, so
> that other SIP phone/VoIP server know where to reply.
>
>
> Thanks & Regards
> Manikanta
>
>
> On Tue, Oct 30, 2018 at 10:08 AM KoltogyanU2 SergeyU2 
> wrote:
>
>
> PJSIP . How to force use FQDN in the "Contact" field ( INVITE) ?
>
> In the INVITE the "Contact" field looks like this:
> Contact: 
>
> How to reconfigure Asterisk, or where in the source code to make a change,
> so that the "Contact" always use FQDN =ast.firma.org
> 
>  and looked like this:
> Contact: 
>
> ?
>
> Description of the problem:
> Asterisk 16 (use PJSIP. asterisk build with:
> ./configure --with-pjproject-bundled  -sysconfdir=/etc --libdir=/usr/lib64
> )
>
> Asterisk sends a INVITE to the sip.pstnhub.microsoft.com
> 
> in this form:
> <--- Transmitting SIP request (806 bytes) to TLS:52.114.75.24:5061
> 
> --->
> INVITE sip:+380770...@sip.pstnhub.microsoft.com:5061
> 
> SIP/2.0
> Via: SIP/2.0/TLS 11.22.33.44:5061
> ;rport;branch=z9hG4bKPjd2417f6c-8788-4d40-b666-3244b903d886;alias
> From: ;tag=9912223a-ff74-4ba6-8a0f-c3225e70eaba
> To: 
> Contact: 
> Call-ID: ee581ee7-e624-41cb-a486-b06cf233c63c
> CSeq: 19204 INVITE
> Allow: OPTIONS, REGISTER, SUBSCRIBE, NOTIFY, PUBLISH, INVITE, ACK, BYE,
> CANCEL, UPDATE, PRACK, MESSAGE, REFER
> Supported: 100rel, timer, replaces, norefersub
> Session-Expires: 1800
> Min-SE: 90
> Max-Forwards: 70
> User-Agent: Asterisk PBX 16.0.0
> Content-Type: application/sdp
> Content-Length:92
>
> v=0
> o=- 233177990 233177990 IN IP4 11.22.33.44
> s=Asterisk
> c=IN IP4 40.127.205.7
> t=0 0
>
>
> Where 11.22.33.44 - Asterisk public IP Address ( Asterisk over NAT ):
> Asterisk(172.18.1.16)--->NAT(11.22.33.44)>ISP
>
> In the INVITE the "Contact" field looks like this:
> Contact: 
>
> How to reconfigure Asterisk, or where in the source code to make a change,
> so that the "Contact" always use FQDN =ast.firma.org
> 
>  and looked like this:
> Contact: 
>
> Serg
> ?
>
>
> --
> _
> -- Bandwidth and Colocation Provided by http://www.api-digital.com
> 
> --
>
> Astricon is coming up October 9-11!  Signup is available at:
> https://www.asterisk.org/community/astricon-user-conference
> 

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread Joshua C. Colp
On Tue, Oct 30, 2018, at 9:12 AM, Mani Kanta Gadde wrote:
> I think you can also set the DNS instead of IP itself. Try it
> Thanks & Regards
> Manikanta

A hostname is not supported with the external_* options, for placement into the 
messages. It gets resolved down to the IP address. Placing a hostname into the 
Contact header URI host is not currently supported out of the box. The Contact 
stuff is handled within res_pjsip.c, the easiest option being to look for use 
of "contact_user" as that already modifies the user portion and using that as a 
base for any modification.

-- 
Joshua C. Colp
Digium - A Sangoma Company | 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] PJSIP Dialog-Info+XML enhancement

2018-10-30 Thread Hans-Peter Jansen
On Montag, 29. Oktober 2018 21:14:32 Joshua C. Colp wrote:
> On Mon, Oct 29, 2018, at 8:44 PM, Hans-Peter Jansen wrote:
> > 
> > Remote is still wrong, it's a local extension, and I also have no idea
> > ATM,
> > where to fetch call-id, local-tag and remote-tag attributes. It also makes
> > asterisk not to exit gracefully anymore after hitting ^C.
> 
> Channels don't have a call-id, local-tag, or remote-tag. Those are SIP
> constructs and an Asterisk channel may or may not be a SIP channel. I
> believe chan_sip synthesized/created ones.

Getting something along those lines to work with PJSIP at least would be a big 
step forward. We're in a quagmire with current Asterisk: chan_sip is declining 
perceptible [1]. The (well, relatively) new and shiny PJSIP is the way to go, 
but nobody want to give up essential features, they're used to and rely on 
since more than a decade.

> > May I kindly ask you to take a look at it?
> 
> Due to the contributions and work I do with Asterisk I personally avoid
> looking at unlicensed code in our industry to ensure that code within
> Asterisk itself remains as license pure as possible I'm afraid. If you have
> specific questions I can answer.

Understood. 

I have signed the Contributor License Agreement and will resubmit my patch 
after the CLA is confirmed.

Thank you for your support.

Kind regards,
Pete

[1]https://community.asterisk.org/t/avoid-pj-ice-rx-error-when-using-sip-only/76838

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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread KoltogyanU2 SergeyU2
I found a place in res_pjsip.c, where a new "contact_user" is added.
This is file   ./res/res_pjsip.c  string 3514
pj_strdup2(dlg->pool, &sip_uri->user, endpoint->contact_user);

I Tried this:
pj_strdup2(dlg->pool, &sip_uri->user, "XXYYZZ");
So it works - it changes the ContactUserName ( on the left of @ ).

But I do not find a place where I can enter FQDN, instead of the IP address.
Someone can tell - in which place of the source text to make a change, what was 
right of @ was not an IP Address, but a FQDN?




From: asterisk-dev  on behalf of Joshua 
C. Colp 
Sent: Tuesday, October 30, 2018 14:19
To: asterisk-dev@lists.digium.com
Subject: Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

On Tue, Oct 30, 2018, at 9:12 AM, Mani Kanta Gadde wrote:
> I think you can also set the DNS instead of IP itself. Try it
> Thanks & Regards
> Manikanta

A hostname is not supported with the external_* options, for placement into the 
messages. It gets resolved down to the IP address. Placing a hostname into the 
Contact header URI host is not currently supported out of the box. The Contact 
stuff is handled within res_pjsip.c, the easiest option being to look for use 
of "contact_user" as that already modifies the user portion and using that as a 
base for any modification.

--
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: 
https://emea01.safelinks.protection.outlook.com/?url=www.digium.com&data=02%7C01%7Cu2%40amintegrator.com%7C8fef6e3cc0784547d3cb08d63e61fe51%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636764987937407942&sdata=RlqsUvtKA0wb%2F3dWWqEEB5MxhvSIYvtwe5O%2FmS2WE%2FQ%3D&reserved=0
 & 
https://emea01.safelinks.protection.outlook.com/?url=www.asterisk.org&data=02%7C01%7Cu2%40amintegrator.com%7C8fef6e3cc0784547d3cb08d63e61fe51%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636764987937407942&sdata=3cFldB%2Bbb3VHyPd87t1tvSPevM3vvzfyNygN5poCp1k%3D&reserved=0

--
_
-- Bandwidth and Colocation Provided by 
https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Fwww.api-digital.com&data=02%7C01%7Cu2%40amintegrator.com%7C8fef6e3cc0784547d3cb08d63e61fe51%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636764987937407942&sdata=Z4gx8OTFhl%2FqWOj4mT2tYZJJzrwzIA5fql8PSV55mpQ%3D&reserved=0
 --

Astricon is coming up October 9-11!  Signup is available at: 
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.asterisk.org%2Fcommunity%2Fastricon-user-conference&data=02%7C01%7Cu2%40amintegrator.com%7C8fef6e3cc0784547d3cb08d63e61fe51%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636764987937407942&sdata=B1vCN2ini%2BXiEY18UfO%2BUF8MkW%2FF%2FgkEMJryV1wfgHU%3D&reserved=0

asterisk-dev mailing list
To UNSUBSCRIBE or update options visit:
   
https://emea01.safelinks.protection.outlook.com/?url=http%3A%2F%2Flists.digium.com%2Fmailman%2Flistinfo%2Fasterisk-dev&data=02%7C01%7Cu2%40amintegrator.com%7C8fef6e3cc0784547d3cb08d63e61fe51%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636764987937407942&sdata=zxjbVaWbmeSQPb2c56NaZi2NchNuDLmlpPSBhBcqPWw%3D&reserved=0
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread Joshua C. Colp
On Tue, Oct 30, 2018, at 10:16 AM, KoltogyanU2 SergeyU2 wrote:
> I found a place in res_pjsip.c, where a new "contact_user" is added.
> This is file   ./res/res_pjsip.c  string 3514
> pj_strdup2(dlg->pool, &sip_uri->user, endpoint->contact_user);
> 
> I Tried this:
> pj_strdup2(dlg->pool, &sip_uri->user, "XXYYZZ");
> So it works - it changes the ContactUserName ( on the left of @ ).
> 
> But I do not find a place where I can enter FQDN, instead of the IP 
> address.
> Someone can tell - in which place of the source text to make a change, 
> what was right of @ was not an IP Address, but a FQDN?

The structure of a PJSIP SIP URI is documented in their doxygen[1], this 
includes the part you are looking for (the hostname portion).

[1] https://www.pjsip.org/pjsip/docs/html/structpjsip__sip__uri.htm

-- 
Joshua C. Colp
Digium - A Sangoma Company | 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread KoltogyanU2 SergeyU2
I tried it(./res/res_pjsip.c :
if (!ast_strlen_zero(endpoint->contact_user)) {
 pjsip_sip_uri *sip_uri;
 sip_uri = pjsip_uri_get_uri(dlg->local.contact->uri);
file004r = fopen("/tmp/0/res_pjsip.log","ab");
fwrite("\n456=456\n",strlen("\n456=456\n"),1,file004r);
fwrite("\n===SIP_URI_USER_BEFORE=\n",strlen("\n===SIP_URI_USER_BEFORE=\n"),1,file004r);
fwrite(sip_uri->user.ptr,sip_uri->user.slen,1,file004r);
fwrite("\n===SIP_URI_HOST_BEFORE=\n",strlen("\n===SIP_URI_HOST_BEFORE=\n"),1,file004r);
fwrite(sip_uri->host.ptr,sip_uri->host.slen,1,file004r);

 pj_strdup2(dlg->pool, &sip_uri->user, endpoint->contact_user);

fwrite("\n===SIP_URI_USER_AFTER=\n",strlen("\n===SIP_URI_USER_AFTER=\n"),1,file004r);
fwrite(sip_uri->user.ptr,sip_uri->user.slen,1,file004r);
fwrite("\n===SIP_URI_HOST_AFTER=\n",strlen("\n===SIP_URI_HOST_AFTER=\n"),1,file004r);
fwrite(sip_uri->host.ptr,sip_uri->host.slen,1,file004r);
fclose(file004r);

}

added at /etc/asterisk/pjsip.conf
contact_user = asterisk654

make && make install
systemctl restart asterisk

made a test call
and results:
cat /tmp/0/res_pjsip.log
456=456

===SIP_URI_USER_BEFORE=
asterisk
===SIP_URI_HOST_BEFORE=
ast.firma.org
===SIP_URI_USER_AFTER=
asterisk654
===SIP_URI_HOST_AFTER=
ast.firma.org

Apparently sip_uri->host  has already had the value  "ast.firma.org",
but in the INVITE  in the "Contact" field - ip address = 11.22.33.44:
Contact: 

Such INVITE sent asterisk:
<--- Transmitting SIP request (813 bytes) to TLS:52.114.76.76:5061 --->
INVITE sip:+380770...@sip.pstnhub.microsoft.com:5061 SIP/2.0
Via: SIP/2.0/TLS 
11.22.33.44:5061;rport;branch=z9hG4bKPj70d53a0c-a0f3-479a-8917-00082632d069;alias
From: ;tag=afd3b600-886a-45fb-a120-5faac8220cec
To: 
Contact: 
Call-ID: b0323db6-6e7f-4dc4-bfa9-309683031962
CSeq: 20795 INVITE


Serg


From: Joshua C. Colp 
Sent: Tuesday, October 30, 2018 15:19
To: Колтогян Сергей Рубенович U2; Asterisk Developers Mailing List
Subject: Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

On Tue, Oct 30, 2018, at 10:16 AM, KoltogyanU2 SergeyU2 wrote:
> I found a place in res_pjsip.c, where a new "contact_user" is added.
> This is file   ./res/res_pjsip.c  string 3514
> pj_strdup2(dlg->pool, &sip_uri->user, endpoint->contact_user);
>
> I Tried this:
> pj_strdup2(dlg->pool, &sip_uri->user, "XXYYZZ");
> So it works - it changes the ContactUserName ( on the left of @ ).
>
> But I do not find a place where I can enter FQDN, instead of the IP
> address.
> Someone can tell - in which place of the source text to make a change,
> what was right of @ was not an IP Address, but a FQDN?

The structure of a PJSIP SIP URI is documented in their doxygen[1], this 
includes the part you are looking for (the hostname portion).

[1] 
https://emea01.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.pjsip.org%2Fpjsip%2Fdocs%2Fhtml%2Fstructpjsip__sip__uri.htm&data=02%7C01%7Cu2%40amintegrator.com%7C0016dac0a75c4036998908d63e6a4b76%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765023596895828&sdata=oMRG%2FzRlBEeTvbQudg2l7Y3UjNfp8iBgRls1OAxPSzo%3D&reserved=0

--
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: 
https://emea01.safelinks.protection.outlook.com/?url=www.digium.com&data=02%7C01%7Cu2%40amintegrator.com%7C0016dac0a75c4036998908d63e6a4b76%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765023596895828&sdata=rJ%2BfZ0c0nEeD%2FesxKp9u8897STKvKdH56s2B6fRBfto%3D&reserved=0
 & 
https://emea01.safelinks.protection.outlook.com/?url=www.asterisk.org&data=02%7C01%7Cu2%40amintegrator.com%7C0016dac0a75c4036998908d63e6a4b76%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765023596895828&sdata=wRhVtosDsSsfYHrGe8YCKTRMia7EUQxTtRxBTaJpU%2Fg%3D&reserved=0
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread Joshua C. Colp
On Tue, Oct 30, 2018, at 11:31 AM, KoltogyanU2 SergeyU2 wrote:


 
> Apparently sip_uri->host  has already had the value  "ast.firma.org",
> but in the INVITE  in the "Contact" field - ip address = 11.22.33.44:
> Contact: 
> 
> Such INVITE sent asterisk:
> <--- Transmitting SIP request (813 bytes) to TLS:52.114.76.76:5061 --->
> INVITE sip:+380770...@sip.pstnhub.microsoft.com:5061 SIP/2.0
> Via: SIP/2.0/TLS 11.22.33.44:5061;rport;branch=z9hG4bKPj70d53a0c-a0f3-
> 479a-8917-00082632d069;alias
> From: ;tag=afd3b600-886a-45fb-a120-5faac8220cec
> To: 
> Contact: 
> Call-ID: b0323db6-6e7f-4dc4-bfa9-309683031962
> CSeq: 20795 INVITE

You would need to track down why that is, then. It may be that the NAT code or 
multihomed code is changing it.

-- 
Joshua C. Colp
Digium - A Sangoma Company | 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread KoltogyanU2 SergeyU2
"NAT code" - it`s  ./res/res_pjsip_nat.c   ?
 "multihomed code"  - What is this ?




From: Joshua C. Colp 
Sent: Tuesday, October 30, 2018 16:33
To: Колтогян Сергей Рубенович U2; Asterisk Developers Mailing List
Subject: Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

On Tue, Oct 30, 2018, at 11:31 AM, KoltogyanU2 SergeyU2 wrote:



> Apparently sip_uri->host  has already had the value  "ast.firma.org",
> but in the INVITE  in the "Contact" field - ip address = 11.22.33.44:
> Contact: 
>
> Such INVITE sent asterisk:
> <--- Transmitting SIP request (813 bytes) to TLS:52.114.76.76:5061 --->
> INVITE sip:+380770...@sip.pstnhub.microsoft.com:5061 SIP/2.0
> Via: SIP/2.0/TLS 11.22.33.44:5061;rport;branch=z9hG4bKPj70d53a0c-a0f3-
> 479a-8917-00082632d069;alias
> From: ;tag=afd3b600-886a-45fb-a120-5faac8220cec
> To: 
> Contact: 
> Call-ID: b0323db6-6e7f-4dc4-bfa9-309683031962
> CSeq: 20795 INVITE

You would need to track down why that is, then. It may be that the NAT code or 
multihomed code is changing it.

--
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: 
https://emea01.safelinks.protection.outlook.com/?url=www.digium.com&data=02%7C01%7Cu2%40amintegrator.com%7Cdebac7a77e244af4176608d63e74b5c6%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765068326808022&sdata=TGYAaYvOZ14iQlGdS%2BvWLvPEkxKBVsm4pjPq1CX41tY%3D&reserved=0
 & 
https://emea01.safelinks.protection.outlook.com/?url=www.asterisk.org&data=02%7C01%7Cu2%40amintegrator.com%7Cdebac7a77e244af4176608d63e74b5c6%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765068326808022&sdata=X5u24UsJTIinAyFOBpz87aUuBbQ7o7k0NsNTEmOiC50%3D&reserved=0
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread Joshua C. Colp
On Tue, Oct 30, 2018, at 1:58 PM, KoltogyanU2 SergeyU2 wrote:
> "NAT code" - it`s  ./res/res_pjsip_nat.c   ?

Yes.

>  "multihomed code"  - What is this ?

That code is contained in res/res_pjsip/pjsip_message_filter.c

-- 
Joshua C. Colp
Digium - A Sangoma Company | 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 --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Chief Minister - Government of Telangana : Speed Up The Widening Of Road Under Bridge At Hitech City Railway Station

2018-10-30 Thread Matt Fredrickson
On Sun, Oct 28, 2018 at 6:01 AM  wrote:
>
> Hey,
>
> I just signed the petition "Chief Minister - Government of Telangana : Speed 
> Up The Widening Of Road Under Bridge At Hitech City Railway Station" and 
> wanted to see if you could help by adding your name.
>
> Our goal is to reach 84 signatures and we need more support. You can read 
> more and sign the petition here:
>
> https://chn.ge/2yC4TaP

Sorry, I think you targeted this at the wrong list.  This list is for
discussion of Asterisk development, specifically source code and
project policy.  Good luck in getting your signatures though!

-- 
Matthew Fredrickson
Digium - A Sangoma Company | Asterisk Project Lead
445 Jan Davis Drive NW - Huntsville, AL 35806 - USA

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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Chief Minister - Government of Telangana : Speed Up The Widening Of Road Under Bridge At Hitech City Railway Station

2018-10-30 Thread Daniel Journo
> Sorry, I think you targeted this at the wrong list.  This list is for 
> discussion of Asterisk development, specifically source code and project 
> policy.  Good luck in getting your signatures though!

Very polite of you Matthew, considering he probably just sent to his entire 
address book.

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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

2018-10-30 Thread KoltogyanU2 SergeyU2
Thanks for the help. I found what I was looking for.
/res/res_pjsip_nat.c

cat /datadrive/src/asterisk-16.0.0/res/res_pjsip_nat.c | grep -ni ast.firma.org
   pj_strdup2(tdata->pool, &uri->host, "ast.firma.org");
   pj_strdup2(tdata->pool, &via->sent_by.host, "ast.firma.org");

this is in the function:
static pj_status_t nat_on_tx_message(pjsip_tx_data *tdata)
{
 RAII_VAR(struct ao2_container *, transport_states, NULL, ao2_cleanup);
 RAII_VAR(struct ast_sip_transport *, transport, NULL, ao2_cleanup);
 RAII_VAR(struct ast_sip_transport_state *, transport_state, NULL, ao2_cleanup);
 struct request_transport_details details = { 0, };
...


Serg



From: Joshua C. Colp 
Sent: Tuesday, October 30, 2018 19:52
To: Колтогян Сергей Рубенович U2; Asterisk Developers Mailing List
Subject: Re: [asterisk-dev] Asterisk 16. PJSIP. INVITE. "Contact" field and FQDN

On Tue, Oct 30, 2018, at 1:58 PM, KoltogyanU2 SergeyU2 wrote:
> "NAT code" - it`s  ./res/res_pjsip_nat.c   ?

Yes.

>  "multihomed code"  - What is this ?

That code is contained in res/res_pjsip/pjsip_message_filter.c

--
Joshua C. Colp
Digium - A Sangoma Company | Senior Software Developer
445 Jan Davis Drive NW - Huntsville, AL 35806 - US
Check us out at: 
https://emea01.safelinks.protection.outlook.com/?url=www.digium.com&data=02%7C01%7Cu2%40amintegrator.com%7C7b9ed3cce854492f73e708d63e907169%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765187443945780&sdata=mL%2F3EVTrDtbKZYpJbKX8zWzT5jjS2VpjuTE0hPrKbOI%3D&reserved=0
 & 
https://emea01.safelinks.protection.outlook.com/?url=www.asterisk.org&data=02%7C01%7Cu2%40amintegrator.com%7C7b9ed3cce854492f73e708d63e907169%7C806bcdf8cdfb4595995e80fbcae20097%7C0%7C0%7C636765187443945780&sdata=DWioncHIdkZzeLv99qlUEp0sl9X%2F%2BrMkOtOA%2F7mqyHk%3D&reserved=0
-- 
_
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

[asterisk-dev] Controlling the flow of connected line info after attended transfer of stasis-controlled channels

2018-10-30 Thread Stephen Davies
Hi,

I'm looking to see if I've missed something - if not I think there is an
ARI limitation worth thinking about.

app_dial offers a flag "I" which is supposed to block propagation of
connected line updates through the dial bridge.  Is there anything like
this that I can do when setting up and managing a bridge with ARI?

My problem is like so:  I have an incoming call from an "external" source
to a DDI.  I want to send that source a Remote-Party-Id containing the DDI
dialled an a name like "ABC Corp".  And I don't want that to change even
with subsequent transfers etc.

I've got this working for the initial incoming call.  My problem comes when
the dialled phone does a transfer - specifically I've need testing with
attended transfer.

(An attended transfer starts with the transferer initiating an "enquiry
call".  So two bridges.  On the REFER Asterisk does an attended transfer
with type "link" and inserts a Local channel pair between the two bridges,
replacing the two channels to the transferring phone.

At this point Asterisk sends the original caller a connected line update
saying that "you are now talking to 201 Abu".  And tells the target phone
"you are now talking to the external caller".

Which is true, no doubt, but in this case I want to block the connected
line update being sent to the original caller.

Is there any way in the ARI API?  I can't find it.

In related news, I tried to "isolate" my external caller by passing the
incoming call through a Local channel with the I option on the dial.  To
create a point where the connected line update with be blocked.  My
reasoning is then that the Attended transfer can do what it wants to the
channels in the bridge, but the flag in the dial will isolate the original
calling channel  My ARI app can directly tinker with the channel if I do
want to adjust the connected line info - but its 100% under my control.

So I made my dialplan do this:

[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@from-drachtio:1] Goto("PJSIP/drachtio-sip1-0045",
"to-stasis-ariapp,2710900,1") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx_builtins.c: Goto
(to-stasis-ariapp,2710900,1)
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp:1] Set("PJSIP/drachtio-sip1-0045",
"app=ariapp") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp:2] ExecIf("PJSIP/drachtio-sip1-0045",
"0?Set(app=ariapp)") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp:3] Set("PJSIP/drachtio-sip1-0045",
"direction=inbound") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp:4] GotoIf("PJSIP/drachtio-sip1-0045",
"1?to-stasis-ariapp-via-local,2710900,1") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx_builtins.c: Goto
(to-stasis-ariapp-via-local,2710900,1)
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp-via-local:1]
NoOp("PJSIP/drachtio-sip1-0045", "Routing inbound call "0878XX"
<0878XX> -> 2710900 via Local channel to block connected line
updates") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp-via-local:2]
Dial("PJSIP/drachtio-sip1-0045",
"Local/2710900@to-stasis-ariapp-inbound/n,,I") in new stack
[Oct 30 17:51:21] VERBOSE[20289][C-0015] app_dial.c: Called
Local/2710900@to-stasis-ariapp-inbound/n
[Oct 30 17:51:21] VERBOSE[20291][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp-inbound:1]
NoOp("Local/2710900@to-stasis-ariapp-inbound-0006;2", "Routing
inbound call "0878XX" <0878XX> -> 2710900 other side of local
channel") in new stack
[Oct 30 17:51:21] VERBOSE[20291][C-0015] pbx.c: Executing
[2710900@to-stasis-ariapp-inbound:2]
Stasis("Local/2710900@to-stasis-ariapp-inbound-0006;2",
"ariapp,"0878XX <0878XX>,2710900,inbound") in new stack

So what's interesting about this is that is does prevent connected line
updates during the initial setup of the call:

[Oct 30 17:51:24] VERBOSE[20289][C-0015] app_dial.c: Connected line
update to PJSIP/drachtio-sip1-0045 prevented.

However the attended transfer still results in a connected-line update
being sent put to the calling channel through the dial into the Local
channel despite the I flag.

My Asterisk is "Asterisk GIT-master-9189c26M" - which is a master branch
from shortly before 16 was released.

Thanks for any pointers.

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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Controlling the flow of connected line info after attended transfer of stasis-controlled channels

2018-10-30 Thread Richard Mudgett
On Tue, Oct 30, 2018 at 2:02 PM Stephen Davies 
wrote:

> Hi,
>
> I'm looking to see if I've missed something - if not I think there is an
> ARI limitation worth thinking about.
>
> app_dial offers a flag "I" which is supposed to block propagation of
> connected line updates through the dial bridge.  Is there anything like
> this that I can do when setting up and managing a bridge with ARI?
>
> My problem is like so:  I have an incoming call from an "external" source
> to a DDI.  I want to send that source a Remote-Party-Id containing the DDI
> dialled an a name like "ABC Corp".  And I don't want that to change even
> with subsequent transfers etc.
>
> I've got this working for the initial incoming call.  My problem comes
> when the dialled phone does a transfer - specifically I've need testing
> with attended transfer.
>
> (An attended transfer starts with the transferer initiating an "enquiry
> call".  So two bridges.  On the REFER Asterisk does an attended transfer
> with type "link" and inserts a Local channel pair between the two bridges,
> replacing the two channels to the transferring phone.
>
> At this point Asterisk sends the original caller a connected line update
> saying that "you are now talking to 201 Abu".  And tells the target phone
> "you are now talking to the external caller".
>
> Which is true, no doubt, but in this case I want to block the connected
> line update being sent to the original caller.
>
> Is there any way in the ARI API?  I can't find it.
>
> In related news, I tried to "isolate" my external caller by passing the
> incoming call through a Local channel with the I option on the dial.  To
> create a point where the connected line update with be blocked.  My
> reasoning is then that the Attended transfer can do what it wants to the
> channels in the bridge, but the flag in the dial will isolate the original
> calling channel  My ARI app can directly tinker with the channel if I do
> want to adjust the connected line info - but its 100% under my control.
>
> So I made my dialplan do this:
>
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@from-drachtio:1] Goto("PJSIP/drachtio-sip1-0045",
> "to-stasis-ariapp,2710900,1") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx_builtins.c: Goto
> (to-stasis-ariapp,2710900,1)
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp:1] Set("PJSIP/drachtio-sip1-0045",
> "app=ariapp") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp:2] ExecIf("PJSIP/drachtio-sip1-0045",
> "0?Set(app=ariapp)") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp:3] Set("PJSIP/drachtio-sip1-0045",
> "direction=inbound") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp:4] GotoIf("PJSIP/drachtio-sip1-0045",
> "1?to-stasis-ariapp-via-local,2710900,1") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx_builtins.c: Goto
> (to-stasis-ariapp-via-local,2710900,1)
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp-via-local:1]
> NoOp("PJSIP/drachtio-sip1-0045", "Routing inbound call "0878XX"
> <0878XX> -> 2710900 via Local channel to block connected line
> updates") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp-via-local:2]
> Dial("PJSIP/drachtio-sip1-0045",
> "Local/2710900@to-stasis-ariapp-inbound/n,,I") in new stack
> [Oct 30 17:51:21] VERBOSE[20289][C-0015] app_dial.c: Called
> Local/2710900@to-stasis-ariapp-inbound/n
> [Oct 30 17:51:21] VERBOSE[20291][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp-inbound:1]
> NoOp("Local/2710900@to-stasis-ariapp-inbound-0006;2", "Routing
> inbound call "0878XX" <0878XX> -> 2710900 other side of local
> channel") in new stack
> [Oct 30 17:51:21] VERBOSE[20291][C-0015] pbx.c: Executing
> [2710900@to-stasis-ariapp-inbound:2]
> Stasis("Local/2710900@to-stasis-ariapp-inbound-0006;2",
> "ariapp,"0878XX <0878XX>,2710900,inbound") in new stack
>
> So what's interesting about this is that is does prevent connected line
> updates during the initial setup of the call:
>
> [Oct 30 17:51:24] VERBOSE[20289][C-0015] app_dial.c: Connected line
> update to PJSIP/drachtio-sip1-0045 prevented.
>
> However the attended transfer still results in a connected-line update
> being sent put to the calling channel through the dial into the Local
> channel despite the I flag.
>
> My Asterisk is "Asterisk GIT-master-9189c26M" - which is a master branch
> from shortly before 16 was released.
>
> Thanks for any pointers.
>

Look at
https://gerrit.asterisk.org/#/c/asterisk/+/10286/
which has been recently committed to the current branches and
https://g

Re: [asterisk-dev] Controlling the flow of connected line info after attended transfer of stasis-controlled channels

2018-10-30 Thread Stephen Davies
Hi Richard,

Thanks for coming back to me.  I'll pull my source tree up to date and do
some more testing tomorrow.

Could you comment on why the Dial with ,,I doesn't block the connected line
update propagating from the called side of the dial back to the calling
side.  That is what it should do and that's how the code seems to work.  My
impression is that the processing of the REFER seems to propagated the
connected line update all the way back through to the original channel
despite this flag.

Lastly - can I use the interception macros since my channels are under ARI
control via Stasis so I don't have a pbx and the calls are setup from ARI
using the bridge and channel API and not by calling app_dial from anywhere.

Thanks

On Tue, 30 Oct 2018 at 21:29, Richard Mudgett  wrote:

>
>
> On Tue, Oct 30, 2018 at 2:02 PM Stephen Davies 
> wrote:
>
>> Hi,
>>
>> I'm looking to see if I've missed something - if not I think there is an
>> ARI limitation worth thinking about.
>>
>> app_dial offers a flag "I" which is supposed to block propagation of
>> connected line updates through the dial bridge.  Is there anything like
>> this that I can do when setting up and managing a bridge with ARI?
>>
>> My problem is like so:  I have an incoming call from an "external" source
>> to a DDI.  I want to send that source a Remote-Party-Id containing the DDI
>> dialled an a name like "ABC Corp".  And I don't want that to change even
>> with subsequent transfers etc.
>>
>> I've got this working for the initial incoming call.  My problem comes
>> when the dialled phone does a transfer - specifically I've need testing
>> with attended transfer.
>>
>> (An attended transfer starts with the transferer initiating an "enquiry
>> call".  So two bridges.  On the REFER Asterisk does an attended transfer
>> with type "link" and inserts a Local channel pair between the two bridges,
>> replacing the two channels to the transferring phone.
>>
>> At this point Asterisk sends the original caller a connected line update
>> saying that "you are now talking to 201 Abu".  And tells the target phone
>> "you are now talking to the external caller".
>>
>> Which is true, no doubt, but in this case I want to block the connected
>> line update being sent to the original caller.
>>
>> Is there any way in the ARI API?  I can't find it.
>>
>> In related news, I tried to "isolate" my external caller by passing the
>> incoming call through a Local channel with the I option on the dial.  To
>> create a point where the connected line update with be blocked.  My
>> reasoning is then that the Attended transfer can do what it wants to the
>> channels in the bridge, but the flag in the dial will isolate the original
>> calling channel  My ARI app can directly tinker with the channel if I do
>> want to adjust the connected line info - but its 100% under my control.
>>
>> So I made my dialplan do this:
>>
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@from-drachtio:1] Goto("PJSIP/drachtio-sip1-0045",
>> "to-stasis-ariapp,2710900,1") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx_builtins.c: Goto
>> (to-stasis-ariapp,2710900,1)
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp:1] Set("PJSIP/drachtio-sip1-0045",
>> "app=ariapp") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp:2] ExecIf("PJSIP/drachtio-sip1-0045",
>> "0?Set(app=ariapp)") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp:3] Set("PJSIP/drachtio-sip1-0045",
>> "direction=inbound") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp:4] GotoIf("PJSIP/drachtio-sip1-0045",
>> "1?to-stasis-ariapp-via-local,2710900,1") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx_builtins.c: Goto
>> (to-stasis-ariapp-via-local,2710900,1)
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp-via-local:1]
>> NoOp("PJSIP/drachtio-sip1-0045", "Routing inbound call "0878XX"
>> <0878XX> -> 2710900 via Local channel to block connected line
>> updates") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp-via-local:2]
>> Dial("PJSIP/drachtio-sip1-0045",
>> "Local/2710900@to-stasis-ariapp-inbound/n,,I") in new stack
>> [Oct 30 17:51:21] VERBOSE[20289][C-0015] app_dial.c: Called
>> Local/2710900@to-stasis-ariapp-inbound/n
>> [Oct 30 17:51:21] VERBOSE[20291][C-0015] pbx.c: Executing
>> [2710900@to-stasis-ariapp-inbound:1]
>> NoOp("Local/2710900@to-stasis-ariapp-inbound-0006;2", "Routing
>> inbound call "0878XX" <0878XX> -> 2710900 other side of local
>> channel") in new stack
>> [Oct 30 17:51:21] VERBOSE[20291][C-0015] pbx.c: Executing
>> [271

Re: [asterisk-dev] Controlling the flow of connected line info after attended transfer of stasis-controlled channels

2018-10-30 Thread Stephen Davies
On Tue, 30 Oct 2018 at 22:20, Stephen Davies 
wrote:


> Could you comment on why the Dial with ,,I doesn't block the connected
> line update propagating from the called side of the dial back to the
> calling side.  That is what it should do and that's how the code seems to
> work.  My impression is that the processing of the REFER seems to
> propagated the connected line update all the way back through to the
> original channel despite this flag.
>
>
Ah - my apologies, I see its actually documented:

The option blocks all redirecting updates since they should only happen
>> before a call is answered. The option only blocks the connected line update
>> from the initial answer. Connected line updates resulting from call
>> transfers happen after the application has completed. Better control of
>> connected line and redirecting information is obtained using the
>> interception macros.
>
>
So its intended to work the way it works.

So its then important to understand how to use the interception macros or
some equivalent in the context of ARI.

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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

Re: [asterisk-dev] Controlling the flow of connected line info after attended transfer of stasis-controlled channels

2018-10-30 Thread Richard Mudgett
On Tue, Oct 30, 2018 at 3:26 PM Stephen Davies 
wrote:

>
>
> On Tue, 30 Oct 2018 at 22:20, Stephen Davies 
> wrote:
>
>
>> Could you comment on why the Dial with ,,I doesn't block the connected
>> line update propagating from the called side of the dial back to the
>> calling side.  That is what it should do and that's how the code seems to
>> work.  My impression is that the processing of the REFER seems to
>> propagated the connected line update all the way back through to the
>> original channel despite this flag.
>>
>>
> Ah - my apologies, I see its actually documented:
>
> The option blocks all redirecting updates since they should only happen
>>> before a call is answered. The option only blocks the connected line update
>>> from the initial answer. Connected line updates resulting from call
>>> transfers happen after the application has completed. Better control of
>>> connected line and redirecting information is obtained using the
>>> interception macros.
>>
>>
> So its intended to work the way it works.
>
> So its then important to understand how to use the interception macros or
> some equivalent in the context of ARI.
>

The interception routines should work regardless of the channels being in
ARI or not.  You set the interception channel variables to the dialplan
routine.  The routine will execute when a connected line update passes
through.
https://wiki.asterisk.org/wiki/display/AST/Party+ID+Interception+Macros+and+Routines

You setup the CONNECTED_LINE_SEND_SUB and CONNECTED_LINE_SEND_SUB_ARGS
channel variables as if you were going to call the Gosub application:
same = n,Gosub(${CONNECTED_LINE_SEND_SUB}(${CONNECTED_LINE_SEND_SUB_ARGS})
Which is effectively what Asterisk does to call the interception routine.

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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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

[asterisk-dev] Manipulate re-INVITE response in user written Asterisk module

2018-10-30 Thread Andreas Wehrmann

Hello folks,

I'm currently writing a module for Asterisk
to make it divert a video stream to an external videoserver.
The scenario is this:

- some external participant is calling into Asterisk (offering audio+video)

- using SIP session supplements: in the incoming (INVITE) message callback,
  a video session is set up on the videoserver (actually: this happens always, 
regardless of what is offered)

- using the dialplan, the call is routed to another PBX supporting audio only
  (but video codecs are enabled on our side, so video will be offered by 
Asterisk)

- when the other PBX answers, I'm using SIP session supplements to determine 
whether the call answered by the other PBX supports video
-- if video is supported, my module does nothing
-- if video is rejected, I manipulate the SDP inside to make it seem to Asterisk
   as if video actually was supported by inserting connection info pointing to 
the video server

What I've just described does work.
The SIP supplement is registered with a response priority of 
AST_SIP_SESSION_BEFORE_MEDIA
and handles the INVITE method only.

However, what doesn't work is if the external participant initially calls in
with audio only and enables video later by sending a reINVITE.

I do not get a callback from my already registered SIP supplement when the 
other PBX
responds to the reINVITE in order to give me a chance to manipulate the SDP.
I guess this is because the session was already active and thus "AFTER_MEDIA".

When I register a SIP supplement with "AST_SIP_SESSION_AFTER_MEDIA",
I do indeed get a callback for the reINVITE response,
but that happens too late, since SDP negotiation inside Asterisk has already 
happened.

I then tried to register an SDP handler (just to see what callbacks I get and 
whether they might be useful).
The only callback I receive is defer_incoming_sdp_stream() for the reINVITE 
that my Asterisk receives
which doesn't seem too useful for what I'm trying to do.

Since I had no more ideas left, I then tried to hook into PJSIP directly
by providing a pjsip_module that implements the on_rx_response() callback.

That doesn't really work either, because the callback never fired.
After I played around with module priority the callback eventually fired but I 
was unable to get the TSX and dialog references from PJ
(probably because the module got called too early?).
However I need those to get the corresponding ast_sip_session.

At this point, I don't know how to proceed.
Is there a way to hook into reINVITE responses to achieve what I'm trying to do?


Best regards,

Andreas


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

Astricon is coming up October 9-11!  Signup is available at: 
https://www.asterisk.org/community/astricon-user-conference

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