D
D
DmitriyMD2016-04-25 14:36:25
linux
DmitriyMD, 2016-04-25 14:36:25

How to transfer the internal number of the operator and the incoming number from Asterisk to the IS server?

Good afternoon!
Please tell the teapot how to transfer from Asterisk when calling the incoming subscriber number and the number of the operator who picked up the phone?
This is needed to pass parameters to a URL like http://ipadress:port/script?id= <internal number>&number=<client number>
The client number is determined by the ${CALLERID(number)} variable, but I haven't found it yet for the operator number variable.
I understand that all this needs to be written in the dial-plan, but no matter how much I tried, it doesn’t work ...

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
Dmitry Shitskov, 2016-04-25
@DmitriyMD

I think this would work
[macro-curl]
exten => s,1,System(${CURL( http://ipadress:port/script?id=${ARG1}...
[incoming]
exten => s ,1,Answer
exten => s,n,Dial(SIP/111,,M(curl^${DIALEDPEERNUMBER}))

O
oldbro, 2016-04-25
@oldbro

${DIALEDPEERNUMBER} Of course
, it only works after picking up the phone! So when building logic, consider this point.

V
Vladimir, 2016-04-25
@rostel

the most effective way is to write a daemon that listens to AMI events and pulls requests,
this will not require any changes in the
dialplan, you can crutch through calls to Sub-s in app_Dial (see the U parameter) and app_Queue (see the eighth parameter)
there already catching variables
for app_Queue will be noticeable like this

...
same => n,Queue(taxi,t,,,450,,,sub-operator-answer)
...

[sub-operator-answer]
exten => s,1,MSet(AGENTCHAN=${CUT(CHANNEL(Name),\-,1)},CONLINE=${CONNECTEDLINE(number)})
    same => n,NoOp(${CURL(http://ipadress:port/script?id=${AGENTCHAN}&number=${CONLINE})})
    same => n,Hangup()

I can’t vouch for performance, tk. just made it up without any proofreading

D
DmitriyMD, 2016-04-25
@DmitriyMD

I also read about this variable, but did not quite understand how to register it.
Now the dial plan looks like this:
exten => _X.,1,Answer
exten => _X.,n,Dial(SIP/111,${CALLERID(num)})
exten => _X.,n,System( ${CURL( http://ipadress:port/script?id=${DIALEDPEERNUMBER}...
The link is not processed.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question