PAMI outbound call issue using DHADI

Hi Guys!
I am using PAMI to originate calls to the desired extensions in the local scope.
Desired functionality is:
When the dialed extension is been picked up by the operator it should then automatically dial the customer number after. But it rather dials other local extension numbers automatically.

I need to know what I am doing wrong here, please if someone could help

Code i have used in the php script is below:

$actionid = md5(uniqid());
$originateMsg = new OriginateAction(“SIP/726@voipgw”);
$originateMsg->setContext(‘from-internal’);
$originateMsg->setPriority(‘1’);
$originateMsg->setExtension(“08008085883”);//$destCallerId
$originateMsg->setCallerId(“08008085883”);
$originateMsg->setTimeout(20000);
$originateMsg->setAsync(true);
$originateMsg->setActionID($actionid);
$a->send($originateMsg);

Can you post your dialplan for voipgw and from-internal contexts?
I have a feeling that you are answering call in voipgw before dialing to your SIP end point.

–Satish Barot

extension.conf

Please check the file above i have shared with you, have the dial plans in it.

This is a FreePBX generated dialplan. We do not support FreePBX. For FreePBX peer support, use https://community.freepbx.org/

1 Like

Solution that worked for me:

$originateMsg = new OriginateAction(‘SIP/ExtensionNumberHere’);
$originateMsg->setExtension(“CustomerNumberHere”);
$originateMsg->setCallerId(“DAHDI/g0/CustomerNumberHere”);

This doesn’t make sense.

You can place the further customer number in place so when the operator on extension picks up, it auto connects the operator to the number then.

But you are not putting just the customer number there.

Well i just checked the log file, FOP2 was working fine in the same condition, so i checked how they fwd call i found DAHDI/g0/NUMBERHERE, it made it worked.