[asterisk-users] Asterisk : using setvar with IP Realtime and variable inheritance

Tilghman Lesher tilghman at mail.jeffandtilghman.com
Mon Jun 9 21:50:03 CDT 2008


On Monday 09 June 2008 20:01:53 Mike wrote:
> I have what I think is a relatively advanced question.  Any help is
> appreciated, even if it's not a complete answer.
>
> I am using Asterisk in mostly realtime fashion, specifically SIP
> registrations are in a MySQL table.  This works fine (mostly).  I also set
> a few variables in the setvar column, like this:
>
> callerid_internal=test <710>;did=5555551234
>
> Again, this works fine. The problem is when I forward my calls to another
> outside line (using Polyocm phones), and need to know the ${did} value at
> that point.  It's empty.

Right, so the call path is:

Provider -- Asterisk -- Polycom -- Asterisk--Provider

The problem is that Polycom is in the call path.  It doesn't know anything
about Asterisk variables and so it doesn't pass them on.  What you can do,
however, is do the forwarding not within the phone, but within Asterisk
itself, something like:

exten => _*71NXX-NXX-XXXX,1,Set(DB(forward/myexten)=${EXTEN:3})
exten => *70,1,NoOp(${DB_DELETE(forward/myexten)})

and then in your dialplan:

exten => 101,1,GotoIf($["${DB(forward/myexten)}" != ""]?forward)
exten => 101,n,Dial(SIP/mypolycom)
exten => 101,n,Voicemail(101,u)
exten => 101,n,Hangup
exten => 101,n(forward),Goto(outgoing,${DB(forward/myexten)},1)

or something like that.

-- 
Tilghman



More information about the asterisk-users mailing list