linphone-developers
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Linphone-developers] Using SIPAddHeader to force Auto-answer


From: Matt Murphy
Subject: Re: [Linphone-developers] Using SIPAddHeader to force Auto-answer
Date: Wed, 13 May 2015 17:18:32 +0000 (UTC)

I discovered that I was doing something boneheaded. I have been using PJSIP on my Asterisk server, so the SIPAddHeader() entry I made in extensions.conf wasn't valid. I attempted to use exten => n,1,Set(PJSIP_HEADER(add,Call-Info)=answer-after=0) and that did not work either. So, I decided to abandon PJSIP and go back to SIP as a test (using the aforementioned SIPAddHeader() strategy). Now, sal_call_autoanswer_asked() is aware of the auto-answer request and I can move forward.

So, as an embarrassing follow-up question: was I wasting my time attempting this with PJSIP? I had calls working fine when using PJSIP, so I guess I just assumed all was right with the universe and I could use the PJSIP_HEADER to do what I needed. Perhaps I used it wrong, or maybe there is basic support for PJSIP, but adding the header isn't supported? I'm still very new to a lot of this, so I am learning how all of these pieces fit together. Every day is a journey!

If I discover anything else, I will share.

Thanks,

--Matt
 



On Tuesday, May 12, 2015 1:59 PM, Matt Murphy <address@hidden> wrote:


Hi Guillaume,

I think I have an idea of how to do this. What you recommended makes a lot of sense. My only issue now is that linphone_call_asked_to_autoanswer() always returns 0. More specifically, sal_call_autoanswer_asked() always returns 0. I am not sure if I have the correct format of SIPAddHeader in my Asterisk extensions.conf file. I have tried:

same => n,SIPAddHeader(Call-Info: answer-after=0)
and
same => n,SIPAddHeader(Call-Info:answer-after=0)

It appears that Asterisk is happy with what I am doing because I see:
 -- Executing address@hidden:2] SIPAddHeader("PJSIP/6001-00000000", "Call-Info: answer-after=0") in new stack

But nevertheless, I still see 0 returned for linphone_call_asked_to_autoanswer()and sal_call_autoanswer_asked().

I'll keep fighting the good fight. I might just be doing something boneheaded.

Thanks for all your help. I really do appreciate it.

--Matt
 



On Monday, May 11, 2015 6:04 AM, Guillaume Bienkowski <address@hidden> wrote:


Hi Matthew,

Indeed, this function will tell you if the user asked for an auto answer, which is exactly what you put in your header.


On the other hand, linphone does not answer automatically when this flag is set as of today. We could implement it with a configuration option in the linphonerc file at some point but it is not yet the case.

You could do it yourself if you use the Linphone library in your project: on the call_state_changed callback with state LinphoneCallIncomingReceived , you call this linphone_call_asked_to_autoanswer() and if it returs TRUE, you answer the call.

Guillaume Bienkowski



Le 7 mai 2015 à 18:16, Matt Murphy <address@hidden> a écrit :

As an addendum to my previous post, I found a function linphone_call_asked_to_autoanswer() function in coreapi/linphonecore.c. However, I cannot find any evidence that this function is ever called. I feel like this is on the correct path, but I am unsure of how (or where) to utilize it in order to enable auto-answer upon receiving an instruction in the SIP Header.

Has anyone had any experience with this?

Thanks,

--Matt




On Thursday, May 7, 2015 9:24 AM, Matt Murphy <address@hidden> wrote:


Greetings everyone,

I am attempting to page my linphone appliance (connected to an Asterisk server) by dialing a special extension. The trouble is that when I use the Asterisk Page() command, my linphone appliance rings. I would like linphone to auto-answer the page. I searched around and found some information on this from back in 2010:


This appears to be exactly what I am looking for - in essence, a way to inject the auto-answer behaviour into the SIP header. 

I tried adding the following to my Asterisk extensions.conf file:

exten => 333,1,Verbose(Paging)
same => n,SIPAddHeader(Call-Info: answer-after=0)
same => n,Set(PageExts=PJSIP/6003&PJSIP/6010)
same => n,Page(${PageExts},i,120)

I guess my question is two-fold:
1) Is this behaviour supported by linphone?
2) Am I correctly invoking the auto-answer by what I have above?

Thank you for all your help,

--Matt


_______________________________________________
Linphone-developers mailing list
address@hidden
https://lists.nongnu.org/mailman/listinfo/linphone-developers






reply via email to

[Prev in Thread] Current Thread [Next in Thread]