Re: [asterisk-users] Channel Variable inheritance

2021-02-23 Thread Joshua C. Colp
On Tue, Feb 23, 2021 at 4:44 PM Michael Munger  wrote:

> I have a blacklisting system to deal with robocalls. Transferring a given
> call to extension *88 will add the CALLERID(num) to astdb, and when that
> number calls back, it goes straight to tt-monkeys.
>
> Problem:
>
> With Polycom phones, transfer -> blind -> *88 works just fine. But,
> transfer -> *88 (attended transfer) does not work. I assume that's because
> an attended transfer is creating a new channel, and the CALLERID(num) of
> the attended transfer is the CID of the station making the call. So, I
> decided to save the incoming CID into __ORIGINAL_CALLER_ID, with the
> assumption that the variable would be inherited into subsequent channels,
> but that does not work either.
>
> What am I missing?
>

Until such time as the attended transfer is completed there is no
association between things. Until that point, the call just appears as
another call from the phone.

Joshua C. Colp
Asterisk Technical 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

[asterisk-users] Channel Variable inheritance

2021-02-23 Thread Michael Munger
I have a blacklisting system to deal with robocalls. Transferring a 
given call to extension *88 will add the CALLERID(num) to astdb, and 
when that number calls back, it goes straight to tt-monkeys.


Problem:

With Polycom phones, transfer -> blind -> *88 works just fine. But, 
transfer -> *88 (attended transfer) does not work. I assume that's 
because an attended transfer is creating a new channel, and the 
CALLERID(num) of the attended transfer is the CID of the station making 
the call. So, I decided to save the incoming CID into 
__ORIGINAL_CALLER_ID, with the assumption that the variable would be 
inherited into subsequent channels, but that does not work either.


What am I missing?

Asterisk: 13.14.1~dfsg-2+deb9u4

OS: Debian 9.13 (Stretch).

--


Michael Munger, dCAP, MCPS, MCNPS, MBSS
*Microsoft Certified Professional*
*Microsoft Certified Small Business Specialist*
*Digium Certified Asterisk Professional*
*High Powered Help, Inc.*
p:  678-905-8569
w:  hph.io  e: m...@hph.io 



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

Check out the new Asterisk community forum at: https://community.asterisk.org/

New to Asterisk? Start here:
  https://wiki.asterisk.org/wiki/display/AST/Getting+Started

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

[asterisk-users] Channel Variable

2009-11-25 Thread Nic Colledge
Hi

I have been using the CHANNEL variable as a way of checking if a user is 
allowed to make outgoing calls, and what their source caller ID should be 
(these values are in a database).
This works all of the time with SIP and most of the time with IAX, however 
sometimes with IAX the channel variable seems to be wrong.
I have been using Zoiper as my IAX client and Asterisk 1.6.2.0-rc6.

For the sake of debugging I have Verbose(1,Outgoing Call Handler 
${CUT(CHANNEL,-,1)}) in the (internal - not default) dial plan.

Most of the time the channel variable is IAX2/10007 which is the desired 
behaviour (with 10007 being the IAX username) but some of the time 
IAX2/192.168.1.111:4569 is shown instead.

I would like to know why this is happening and if there is anything that can be 
done to make it show the IAX2/10007 form every time?

I realise that I could use ${CDR(accountcode)} instead, and as it happens this 
returns the correct account code value in both cases. However, I wanted to be 
able to do this on a per-channel basis and multiple channels currently share a 
common accountcode.

Any ideas what's going on here, is there something obvious I'm missing?

Thanks in advance.

Regards,
Nic

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

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

Re: [asterisk-users] Channel Variable

2009-11-25 Thread razu
I believe ${IAXPEER(CURRENTCHANNEL)} should help you with the current
IAX2 name ... you can make DumpChan() to understand what kind of channel
variables you can use there.

--
razu

On 11/25/2009 09:57 PM, Nic Colledge wrote:
 Hi

 I have been using the CHANNEL variable as a way of checking if a user is 
 allowed to make outgoing calls, and what their source caller ID should be 
 (these values are in a database).
 This works all of the time with SIP and most of the time with IAX, however 
 sometimes with IAX the channel variable seems to be wrong.
 I have been using Zoiper as my IAX client and Asterisk 1.6.2.0-rc6.

 For the sake of debugging I have Verbose(1,Outgoing Call Handler 
 ${CUT(CHANNEL,-,1)}) in the (internal - not default) dial plan.

 Most of the time the channel variable is IAX2/10007 which is the desired 
 behaviour (with 10007 being the IAX username) but some of the time 
 IAX2/192.168.1.111:4569 is shown instead.

 I would like to know why this is happening and if there is anything that can 
 be done to make it show the IAX2/10007 form every time?

 I realise that I could use ${CDR(accountcode)} instead, and as it happens 
 this returns the correct account code value in both cases. However, I wanted 
 to be able to do this on a per-channel basis and multiple channels currently 
 share a common accountcode.

 Any ideas what's going on here, is there something obvious I'm missing?

 Thanks in advance.

 Regards,
 Nic
   


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

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


Re: [asterisk-users] Channel variable to identify the calling SIP peer

2009-01-07 Thread Grygoriy Dobrovolskyy
core show function SIPPEER

2009/1/6 Klaus Darilion klaus.mailingli...@pernau.at

 since 1.4 you can also use

 setvar=foo=bar

 in sip.conf when configuring the peer. Then the channel variable foo is
 automatically set to bar for calls initiated by this peer.

 regards
 klaus

 Philipp Kempgen wrote:
  Grey Man schrieb:
  On Wed, Nov 26, 2008 at 11:47 AM, Richard Brady rnbr...@gmail.com
 wrote:
  Hi folks
 
  I'm not sure what I am missing but I cannot find a predefined channel
  variable to identify the SIP peer/user which has initiated a call and
  established the channel.
 
  The one option is to extract it from the CHANNEL variable, but that is
  fraught with difficulties.
 
  Is there another variable I don't know about or another way to do this?
  In 1.2 and 1.4 I don't believe there is any other way. Parsing the
  username from the channel name is what we ended up having to do!
 
  Since 1.6 there is CHANNEL(peername).
 
 
 Philipp Kempgen
 

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

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

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

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

Re: [asterisk-users] Channel variable to identify the calling SIP peer

2009-01-07 Thread Klaus Darilion


Grygoriy Dobrovolskyy schrieb:
 core show function SIPPEER


Does not work. Using the SIPPEER function you have to know the name of 
the peer already.

regards
klaus

 2009/1/6 Klaus Darilion klaus.mailingli...@pernau.at 
 mailto:klaus.mailingli...@pernau.at
 
 since 1.4 you can also use
 
 setvar=foo=bar
 
 in sip.conf when configuring the peer. Then the channel variable foo is
 automatically set to bar for calls initiated by this peer.
 
 regards
 klaus
 
 Philipp Kempgen wrote:
   Grey Man schrieb:
   On Wed, Nov 26, 2008 at 11:47 AM, Richard Brady
 rnbr...@gmail.com mailto:rnbr...@gmail.com wrote:
   Hi folks
  
   I'm not sure what I am missing but I cannot find a predefined
 channel
   variable to identify the SIP peer/user which has initiated a
 call and
   established the channel.
  
   The one option is to extract it from the CHANNEL variable, but
 that is
   fraught with difficulties.
  
   Is there another variable I don't know about or another way to
 do this?
   In 1.2 and 1.4 I don't believe there is any other way. Parsing the
   username from the channel name is what we ended up having to do!
  
   Since 1.6 there is CHANNEL(peername).
  
  
  Philipp Kempgen
  
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users
 
 
 
 
 
 ___
 -- Bandwidth and Colocation Provided by http://www.api-digital.com --
 
 asterisk-users mailing list
 To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users

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

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


Re: [asterisk-users] Channel variable to identify the calling SIP peer

2009-01-06 Thread Klaus Darilion
since 1.4 you can also use

setvar=foo=bar

in sip.conf when configuring the peer. Then the channel variable foo is 
automatically set to bar for calls initiated by this peer.

regards
klaus

Philipp Kempgen wrote:
 Grey Man schrieb:
 On Wed, Nov 26, 2008 at 11:47 AM, Richard Brady rnbr...@gmail.com wrote:
 Hi folks

 I'm not sure what I am missing but I cannot find a predefined channel
 variable to identify the SIP peer/user which has initiated a call and
 established the channel.

 The one option is to extract it from the CHANNEL variable, but that is
 fraught with difficulties.

 Is there another variable I don't know about or another way to do this?
 In 1.2 and 1.4 I don't believe there is any other way. Parsing the
 username from the channel name is what we ended up having to do!
 
 Since 1.6 there is CHANNEL(peername).
 
 
Philipp Kempgen
 

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

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


Re: [asterisk-users] Channel variable to identify the calling SIP peer

2008-12-03 Thread Richard Brady
Thanks Grey and Philipp

Parsing the channel name is what we have been doing, but this has an
unfortunate dependence on username as opposed to peer name. The username
property of a SIP peer is not very well documented, and when using realtime
SIP, it's an immutable field once loaded into cache.

So I look forward to the day we can upgrade!

Richard


On Sun, Nov 30, 2008 at 6:47 PM, Philipp Kempgen
[EMAIL PROTECTED]wrote:

 Grey Man schrieb:
  On Wed, Nov 26, 2008 at 11:47 AM, Richard Brady [EMAIL PROTECTED]
 wrote:
  Hi folks
 
  I'm not sure what I am missing but I cannot find a predefined channel
  variable to identify the SIP peer/user which has initiated a call and
  established the channel.
 
  The one option is to extract it from the CHANNEL variable, but that is
  fraught with difficulties.
 
  Is there another variable I don't know about or another way to do this?
 
  In 1.2 and 1.4 I don't believe there is any other way. Parsing the
  username from the channel name is what we ended up having to do!

 Since 1.6 there is CHANNEL(peername).


   Philipp Kempgen

 --
 http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
 Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
 Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
 --

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

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

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

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

Re: [asterisk-users] Channel variable to identify the calling SIP peer

2008-11-30 Thread Philipp Kempgen
Grey Man schrieb:
 On Wed, Nov 26, 2008 at 11:47 AM, Richard Brady [EMAIL PROTECTED] wrote:
 Hi folks

 I'm not sure what I am missing but I cannot find a predefined channel
 variable to identify the SIP peer/user which has initiated a call and
 established the channel.

 The one option is to extract it from the CHANNEL variable, but that is
 fraught with difficulties.

 Is there another variable I don't know about or another way to do this?
 
 In 1.2 and 1.4 I don't believe there is any other way. Parsing the
 username from the channel name is what we ended up having to do!

Since 1.6 there is CHANNEL(peername).


   Philipp Kempgen

-- 
http://www.das-asterisk-buch.de  -  http://www.the-asterisk-book.com
Amooma GmbH - Bachstr. 126 - 56566 Neuwied  -  http://www.amooma.de
Geschäftsführer: Stefan Wintermeyer, Handelsregister: Neuwied B14998
-- 

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

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


Re: [asterisk-users] Channel variable to identify the calling SIP peer

2008-11-26 Thread Grey Man
On Wed, Nov 26, 2008 at 11:47 AM, Richard Brady [EMAIL PROTECTED] wrote:
 Hi folks

 I'm not sure what I am missing but I cannot find a predefined channel
 variable to identify the SIP peer/user which has initiated a call and
 established the channel.

 The one option is to extract it from the CHANNEL variable, but that is
 fraught with difficulties.

 Is there another variable I don't know about or another way to do this?

In 1.2 and 1.4 I don't believe there is any other way. Parsing the
username from the channel name is what we ended up having to do!

Regards,

Greyman.

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

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


[asterisk-users] Channel variable to identify the calling SIP peer

2008-11-26 Thread Richard Brady
Hi folks

I'm not sure what I am missing but I cannot find a predefined channel
variable to identify the SIP peer/user which has initiated a call and
established the channel.

The one option is to extract it from the CHANNEL variable, but that is
fraught with difficulties.

Is there another variable I don't know about or another way to do this?

Thanks in advance!

Richard

--
Richard Brady
T: +44 (0)7771 623 348
E: [EMAIL PROTECTED]
___
-- Bandwidth and Colocation Provided by http://www.api-digital.com --

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

[asterisk-users] Channel variable settings

2008-04-26 Thread Administrator TOOTAI
Hi all,

we are running Asterisk SVN-branch-1.4-r114299 and face following 
problem: we have a main extension (102) and other extensions (104 and 107)

When extension 104 is calling extension 107 and 107 is on the phone, the 
caller is parked for 5 seconds (Park-And-Announce) and the going back to 
the called extension (busyNUMBER). After 6 loops in busy state, the call 
has to be forwarded to main extension which is 102. Everything is 
working perfectly with one call is this loop. If a second call enter 
this loop, the busyNUMBER is replaced by the last asked extension, even 
for calls already in the loop!

I was expecting that one call -here SIP channel- is one channel so 
variables and their values are independent of the concurrent calls in 
this channel. the busyNUMBER is _not_defined as a global variable and is 
unique in the dialplan.

Is this behaviour normal or related to ParkAndAnnounce? Another solution 
would be to create an unique variable like (tested but it's not working):

exten = _X.,1,Set(busyNUMBER=${UNIQUEID})
exten = _X.,n,Set($[${busyNUMBER}]=${EXTEN})

Is something like this existing?

Thanks for your feedback. Relevant part of the dialplan is:

[dial-local]

exten = _X.,1,Set(GLOBAL(__DIALEDNUMBER)=${EXTEN})
exten = _X.,n,Set(busyNUMBER=${EXTEN})
exten = _X.,n,Set(VoiceMail=u)
exten = _X.,n,Set(StatusPrio=1)
exten = _X.,n,macro(rec,)
exten = _X.,n,GotoIf($[${DIALEDNUMBER} = 
${CALLERID(number)}]?extendedVM)
exten = 
_X.,n(BackFromBusy),Dial(SIP/${DIALEDNUMBER},${SIPTIMERING},${DIALOPT})
exten = _X.,n,Goto(onDialStatus-local,s-${DIALSTATUS},${StatusPrio})

exten = _X.,20(extendedVM),NoOp(User ${CALLERID(number)} enter extended 
voicemail)
exten = _X.,n,StopMonitor
exten = _X.,n,VoiceMailMain()
exten = _X.,n,Hangup

exten = _70[1-9],1,ParkedCall(${EXTEN})

[onDialStatus-local]
exten = s-BUSY,1,Set(VoiceMail=b)
exten = s-BUSY,n,Set(CHANNEL(LANGUAGE)=fr)
exten = s-BUSY,n,Set(countParkedLoop=0)
exten = s-BUSY,n,Background(busy-pls-hold)
exten = 
s-BUSY,n(AfterAnnounce),Set(countParkedLoop=$[${countParkedLoop}+1])
exten = s-BUSY,n,GotoIf($[${countParkedLoop}  7]?:ReturnToMainLoop)
exten = s-BUSY,n,ParkAndAnnounce(pbx-transfer:PARKED|5|SIP/${busyNUMBER}})
exten = s-BUSY,n,Set(StatusPrio=AfterAnnounce)
exten = s-BUSY,n,Goto(dial-local,${busyNUMBER},BackFromBusy)
exten = s-BUSY,n(ReturnToMainLoop),Goto(dial-local,102,1)


-- 
Daniel

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

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


[asterisk-users] channel variable

2006-08-24 Thread unplug

Hi,

 I have set some variable in a call.
Set(testmode=1)
 For some reason, such as forward the call, the follow command called.
Dial(Local/1234567)
 It will go through the dial plan again but the value of variable
testmode is nothing instead of 1.

How can I maintain the value of the variable in the above case?

unplug
___
--Bandwidth and Colocation provided by Easynews.com --

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


RE: [Asterisk-Users] Channel Variable

2005-01-08 Thread Bill Seddon








Does anyone know how to get the channel ID on the
other side of the call?



Assaf, I dont know if there is such
an ID available. However if there is not, the value you want is pushed
out in one of the events that Asterisk publishes to AGI connections when a call
is constructed. As it result it ought to be possible to write an AGI
script using, say, Perl to capture this value and write it back as a Dialplan
variable.



Bill Seddon











From:
[EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Assaf Benharoosh
Sent: January 08, 2005 12:27 AM
To: Asterisk Users Mailing List -
 Non-Commercial Discussion
Subject: [Asterisk-Users] Channel
Variable







Hi all,





Does anyone know how to get the channel ID on the other side
of the call? 





For example: When SIP/50 calls SIP/21, and the call is
answered by SIP/21 I get:











SIP/21-6735 answered SIP/50-b456











${CHANNEL} will show me SIP/50-b456. 





Is there a parameter or a workaround to get the SIP/21-6735
part?











Thanks.



Assaf Benharoosh






___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

RE: [Asterisk-Users] Channel Variable

2005-01-08 Thread Assaf Benharoosh



Bill,
Are 
you sure there's an AGI enviroment variable that gives me that? I couldn't find 
any:

-- accountcode =-- callerid = "Assaf Benharoosh" 
21-- channel = SIP/26-f39a-- context = 
extensions-- dnid = 45-- enhanced = 0.0-- 
extension = 45-- language = en-- priority = 1-- 
rdnis = unknown-- request = agi-test.agi-- type = 
SIP-- uniqueid = 1105227054.140

I'm 
trying to get the other side channel string. If I run the AGI before the dial- 
is it all possible?

Assaf BenharooshMCP, MCSA, MCSE[EMAIL PROTECTED]Frantic, 
LLC.246 West 38th 
Street2nd FloorNew York, NY 
10018T: (212) 
302-5790F: (646) 201-9418C: (516) 805-7981



From: [EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Bill 
SeddonSent: Saturday, January 08, 2005 4:21 AMTo: 
'Asterisk Users Mailing List - Non-Commercial Discussion'Subject: RE: 
[Asterisk-Users] Channel Variable


Does anyone know how to get 
the channel ID on the other side of the call?

Assaf, I dont know if 
there is such an ID available. However if there is not, the value you want 
is pushed out in one of the events that Asterisk publishes to AGI connections 
when a call is constructed. As it result it ought to be possible to write 
an AGI script using, say, Perl to capture this value and write it back as a 
Dialplan variable.

Bill 
Seddon





From: 
[EMAIL PROTECTED] 
[mailto:[EMAIL PROTECTED] On Behalf Of Assaf BenharooshSent: January 08, 2005 12:27 AMTo: Asterisk Users Mailing List - 
Non-Commercial DiscussionSubject: [Asterisk-Users] Channel 
Variable


Hi all,

Does anyone know how to get the 
channel ID on the other side of the call? 

For example: When SIP/50 calls 
SIP/21, and the call is answered by SIP/21 I get:



SIP/21-6735 answered 
SIP/50-b456



${CHANNEL} will show me SIP/50-b456. 


Is there a parameter or a workaround 
to get the SIP/21-6735 part?



Thanks.
Assaf 
Benharoosh
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users

[Asterisk-Users] Channel Variable

2005-01-07 Thread Assaf Benharoosh



Hi 
all,
Does anyone know how 
to get the channel ID on the other side of the call? 
For example: When 
SIP/50 calls SIP/21, and the call is answered by SIP/21 I 
get:

SIP/21-6735 answered 
SIP/50-b456

${CHANNEL} will show 
me SIP/50-b456. 
Is there a parameter 
or a workaround to get the SIP/21-6735 part?

Thanks.
Assaf Benharoosh
___
Asterisk-Users mailing list
Asterisk-Users@lists.digium.com
http://lists.digium.com/mailman/listinfo/asterisk-users
To UNSUBSCRIBE or update options visit:
   http://lists.digium.com/mailman/listinfo/asterisk-users