<div style="font-family:Arial;font-size:14px"><p>On Sun, 22 Nov 2009 15:38:00 +0100, Leif Neland &lt;leifn@neland.dk&gt; wrote:</p>
<blockquote style="border-left: 2px solid #1010ff; padding-left: 5px; margin-left: 5px; width: 100%;">Magnus Benng&aring;rd skrev:
<blockquote cite="mid:e0eb5a7a527b1e1029991a2672e388f4@inputinterior.se">
<div style="font-family: Arial; font-size: 14px;">
<div style="font-family: Arial; font-size: 14px;">Hi!<br /> <br /> Part of extensions.conf:<br /> <br /> exten =&gt; 985,1,Dial(SIP/0317998985&amp;H323/00702221448@Avaya,20)<br /> exten =&gt; 985,2,Goto(985-${DIALSTATUS},1)<br /> exten =&gt; 985-BUSY,1,VoiceMail(<a class="moz-txt-link-abbreviated" href="mailto:0317998985@inputinterior.se,b">0317998985@inputinterior.se,b</a>)<br /> exten =&gt; 985-BUSY,2,PlayBack(vm-goodbye)<br /> exten =&gt; 985-BUSY,3,HangUp()<br /> exten =&gt; 985-NOANSWER,1,VoiceMail(<a class="moz-txt-link-abbreviated" href="mailto:0317998985@inputinterior.se,u">0317998985@inputinterior.se,u</a>)<br /> exten =&gt; 985-NOANSWER,2,PlayBack(vm-goodbye)<br /> exten =&gt; 985-NOANSWER,3,HangUp()<br /> <br /> 0317998985 is a direct connected SIP phone<br /> 0702221448 is a celluar phone.<br /> <br /> When dialing 985 both phones rings, perfect<br /> If none answer within 20 seconds, VoiceMail(<a class="moz-txt-link-abbreviated" href="mailto:0317998985@inputinterior.se,u">0317998985@inputinterior.se,u</a>), perfect<br /> <br /> But my problem comes when I speak on 0317998985 and someone calls on 985, the call<br /> get to my celluar phone and ofc the other way around.<br /> <br /> Is there a way to check if any extension is busy and in that case jump to VoiceMail(<a class="moz-txt-link-abbreviated" href="mailto:0317998985@inputinterior.se,b">0317998985@inputinterior.se,b</a>)?</div>
</div>
</blockquote>
<br /> If both phones were directly connected sip, it could be done.<br /> The problem is that you can't determine if the cellular is busy before you call it.<br /> <br /> If the cell was only called via asterisk, you could set a flag, when asterisk called extension 985, and clear it, when hanging up, but I guess the phone is used for call out via regular cell service, and also called directly on its own number.<br /> <br /> <br /> You don't own the cell-company, and can setup an API to get the status of the cell, right? I didn't think so :-)<br /> <br />No i dont own the cell-company but they route the cell-call to my main Avaya pbx and the Avaya route it back (with a new b-number) so I have pretty much control over the cell-call.<br />Just have to route it to my Asterisk and set the flag there, will do some reading and figure out how.<br /><br /> You could do this:<br /> check if sip is busy, using ChanIsAvail<br /><br />I am running Asterisk SVN-branch-1.6.2-r230384 so I thougt i can do something like:<br />(For checking if I am talking on the SIP phone)<br /><br />exten =&gt; 985,1,GotoIf($["${DEVICE_STATE(SIP/0317998985)}"="BUSY"]?11)<br />exten =&gt; 985,2,Dial(SIP/0317998985&amp;H323/00702221448@Avaya,20)<br />exten =&gt; 985,3,Goto(985-${DIALSTATUS},21)<br />exten =&gt; 985,4,HangUp()<br />exten =&gt; 985-BUSY,11,VoiceMail(0317998985@inputinterior.se,b)<br />exten =&gt; 985-BUSY,12,PlayBack(vm-goodbye)<br />exten =&gt; 985-BUSY,13,HangUp()<br />exten =&gt; 985-NOANSWER,21,VoiceMail(0317998985@inputinterior.se,u)<br />exten =&gt; 985-NOANSWER,22,PlayBack(vm-goodbye)<br />exten =&gt; 985-NOANSWER,23,HangUp()<br /> <br />But there is something wrong with the first line, tried "INUSE" aswell.<br />When I place a call from 0317998985 and some1 call 985, the call goes to the cell phone. :(<br />Can any1 se what I am doing wrong?<br /><br /> If so, go to voicemail.<br /> Else, dial cell, timeout 20 sec<br /> if busy go to voicemail<br /> else dial sip, timeout 20 sec<br /> if not answered. go to voicemail.<br /> <br /> But this will give 20 seconds delay before sip rings, and 40 seconds timeout for the caller before voicemail.<br /> <br /> The other option is to modify the source, and add an option to the dial-command, to exit if any extension dialled is busy.<br /> After all, this is open source :-)<br /> <br /> Leif<br /> <br /> <br /> <br /> <br /></blockquote>
<p>&nbsp;</p></div>