2
votes

We're using Action:originate to start a call from our crm app. The operator clicks on a link and then asterisk calls the operator extension, and, when he picks up, start calling the outside number. this is working like a charm. But on our website, we want to be able to get a phone number from the visitor and call him. This has to work not on a specific extension, but on a ring group, so that any available agent will pickup the call. 119 is an agent extension, 120 is a ring group.

This works:
Action: originate
Channel: SIP/119 #(agent extension)
Context: from-internal
Exten: 0xxxxxxxx #(number to be called)
Priority: 1
WaitTime: 5
CallerId: CRM <0xxxxxxxx>
Timeout: 30000
Async: true

This does not work, it doesn't ring any of the extensions in the ring group:
Action: originate
Channel: SIP/120 #(ring group to all agent extensions)
Context: from-internal
Exten: 0xxxxxxxx #(number to be called)
Priority: 1
WaitTime: 5
CallerId: CRM <0xxxxxxxx>
Timeout: 30000
Async: true

Do we have to call the ring group in another format? like ring/120??

also, the CallerId: CRM <0xxx> line works correctly if we connect to asterisk via telnet, but it does not work if sent by php sockets. Do we have to make any encode (like utf8_encode or utf8_decode) to match the same format as via telnet?

1

1 Answers

2
votes

How is this ring group implemented? SIP/120 looks like just a single channel. Did you try something like:

Channel: SIP/118&SIP/119

If that doesn't work try originating to a Local channel which does more in the dialplan:

Channel: Local/120@ringgroup/n

where in extensions.conf:

[ringgroup]
exten => _X.,1,Dial(SIP/118&SIP/119)

If both telnet and PHP are using the Asterisk manager interface, then CallerId should work the same for both. Take Wireshark traces and compare them. If all else fails, use the Local channel like I just described, and set the caller ID in the dialplan before the Dial.