Click to call - Queue

Hello Everyone;
I need to call to queue and then when the member answer the call it call to customer
ie originat to the queue by changing channel to be a queue (and not SIP/510)
I get figure out what to put in this line: fputs($connectSocket, “Channel: SIP/510\r\n”);

The code and thank G-d it works.

fputs($connectSocket, “Action: Login\r\n”);
fputs($connectSocket, “Events: off\r\n”);
fputs($connectSocket, "UserName: " . $user . “\r\n”);
fputs($connectSocket, "Secret: " . $pass . “\r\n\r\n”);/
fputs($connectSocket, “Action: originate\r\n”);
\insted of sip SIP/510 I want to put it to a Queue and I can’t figure it out???
fputs($connectSocket, “Channel: SIP/510\r\n”);
fputs($connectSocket, “WaitTime: $strWaitTime\r\n”);
fputs($connectSocket, “CallerId: $strCallerId\r\n”);
fputs($connectSocket, “Timeout: 20000\r\n”);
fputs($connectSocket, “Exten: $someNumber\r\n”);
fputs($connectSocket, “Context: $strContext\r\n”);
fputs($connectSocket, “Priority: $strPriority\r\n\r\n”);

Any help would be appriciated.



for example

exten => myqueue,1,Queue(myqueue1|rTt|||120)

then in the originate

Channel: Local/myqueue@queues\n


Ian - thankyou.
Your sujestion almost worked.
With what you said we change to this:
and it worked!!! :smiley:
Now my issue is this:
I wanted it to originate with the queue.
When the representive answers then goto the client.
The code above did the opposite.
I will let you know how things procede.


Ok looks like you are using freepbx variant ( you didnt mention this )
you need to look at teh verbose output as it “should” work as you expect , what you may find is that you answr the call before the call is queued.


You are so right! I am using freePBX and didn’t know that was an issue.
The order that I get is as follows:

  1. The client gets the call.
  2. The client is queued.
  3. The Agent receives the call when available
    I was trying to do a different order ie.
    The request is queued…
  4. The Agent receives the call when available.
  5. The client gets the call.

I still can’t do that - I tried switching the order.
Lastly Ian where and how did you learn so much?
Nice talking to you, Daniel


You need to look at teh verbose output , your call is being answered as it enters the queue. I think you will have to set up a custome diaplan to do this.

Nearly 30 years designing telecoms solutions, and voip for 15 years :smile:

Well done Ian!
I am happy with the way it worked out and you helped me.
Thanks. Daniel