<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">To Mark Sayer:</div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">My setup is</div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
I. For the direction from Opensips to Asterisk</div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
1. Asterisk: Creat a sip trunk to Opensips server</div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><div>type=friend</div><div>insecure=very</div><div>host=10.2.14.122</div><div>
context=from-internal</div><div>allow=all</div><div>qualify=yes</div><div>fromdomain=10.2.14.122</div><div>username=1000</div><div>fromuser=1000</div><div>secret=1000</div></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
<br></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">(1000/1000 is one of the extension defined in Opensips server)</div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
<br></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">2. Opensips: </div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">- Insert ip of asterisk server to "address" table of "opensips" database</div>
<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">- Add following lines in "opensips.conf"</div><div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> #route to PSTN</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> if ($rU=~"^9") </span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> {</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> <span class="Apple-tab-span" style="white-space:pre">                </span>route(4);</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> <span class="Apple-tab-span" style="white-space:pre">                </span>exit;</span></font></div><div>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"> <span class="Apple-tab-span" style="white-space: pre; ">        </span>}</span></font></div></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
#forward call to asterisk server (gateway) <br><div> route[4]</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>{</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>rewritehostport( "<a href="http://192.168.19.6:5060">192.168.19.6:5060</a>"); </div>
<div><span class="Apple-tab-span" style="white-space:pre">        </span> route(1);</div><div><span class="Apple-tab-span" style="white-space:pre">        </span>}</div></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
- Configure 1001 extension into the group ld ("grp" table) </div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><span class="Apple-style-span" style="font-family: sans-serif; border-collapse: separate; "><table id="table_results" class="data">
<tbody><tr class="odd" style="background-image: initial; background-attachment: initial; background-origin: initial; background-clip: initial; background-color: rgb(204, 255, 204); text-align: left; color: rgb(0, 0, 0); background-position: initial initial; background-repeat: initial initial; ">
<td align="right" class=" nowrap" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; white-space: nowrap; ">
1</td><td class="" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; ">1001</td>
<td class="" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; ">10.2.14.122</td>
<td class="" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; ">ld</td><td class=" nowrap" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; white-space: nowrap; ">
2011-03-19 08:00:16</td><td align="right" class=" nowrap" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; white-space: nowrap; ">
0</td><td class="" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; "><i>NULL</i></td>
<td align="right" class=" nowrap" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; white-space: nowrap; ">
1</td><td align="right" class="" style="padding-top: 0.1em; padding-right: 0.5em; padding-bottom: 0.1em; padding-left: 0.5em; margin-top: 0.1em; margin-right: 0.1em; margin-bottom: 0.1em; margin-left: 0.1em; vertical-align: top; ">
<i>NULL</i></td></tr></tbody></table></span></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
3. Dial: 9. from Opensips (1001) to Ast ok</div><div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">May 5 15:39:48 opensips /usr/sbin/opensips[6300]: new branch at <a href="http://sip:901228259924@192.168.19.6:5060">sip:901228259924@192.168.19.6:5060</a></span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">May 5 15:39:48 opensips /usr/sbin/opensips[6303]: incoming reply</span></font></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
<br></div></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">II. For the direction from Asterisk to Opensips</div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">
<br></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">1. Asterisk </div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">- Add inbound route for the DID (11111111 as an example) in FreePBX web interface </div>
<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">- Route call to this dial plan</div><div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">[call_to_opensips]</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">exten => s,1,Dial(SIP/to-opensips/1001)</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">exten => s,n,Hangup</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">2. Opensips : Do nothing</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><br></span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">3. Result :</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">- Dial to the DID -> Asteriks gets the message as i've posted before. </span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><div> -- Executing [s@from-zaptel:13] Goto("Zap/2-1", "from-pstn|11111111|1") in new stack</div>
<div> -- Goto (from-pstn,11111111,1)</div><div> -- Executing [11111111@from-pstn:1] Set("Zap/2-1", "__FROM_DID=11111111") in new stack</div><div> -- Executing [11111111@from-pstn:2] Gosub("Zap/2-1", "app-blacklist-check|s|1") in new stack</div>
<div> -- Executing [s@app-blacklist-check:1] LookupBlacklist("Zap/2-1", "") in new stack</div><div> -- Executing [s@app-blacklist-check:2] GotoIf("Zap/2-1", "0?blacklisted") in new stack</div>
<div> -- Executing [s@app-blacklist-check:3] Set("Zap/2-1", "CALLED_BLACKLIST=1") in new stack</div><div> -- Executing [s@app-blacklist-check:4] Return("Zap/2-1", "") in new stack</div>
<div> -- Executing [11111111@from-pstn:3] ExecIf("Zap/2-1", "1 |Set|CALLERID(name)=462787800") in new stack</div><div> -- Zap/1-1 is ringing</div><div> -- Executing [11111111@from-pstn:4] Set("Zap/2-1", "__CALLINGPRES_SV=allowed_not_screened") in new stack</div>
<div> -- Executing [11111111@from-pstn:5] SetCallerPres("Zap/2-1", "allowed_not_screened") in new stack</div><div> -- Executing [11111111@from-pstn:6] Goto("Zap/2-1", "call_to_opensips|s|1") in new stack</div>
<div> -- Goto (call_to_opensips,s,1)</div><div> -- Executing [s@call_to_opensips:1] Dial("Zap/2-1", "SIP/to-opensips/1001") in new stack</div><div> <b> -- Called to-opensips/1001</b></div><div>
-- SIP/to-opensips-00000762 is circuit-busy</div><div> == Everyone is busy/congested at this time (1:0/1/0)</div><div> -- Executing [s@call_to_opensips:2] Hangup("Zap/2-1", "") in new stack</div>
<div> == Spawn extension (call_to_opensips, s, 2) exited non-zero on 'Zap/2-1'</div><div> -- Hungup 'Zap/2-1'</div><div> -- Channel 0/1, span 1 got hangup request, cause 21</div><div> -- Zap/1-1 is circuit-busy</div>
<div> -- Hungup 'Zap/1-1'</div><div> == Everyone is busy/congested at this time (1:0/1/0)</div><div> -- Executing [s@macro-dialout-trunk:20] NoOp("SIP/1002-00000761", "Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 21") in new stack</div>
<div> -- Executing [s@macro-dialout-trunk:21] Goto("SIP/1002-00000761", "s-CONGESTION|1") in new stack</div><div> -- Goto (macro-dialout-trunk,s-CONGESTION,1)</div><div> -- Executing [s-CONGESTION@macro-dialout-trunk:1] Set("SIP/1002-00000761", "RC=21") in new stack</div>
<div> -- Executing [s-CONGESTION@macro-dialout-trunk:2] Goto("SIP/1002-00000761", "21|1") in new stack</div><div> -- Goto (macro-dialout-trunk,21,1)</div><div> -- Executing [21@macro-dialout-trunk:1] Goto("SIP/1002-00000761", "continue|1") in new stack</div>
<div><br></div></span></font></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">- Opensips: Nothing happend</div></div><div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">May 5 18:20:31 opensips /usr/sbin/opensips[9290]: new branch at <a href="http://sip:1001@10.2.14.122:5060">sip:1001@10.2.14.122:5060</a></span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">May 5 18:20:31 opensips /usr/sbin/opensips[9296]: incoming reply</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">May 5 18:20:31 opensips /usr/sbin/opensips[9295]: incoming reply</span></font></div>
<div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; ">(debug level = 3) </div></div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></div><div>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">- [root@opensips log]# opensipsctl online</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">database engine 'MYSQL' loaded</span></font></div>
<div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Control engine 'FIFO' loaded</span></font></div><div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">1001</span></font></div>
<div><br></div><div><br></div><div><b>Additionally, i have another error with local calls : Proxy authentication required </b></div><div><b>(1001 calls 1002) although both of them are registered !!!!</b></div><div><b><br>
</b></div><div><b><br></b></div><div>Please help me to find out why! </div><div style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; "><br></div><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse; ">Date: Fri, 6 May 2011 14:06:38 +1000</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">From: Mark Sayer <</span></font><a href="mailto:datapipes@avtb.co.nz" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; color: rgb(0, 0, 204); ">datapipes@avtb.co.nz</a><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">></span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Subject: Re: [OpenSIPS-Users] Call from Asterisk to Opensips</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">To: OpenSIPS users mailling list <</span></font><a href="mailto:users@lists.opensips.org" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; color: rgb(0, 0, 204); ">users@lists.opensips.org</a><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">></span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Message-ID: <</span></font><a href="mailto:BANLkTikSihpQwSPQ1gVQM4b2522z6oHePg@mail.gmail.com" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; color: rgb(0, 0, 204); ">BANLkTikSihpQwSPQ1gVQM4b2522z6oHePg@mail.gmail.com</a><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">></span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Content-Type: text/plain; charset=ISO-8859-1</span></font><br><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">You have provided us with the error message from Asterisk but what</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">have you looked to see what OpenSIPS is doing? Is ext1001 currently</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">registered with OpenSIPS? There are a number of ways that Asterisk and</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">OpenSIPS might be configured to operate together. You will have to</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">give us more information on your setup.</span></font><br>
<br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">Mark</span></font><br><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">On Fri, May 6, 2011 at 1:53 PM, Duong Manh Truong</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;"><</span></font><a href="mailto:ngoahotanglongbk@gmail.com" style="border-collapse: collapse; font-family: arial, sans-serif; font-size: 13px; color: rgb(0, 0, 204); ">ngoahotanglongbk@gmail.com</a><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> wrote:</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Hi all,</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> I've created sip trunk on Asterisk and defined asterisk server ip on address</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> table of opensips</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Then, from extension of Opensips , i can dial out to pstn through Asterisk</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Now, i want to route PSTN call to the extension</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> but when Asterisk receive the call from PSTN and dial Opensips through the</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Sip Trunk</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> i always got the message in the asterisk's console:</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> ?Called to-opensips/1001</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> ? ? -- SIP/to-opensips-00000745 is circuit-busy</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> ? == Everyone is busy/congested at this time (1:0/1/0)</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> (1001 is the extension of Opensips)</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Then the call hangs up.</span></font><br><font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Anyone got this problem ? please help me the way to deal with!</span></font><br>
<font class="Apple-style-span" face="arial, sans-serif"><span class="Apple-style-span" style="border-collapse: collapse;">> Thanks so much!</span></font>