Re: [asterisk-users] Get channel variables via ARI/AMI
On Mon, Jul 3, 2023 at 12:28 PM TTT wrote: > The uppercase command made a difference. I now get a call-id as show > below. However, does the call-id look valid? The @0.0.0.0 seems strange. > > > > action: Getvar > > actionid: act1 > > channel: PJSIP/Twilio-NA-W-3-In-0028 > > Variable: CHANNEL(pjsip,call-id) > > > > > > Response: Success > > ActionID: act1 > > Variable: CHANNEL(pjsip,call-id) > > Value: 4decf884e3ae74595906283a74f7154e@0.0.0.0 > Call-ID within a SIP dialog is completely opaque. It is what it is. > > > > > As well, can I request many pieces of data at once? The syntax on this > page ( > https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_CHANNEL) > seems to suggest you pass a single parameter, “item”, yet passing just > call-id did not work. I had to pass “pjsip,call-id”. Is the first > parameter a category and the second the detailed item? What if I want to > retrieve multiple items (or all “pjsip” items)? > You can not request multiple at once. Some things require an initial specifier such as pjsip, some things don't. -- 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] Get channel variables via ARI/AMI
The uppercase command made a difference. I now get a call-id as show below. However, does the call-id look valid? The @0.0.0.0 seems strange. action: Getvar actionid: act1 channel: PJSIP/Twilio-NA-W-3-In-0028 Variable: CHANNEL(pjsip,call-id) Response: Success ActionID: act1 Variable: CHANNEL(pjsip,call-id) Value: 4decf884e3ae74595906283a74f7154e@0.0.0.0 As well, can I request many pieces of data at once? The syntax on this page (https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_CHANNEL) seems to suggest you pass a single parameter, “item”, yet passing just call-id did not work. I had to pass “pjsip,call-id”. Is the first parameter a category and the second the detailed item? What if I want to retrieve multiple items (or all “pjsip” items)? -- _ -- 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] Get channel variables via ARI/AMI
On Sun, Jul 2, 2023 at 4:39 PM TTT wrote: > >> You use the AMI action Getvar[1] which allows channel variables and > dialplan functions. > > >> [1] > https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar > > > > > I actually tried that, and although I get “success” I never get useful > data. For example: > > > > action: Getvar > > actionid: act1 > > channel: PJSIP/Twilio-NA-W-2-In-0025 > > Variable: channel(pjsip,call-id) > > > > Response: Success > > ActionID: act1 > > Variable: channel(pjsip,call-id) > > Value: > CHANNEL(pjsip,call-id) Dialplan function names are case sensitive. -- 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] Get channel variables via ARI/AMI
>> You use the AMI action Getvar[1] which allows channel variables and dialplan >> functions. >> [1] >> https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar I actually tried that, and although I get “success” I never get useful data. For example: action: Getvar actionid: act1 channel: PJSIP/Twilio-NA-W-2-In-0025 Variable: channel(pjsip,call-id) Response: Success ActionID: act1 Variable: channel(pjsip,call-id) Value: And the channel in use was I from a call in progress. Thanks Brian -- _ -- 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] Get channel variables via ARI/AMI
On Sun, Jul 2, 2023 at 4:18 PM TTT wrote: > >> There are SOME protocol level things accessible using CHANNEL[1] but > that's it. > > >> [1] > https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_CHANNEL > > > > > > I am trying to use the CHANNEL function listed above from the AMI. Since > it is not an AMI “action”, but rather a dialplan “function”, I’m trying to > figure out how to call this from the AMI. Using a telnet session to the > AMI I’ve tried variations of: > You use the AMI action Getvar[1] which allows channel variables and dialplan functions. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar -- 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] Get channel variables via ARI/AMI
>> There are SOME protocol level things accessible using CHANNEL[1] but that's >> it. >> [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_CHANNEL I am trying to use the CHANNEL function listed above from the AMI. Since it is not an AMI “action”, but rather a dialplan “function”, I’m trying to figure out how to call this from the AMI. Using a telnet session to the AMI I’ve tried variations of: action: command actionid: id123 command: channel(PJSIP/24-1a) but they don’t work. Is the basic concept correct that I can using the “command” action to run a statement that would work in the dialplan? If not, how would I call “channel” from the AMI ? Thanks Brian -- _ -- 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] Get channel variables via ARI/AMI
I need to get hooked up with this class, I could have students doing projects for homework :) Interested in RTCP? j On 6/26/23 7:45 PM, TTT wrote: I’m in training, so I have to demonstrate something SIP related. I figure it would be cool to hack a call, hanging it up while in progress from outside Asterisk. Doing so will demonstrate use/knowledge of ARI, AMI, SIP, route-sets, UDP, etc. Practical value: *zero* J Who knows, maybe this will have an actual application for someone someday. In practical terms I think building a proxy would be the right way to manipulate the SIP for a call in progress, but that sounds like a huge project. I’ve got to demonstrate something by end of week. *From:*asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] *On Behalf Of *Jeff LaCoursiere *Sent:* Monday, June 26, 2023 6:20 PM *To:* asterisk-users@lists.digium.com *Subject:* Re: [asterisk-users] Get channel variables via ARI/AMI On 6/26/23 9:00 AM, Joshua C. Colp wrote: On Mon, Jun 26, 2023 at 10:57 AM TTT wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar I'm curious what the actual application is here - you want to connect to AMI to pull information that you will use to pretend to be a leg, just to send "BYE", when you could just hangup the leg with AMI (or do just about anything else you might think of). Sometimes it is better to fully explain what you are trying to accomplish, and some folks here can try to steer you towards a workable solution. It almost sounds... nefarious. Cheers, -- Jeff LaCoursiere StratusTalk, Inc. 703 496 4990 x108 815 546 6599 cell -- Jeff LaCoursiere StratusTalk, Inc. 703 496 4990 x108 815 546 6599 cell -- _ -- 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] Get channel variables via ARI/AMI
And I have to admit, I have learned a lot just investigating this. (And appreciate the advice) From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere Sent: Monday, June 26, 2023 6:22 PM To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Get channel variables via ARI/AMI On 6/26/23 5:19 PM, Jeff LaCoursiere wrote: On 6/26/23 9:00 AM, Joshua C. Colp wrote: On Mon, Jun 26, 2023 at 10:57 AM TTT mailto:li...@telium.io> > wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar I'm curious what the actual application is here - you want to connect to AMI to pull information that you will use to pretend to be a leg, just to send "BYE", when you could just hangup the leg with AMI (or do just about anything else you might think of). Sometimes it is better to fully explain what you are trying to accomplish, and some folks here can try to steer you towards a workable solution. It almost sounds... nefarious. Meant that towards TTT, not Josh, in case that wasn't clear. -- Jeff LaCoursiere StratusTalk, Inc. 703 496 4990 x108 815 546 6599 cell -- _ -- 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] Get channel variables via ARI/AMI
I’m in training, so I have to demonstrate something SIP related. I figure it would be cool to hack a call, hanging it up while in progress from outside Asterisk. Doing so will demonstrate use/knowledge of ARI, AMI, SIP, route-sets, UDP, etc. Practical value: zero :) Who knows, maybe this will have an actual application for someone someday. In practical terms I think building a proxy would be the right way to manipulate the SIP for a call in progress, but that sounds like a huge project. I’ve got to demonstrate something by end of week. From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Jeff LaCoursiere Sent: Monday, June 26, 2023 6:20 PM To: asterisk-users@lists.digium.com Subject: Re: [asterisk-users] Get channel variables via ARI/AMI On 6/26/23 9:00 AM, Joshua C. Colp wrote: On Mon, Jun 26, 2023 at 10:57 AM TTT mailto:li...@telium.io> > wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar I'm curious what the actual application is here - you want to connect to AMI to pull information that you will use to pretend to be a leg, just to send "BYE", when you could just hangup the leg with AMI (or do just about anything else you might think of). Sometimes it is better to fully explain what you are trying to accomplish, and some folks here can try to steer you towards a workable solution. It almost sounds... nefarious. Cheers, -- Jeff LaCoursiere StratusTalk, Inc. 703 496 4990 x108 815 546 6599 cell -- _ -- 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] Get channel variables via ARI/AMI
On 6/26/23 5:19 PM, Jeff LaCoursiere wrote: On 6/26/23 9:00 AM, Joshua C. Colp wrote: On Mon, Jun 26, 2023 at 10:57 AM TTT wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar I'm curious what the actual application is here - you want to connect to AMI to pull information that you will use to pretend to be a leg, just to send "BYE", when you could just hangup the leg with AMI (or do just about anything else you might think of). Sometimes it is better to fully explain what you are trying to accomplish, and some folks here can try to steer you towards a workable solution. It almost sounds... nefarious. Meant that towards TTT, not Josh, in case that wasn't clear. -- Jeff LaCoursiere StratusTalk, Inc. 703 496 4990 x108 815 546 6599 cell -- _ -- 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] Get channel variables via ARI/AMI
On 6/26/23 9:00 AM, Joshua C. Colp wrote: On Mon, Jun 26, 2023 at 10:57 AM TTT wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar I'm curious what the actual application is here - you want to connect to AMI to pull information that you will use to pretend to be a leg, just to send "BYE", when you could just hangup the leg with AMI (or do just about anything else you might think of). Sometimes it is better to fully explain what you are trying to accomplish, and some folks here can try to steer you towards a workable solution. It almost sounds... nefarious. Cheers, -- Jeff LaCoursiere StratusTalk, Inc. 703 496 4990 x108 815 546 6599 cell -- _ -- 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] Get channel variables via ARI/AMI
According to RFC3261 : It is possible for the CSeq sequence number to be higher than the remote sequence number by more than one. This is not an error condition, and a UAS SHOULD be prepared to receive and process requests with CSeq values more than one higher than the previous received request. So if I use a high value integer (maxint) I’m hoping the UAC will accept my message (though this will mess up future transactions, so other than BYE this is not a viable solution for an ongoing dialog). The other problem I see is that I can't get the route set, so this this would work only with UAC’s on the same network (not NAT/proxies/etc). If I needed to traverse NAT I would need something like Kamilio as Eric points out, to get the route set). Or…maybe PJSIP_HEADERS will give me the route set..I need to experiment with that one). Since this is just for my learning, I want to see if I can hangup a call in progress, running through the asterisk server. This is fun for my learning, so I realize there is of little practical value :) Brian From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Joshua C. Colp Sent: Monday, June 26, 2023 3:56 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Get channel variables via ARI/AMI On Mon, Jun 26, 2023 at 4:35 PM TTT mailto:li...@telium.io> > wrote: I think that’s getting me close. I’m trying to get (or recreate) the FROM and TO lines of the header, from a system running PJSIP. I think if I use CHANNEL to get local_uri and local_tag I can recreate a FROM line like: FROM=;tag=TAG And if I use CHANNEL to get remote_uri and remote_tag I can recreate a FROM line like: TO=;tag=TAG Would it be correct to assume that with this info (and ip:port info) I should be able to send a UDP SIP message from the PBX to the UA which appears to be part of the current call dialog? I realize this is an odd thing to do, but I’m just interested in technical feasibility at this point. Before I try to code this I want to ensure I’m not missing something stupid. Probably not. Sequence number also matters. -- Joshua C. Colp Asterisk Project Lead Sangoma Technologies Check us out at www.sangoma.com <http://www.sangoma.com> and www.asterisk.org <http://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] Get channel variables via ARI/AMI
If you want to do more than just get headers from the INVITE, then you'll need to use an actual SIP Proxy like Kamailio. On 6/26/23 15:03, TTT wrote: It looks like if I call Getvar and pass PJSIP_HEADERS() I can get the entire SIP header for a channel. I also read (on stackoverflow) that the PJSIP_HEADER function will only return the headers from the INVITE of the _inbound_ channel. If that’s correct, how would I get the headers from the outbound channel (second leg of the bridged call) INVITE ? Or will PJSIP_HEADERS() in fact return the header from either inbound out outbound legs? Thanks Brian *From:*asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] *On Behalf Of *Joshua C. Colp *Sent:* Monday, June 26, 2023 10:00 AM *To:* Asterisk Users Mailing List - Non-Commercial Discussion *Subject:* Re: [asterisk-users] Get channel variables via ARI/AMI On Mon, Jun 26, 2023 at 10:57 AM TTT <mailto:li...@telium.io>> wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar <https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar> -- Joshua C. Colp Asterisk Project Lead Sangoma Technologies Check us out at www.sangoma.com <http://www.sangoma.com> and www.asterisk.org <http://www.asterisk.org> -- http://help.nyigc.net/ -- _ -- 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] Get channel variables via ARI/AMI
On Mon, Jun 26, 2023 at 4:35 PM TTT wrote: > I think that’s getting me close. I’m trying to get (or recreate) the FROM > and TO lines of the header, from a system running PJSIP. I think if I use > CHANNEL to get local_uri and local_tag I can recreate a FROM line like: > > *FROM=;tag=TAG* > > > > And if I use CHANNEL to get remote_uri and remote_tag I can recreate a > FROM line like: > > *TO=;tag=TAG* > > > > Would it be correct to assume that with this info (and ip:port info) I > should be able to send a UDP SIP message from the PBX to the UA which > appears to be part of the current call dialog? I realize this is an odd > thing to do, but I’m just interested in technical feasibility at this > point. Before I try to code this I want to ensure I’m not missing > something stupid. > Probably not. Sequence number also matters. -- 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] Get channel variables via ARI/AMI
I think that’s getting me close. I’m trying to get (or recreate) the FROM and TO lines of the header, from a system running PJSIP. I think if I use CHANNEL to get local_uri and local_tag I can recreate a FROM line like: FROM=;tag=TAG And if I use CHANNEL to get remote_uri and remote_tag I can recreate a FROM line like: TO=;tag=TAG Would it be correct to assume that with this info (and ip:port info) I should be able to send a UDP SIP message from the PBX to the UA which appears to be part of the current call dialog? I realize this is an odd thing to do, but I’m just interested in technical feasibility at this point. Before I try to code this I want to ensure I’m not missing something stupid. Thanks Brian From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Joshua C. Colp Sent: Monday, June 26, 2023 3:08 PM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Get channel variables via ARI/AMI On Mon, Jun 26, 2023 at 4:04 PM TTT mailto:li...@telium.io> > wrote: It looks like if I call Getvar and pass PJSIP_HEADERS() I can get the entire SIP header for a channel. I also read (on stackoverflow) that the PJSIP_HEADER function will only return the headers from the INVITE of the inbound channel. If that’s correct, how would I get the headers from the outbound channel (second leg of the bridged call) INVITE ? Or will PJSIP_HEADERS() in fact return the header from either inbound out outbound legs? The answer is, you can't. There are SOME protocol level things accessible using CHANNEL[1] but that's it. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_CHANNEL -- Joshua C. Colp Asterisk Project Lead Sangoma Technologies Check us out at www.sangoma.com <http://www.sangoma.com> and www.asterisk.org <http://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] Get channel variables via ARI/AMI
On Mon, Jun 26, 2023 at 4:04 PM TTT wrote: > It looks like if I call Getvar and pass PJSIP_HEADERS() I can get the > entire SIP header for a channel. I also read (on stackoverflow) that the > PJSIP_HEADER function will only return the headers from the INVITE of the > *inbound* channel. > > > > If that’s correct, how would I get the headers from the outbound channel > (second leg of the bridged call) INVITE ? Or will PJSIP_HEADERS() in fact > return the header from either inbound out outbound legs? > The answer is, you can't. There are SOME protocol level things accessible using CHANNEL[1] but that's it. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+Function_CHANNEL -- 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] Get channel variables via ARI/AMI
It looks like if I call Getvar and pass PJSIP_HEADERS() I can get the entire SIP header for a channel. I also read (on stackoverflow) that the PJSIP_HEADER function will only return the headers from the INVITE of the inbound channel. If that’s correct, how would I get the headers from the outbound channel (second leg of the bridged call) INVITE ? Or will PJSIP_HEADERS() in fact return the header from either inbound out outbound legs? Thanks Brian From: asterisk-users [mailto:asterisk-users-boun...@lists.digium.com] On Behalf Of Joshua C. Colp Sent: Monday, June 26, 2023 10:00 AM To: Asterisk Users Mailing List - Non-Commercial Discussion Subject: Re: [asterisk-users] Get channel variables via ARI/AMI On Mon, Jun 26, 2023 at 10:57 AM TTT mailto:li...@telium.io> > wrote: I am connecting to the ARI with subscribe all, so I can see channels being created. I now want to extract a variety of header variables (at the moment the from and to tag). I tried to read them from the ARI but Asterisk refuses since the channel is not in a stasis app. Is there a way to read these from either the ARI or AMI ? I’m trying not to modify the dialplan. ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar -- Joshua C. Colp Asterisk Project Lead Sangoma Technologies Check us out at www.sangoma.com <http://www.sangoma.com> and www.asterisk.org <http://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] Get channel variables via ARI/AMI
On Mon, Jun 26, 2023 at 10:57 AM TTT wrote: > I am connecting to the ARI with subscribe all, so I can see channels being > created. I now want to extract a variety of header variables (at the > moment the from and to tag). I tried to read them from the ARI but > Asterisk refuses since the channel is not in a stasis app. > > > > Is there a way to read these from either the ARI or AMI ? I’m trying not > to modify the dialplan. > ARI, No. AMI, Yes[1]. [1] https://wiki.asterisk.org/wiki/display/AST/Asterisk+20+ManagerAction_Getvar -- 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