Click to call and auto answer

I made a program in which there is the function of click to call

the fact is that I do not like to pull up the phone when I click to call

so … I implemented in the “Call-Info software: answer-after = 0”

doing so when I call a number of the call without pulling up the phone …

up to here everything perfect … but …

if I call another extension with the click to call even also called extension picks up the phone and does not ring, the thing I do not like

there is a way to send in the header of sip auto answer to only one of the phones involved in the call?

Your questions are really light on details.

  • Did you write an AGI or ARI script, or are you using Call Files?
  • Is your “Call-Info” in your extension config, or in the in SIP headers, or where?

What you want to do sounds reasonably straightforward, there are just a few details missing (like what you are actually doing versus what you think you are doing).

I come to the point

here is a part of the code involved:

fputs($oSocket, “Action: login\r\n”);
fputs($oSocket, “Events: off\r\n”);
fputs($oSocket, “Username: $strUser\r\n”);
fputs($oSocket, “Secret: $strSecret\r\n\r\n”);
fputs($oSocket, “Action: originate\r\n”);
fputs($oSocket, “Channel: $strChannel\r\n”);
fputs($oSocket, “WaitTime: $strWaitTime\r\n”);
fputs($oSocket, “CallerId: $number\r\n”);
fputs($oSocket, “Exten: $number\r\n”);
fputs($oSocket, “Variable: _SIPADDHEADER55=Call-Info: answer-after=0\r\n”);
fputs($oSocket, “Context: $strContext\r\n”);
fputs($oSocket, “Priority: $strPriority\r\n\r\n”);
fputs($oSocket, “Action: Logoff\r\n\r\n”);

with this originates the call …

let us focus on this line:

fputs($oSocket, “Variable: _SIPADDHEADER55=Call-Info: answer-after=0\r\n”);

as you can see here I put in the header of the call the auto answer function

but I do not understand how to make it valid only to the extent that I will …

OK - you are using an AGI script.

Since you are setting a variable in the call file, I think it is getting declared for both SIP segments on the call, and therefore is going to force both phones to auto answer.

I’m not sure, but I think you either need to add the auto-answer arguments to the Originate command, or write a special context that sets the auto-answer on your phone (or, technically, the originator’s phone) but doesn’t do it on the outbound call.

I tried to find adequate arguments but do not seem to take me to the desired point
While the opportunity to write a special context had already touched me but I have not yet begun …

We still work on in the coming days

In the meantime if anyone has ideas are here!

Use Softphone Linphone with autoanswer enable =>