phpari icon indicating copy to clipboard operation
phpari copied to clipboard

CALLERID(name) does not work,

Open wilcarjose opened this issue 6 years ago • 6 comments

Hi @greenfieldtech-nirs I am using the basic StasisAppDial.php example, but It doesn't work when I send "CALLERID(name)" => "test"

Could there be a bug in the library?

$response = $this->phpariObject->channels()->channel_originate(
                        $args[0],
                        NULL,
                        array(
                            "app"     => "stasis-dial",
                            "appArgs" => '',
                            "timeout" => $args[1],
                            "callerId" => '888888888'
                        ),
                        array(
                            "CALLERID(name)" => "test"
                        )
                    );

wilcarjose avatar Nov 29 '18 10:11 wilcarjose

Hi Nir, to give you more information about this problem, look please to the ari debug:

<--- Sending ARI event to 192.168.0.110:48220 ---> { "type": "ChannelStateChange", "timestamp": "2018-11-29T12:25:45.822+0100", "channel": { "id": "A2-1543490745.338", "name": "PJSIP/ricardo10-0000010b", "state": "Ringing", "caller": { "name": "prueba", "number": "888888888" }, "connected": { "name": "", "number": "888888888" }, "accountcode": "ricardo10", "dialplan": { "context": "prepago-dev", "exten": "s", "priority": 1 }, "creationtime": "2018-11-29T12:25:45.752+0100", "language": "en" }, "asterisk_id": "50:9a:4c:77:e6:41", "application": "stasis-dial" } -- PJSIP/ricardo10-0000010b is ringing -- PJSIP/ricardo10-0000010b is ringing

As you can see we're missing the content of the field "name". So the called part just get the number but not the name when his phone rings. We're using the simple stasis example just to be sure that is nothing regarding our code.

Are we doing something wrong?

Thanks Nir

richilp avatar Nov 29 '18 11:11 richilp

Here is more readable:

"connected": { "name": "", "number": "888888888" }

richilp avatar Nov 29 '18 11:11 richilp

Hello Nir,

did you get any chance to check that?. Looks like a little detail, but we haven't found it :(

Thanks

richilp avatar Feb 08 '19 10:02 richilp

Hi Guys,

Sorry for the delay on issues, simply ultra busy with real-life stuff. I'll do my best to attend to this in the next couple of week - while I'm abroad.

Nir S

greenfieldtech-nirs avatar Feb 09 '19 10:02 greenfieldtech-nirs

Actually, now that I think about it - I'm not sure PHP will accept "CALLERID(name)" or "anything(anything)" as a valid array index. Interesting for sure.

greenfieldtech-nirs avatar Feb 09 '19 10:02 greenfieldtech-nirs

Hi Nir,

we've been working around this issue.

Yes, PHP accepts anything(anything), we're able to send the variable with all the info.

Eventually we've checked that sending CALLERID(name):

$params = [ "app" => $appname, // incoming "appArgs" => '', "timeout" => $timeout, "callerId" => $callerId, 'context' => $context, ]; $variables = [ 'CALLERID(name)' = 'Ri', } $this->response = $this->ari->channels()->originate( $to, null, $params, $variables );

doesn't work but sending CALLERID(all):

$params = [ "app" => $appname, // incoming "appArgs" => '', "timeout" => $timeout, "callerId" => $callerId, 'context' => $context, ]; $variables = [ 'CALLERID(all)' = 'Ri<999999999>', } $this->response = $this->ari->channels()->originate( $to, null, $params, $variables );

works !!

Does this make sense to you?. For us is more than ok to work that way, but just wondering if this information ring a bell to you.

Thanks for everything Nir ;)

richilp avatar Mar 05 '19 13:03 richilp