How about...
exten => _X.,1,NoOp()
exten => _X.,2,Set(DEVICE=${CUT(CHANNEL,,1)})
exten => _X.,3,Set(NULL="${REALTIME(agents,device,${DEVICE})}")
exten => _X.,4,Set(usernamepair=${CUT(NULL,\,,1)})
exten => _X.,5,Set(username=${CUT(usernamepair,=,2)})
exten => _X.,6,NoOp(DEVICE is ${DEVICE})
exten => _X.,7,NoOp(USERNAME is ${USERNAME})
exten => _X.,8,NoOp(username is ${username})
the REALTIME function returns a delimited string, it doesn't automatically
assign variables...
Perhaps you are thinking of the realtime application which would assign
variables? That has however was deprecated in 1.4 and has been removed from
1.6 in favour of the function which only returns a string...
d
On 29 March 2010 21:42, Jason Walker <jason.walker at amgsrv.com> wrote:
> It seems that my realtime is not assigning channel variables correctly.
>
>
>
> INFO
>
> Asterisk 1.6.0.26
>
>
>
> Exten.conf
>
> exten => _X.,1,NoOp()
>
> exten => _X.,2,Set(DEVICE=${CUT(CHANNEL,,1)})
>
> exten =>
_X.,3,Set(NULL="${REALTIME(agents,device,${DEVICE})}")
>
> exten => _X.,4,NoOp(DEVICE is ${DEVICE})
>
> exten => _X.,5,NoOp(USERNAME is ${USERNAME})
>
> exten => _X.,6,NoOp(username is ${username})
>
>
>
>
>
> CLI
>
>
>
> -- Executing [x at default:1] NoOp("SIP/1156-000055ce",
"") in new stack
>
> -- Executing [x at default:2] Set("SIP/1156-000055ce",
"DEVICE=SIP/1156")
> in new stack
>
> -- Executing [x at default:3] Set("SIP/1156-000055ce",
> "NULL="username=john.smith,name=John
>
Smith,department=Dept_A,routable=no,extension=1234,device=SIP/1156,voicemail=no,monitor=yes,visible=yes,date_modified=2010-02-09
> 14:12:01,"") in new stack
>
> -- Executing [x at default:4] NoOp("SIP/1156-000055ce",
"DEVICE is
> SIP/1156") in new stack
>
> -- Executing [x at default:5] NoOp("SIP/1156-000055ce",
"USERNAME is ")
> in new stack
>
> -- Executing [x at default:6] NoOp("SIP/1156-000055ce",
"username is ")
> in new stack
>
>
>
> So I can see it is getting info from the database in Line 3
>
>
>
> But only the direct set variable command (Line 2) and Result (Line 4) work
>
>
>
> Lines 5 and 6 do not get the john.smith assigned
>
>
>
> Help
>
>
>
>
>
> Confidentiality Statement & Notice: This email is covered by the
> Electronic Communications Privacy Act, 18 U.S.C. 2510-2521 and
> intended only for the use of the individual or entity to whom it is
> addressed. Any review, retransmission, dissemination to unauthorized
> persons or other use of the original message and any attachments is
> strictly prohibited. If you received this electronic transmission in error,
> please reply to the above-referenced sender about the error and
> permanently delete this message. Thank you for your cooperation.
>
>
> --
> _____________________________________________________________________
> -- Bandwidth and Colocation Provided by http://www.api-digital.com --
> New to Asterisk? Join us for a live introductory webinar every Thurs:
> http://www.asterisk.org/hello
>
> asterisk-users mailing list
> To UNSUBSCRIBE or update options visit:
> http://lists.digium.com/mailman/listinfo/asterisk-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://lists.digium.com/pipermail/asterisk-users/attachments/20100329/f804d8b6/attachment.htm