[asterisk-users] Set variables from one asterisk ta a second.

Stuart Elvish - IP Exchange Systems asterisk.lists at ipesys.com
Mon Apr 16 05:47:07 CDT 2012


If you are using IAX and a later version (I know it works in 1.8.x) you
can use IAXVAR.

The following URL has a post which has a good example.


Kind Regards
Stuart Elvish

On 04/16/2012 08:16 AM, Steve Edwards wrote:
> On Sun, 15 Apr 2012, Olivier CALVANO wrote:
>> actually, i have a asterisk server with all SIP Account.
>> this Asterisk server sent all outgoing call to a second Asterisk
>> server (and this asterisk sent to the
>> telco)
>> On the first Asterisk, i use:
>>        exten => _x,1,Set(CDR(CodeTier)=BUS-FRAMOBI)
>>        exten => _x,2,Set(CALLERID(num)=${CALLERIDNUM})
>>        exten => _x,3,Dial(IAX2/Srv2/${EXTEN},180,rt)
>>        exten => _x,4,Hangup
>> i have SIP user: USRSIP001
>> (user sip is in realtime)
>> he use this name with a password
>> i want that the first server sent to the second into a variable the
>> "USRSIP001"
>> for get it into a AGI script.
>> It's possible ?
> Yes.
> (I'm just a 1.2 Luddite, so the exact capabilities and syntax available
> to your version may be different.)
> The first question is 'Do you want to use SIP or IAX?' You've used IAX
> in your dialplan snippet, but you may want to consider SIP. The initial
> configuration is a bit more involved, but you will have a more flexible
> and maintainable solution.
> Using IAX is simpler but you are limited to 'overloading' the caller ID
> 'name' and 'num' fields*. If you have more than a couple of fields of
> data to pass you may find it easier to pass a 'key' (like the server
> name and the channel unique ID) and use that to retrieve data from a
> database instead of having to parse a bunch of fields from the caller ID
> name or number.
> Using SIP you can also pass data by adding custom SIP headers.
> Personally, I've always used IAX because it was easy and it worked in my
> environment. If I were to start over, I would seriously consider SIP.
> A simple IAX example snippet...
> On server1:
>     exten = *,n,            set(CALLERID(name)=olivier-calvano)
>     exten = *,n,            dial(iax2/server2/${EXTEN})
>     exten = *,n,            hangup()
> On server2:
>     exten = *,n,            set(FIRST=${CUT(CALLERID(name),,1)})
>     exten = *,n,            set(LAST=${CUT(CALLERID(name),,2)})
>     exten = *,n,            agi(lookup-client,${FIRST},${LAST})
>     exten = *,n,            hangup()
> *) The extension and context are also under your control and can be set
> in the IAX 'dial string' but manipulating these fields to pass multiple
> data fields can get convoluted.

More information about the asterisk-users mailing list