Call from Asterisk to Opensips

classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

Call from Asterisk to Opensips

Duong Manh Truong
Hi all, 
I've created sip trunk on Asterisk and defined asterisk server ip on address table of opensips

Then, from extension of Opensips , i can dial out to pstn through Asterisk

Now, i want to route PSTN call to the extension 
but when Asterisk receive the call from PSTN and dial Opensips through the Sip Trunk
i always got the message in the asterisk's console: 
 Called to-opensips/1001
    -- SIP/to-opensips-00000745 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)

(1001 is the extension of Opensips) 
Then the call hangs up. 

Anyone got this problem ? please help me the way to deal with!

Thanks so much! 

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call from Asterisk to Opensips

Mark Sayer
You have provided us with the error message from Asterisk but what
have you looked to see what OpenSIPS is doing? Is ext1001 currently
registered with OpenSIPS? There are a number of ways that Asterisk and
OpenSIPS might be configured to operate together. You will have to
give us more information on your setup.

Mark

On Fri, May 6, 2011 at 1:53 PM, Duong Manh Truong
<[hidden email]> wrote:

> Hi all,
> I've created sip trunk on Asterisk and defined asterisk server ip on address
> table of opensips
> Then, from extension of Opensips , i can dial out to pstn through Asterisk
> Now, i want to route PSTN call to the extension
> but when Asterisk receive the call from PSTN and dial Opensips through the
> Sip Trunk
> i always got the message in the asterisk's console:
>  Called to-opensips/1001
>     -- SIP/to-opensips-00000745 is circuit-busy
>   == Everyone is busy/congested at this time (1:0/1/0)
> (1001 is the extension of Opensips)
> Then the call hangs up.
> Anyone got this problem ? please help me the way to deal with!
> Thanks so much!
> _______________________________________________
> Users mailing list
> [hidden email]
> http://lists.opensips.org/cgi-bin/mailman/listinfo/users
>
>

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call from Asterisk to Opensips

Max Mühlbronner
In reply to this post by Duong Manh Truong
Hi,

i would suggest doing sip-traces on asterisk (sip debug) and opensips (ngrep) while watching the corresponding log messages of both servers (asterisk/opensips). Most of the time it´s difficult to find a problem by looking at it from just one side.

BR

Max M.

Am 06.05.2011 05:53, schrieb Duong Manh Truong:
Hi all, 
I've created sip trunk on Asterisk and defined asterisk server ip on address table of opensips

Then, from extension of Opensips , i can dial out to pstn through Asterisk

Now, i want to route PSTN call to the extension 
but when Asterisk receive the call from PSTN and dial Opensips through the Sip Trunk
i always got the message in the asterisk's console: 
 Called to-opensips/1001
    -- SIP/to-opensips-00000745 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)

(1001 is the extension of Opensips) 
Then the call hangs up. 

Anyone got this problem ? please help me the way to deal with!

Thanks so much! 
_______________________________________________ Users mailing list [hidden email] http://lists.opensips.org/cgi-bin/mailman/listinfo/users


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call from Asterisk to Opensips

Brett Nemeroff
In reply to this post by Duong Manh Truong
On Thu, May 5, 2011 at 10:53 PM, Duong Manh Truong <[hidden email]> wrote:
Hi all, 
I've created sip trunk on Asterisk and defined asterisk server ip on address table of opensips

Then, from extension of Opensips , i can dial out to pstn through Asterisk


Remember, just because you can dial out, doesn't mean that you are properly registered. Also, depending on your configuration, there are many ways you could be routing this call. I assume you are expecting the call to be routed to the registered device. Have you checked it's registration status with:
opensipsctl ul show

If it is registered, then the problem is in your configuration and we wouldn't really be able to help you out much without seeing what exactly you've got setup. 
-Brett


_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call from Asterisk to Opensips

ha do
In reply to this post by Duong Manh Truong
Hi Truong

first thing you should try to read the asterisk SIP TRUNK and here is the basic example and i think the problem is asterisk not opensips
http://www.panoramisk.com/90/sip-trunk-with-asterisk/en/

and make sure to check the debug from asterisk and opensips, i think you will get the clues :D


Ha`

--- On Thu, 5/5/11, Duong Manh Truong <[hidden email]> wrote:

From: Duong Manh Truong <[hidden email]>
Subject: [OpenSIPS-Users] Call from Asterisk to Opensips
To: "OpenSIPS users mailling list" <[hidden email]>
Date: Thursday, May 5, 2011, 9:53 PM

Hi all, 
I've created sip trunk on Asterisk and defined asterisk server ip on address table of opensips

Then, from extension of Opensips , i can dial out to pstn through Asterisk

Now, i want to route PSTN call to the extension 
but when Asterisk receive the call from PSTN and dial Opensips through the Sip Trunk
i always got the message in the asterisk's console: 
 Called to-opensips/1001
    -- SIP/to-opensips-00000745 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)

(1001 is the extension of Opensips) 
Then the call hangs up. 

Anyone got this problem ? please help me the way to deal with!

Thanks so much! 

-----Inline Attachment Follows-----

_______________________________________________
Users mailing list
Users@...
http://lists.opensips.org/cgi-bin/mailman/listinfo/users

_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users
Reply | Threaded
Open this post in threaded view
|

Re: Call from Asterisk to Opensips

Duong Manh Truong
In reply to this post by Duong Manh Truong
To Mark Sayer:
My setup is
I. For the direction from Opensips to Asterisk

1. Asterisk: Creat a sip trunk to Opensips server
type=friend
insecure=very
host=10.2.14.122
context=from-internal
allow=all
qualify=yes
fromdomain=10.2.14.122
username=1000
fromuser=1000
secret=1000

(1000/1000 is one of the extension defined in Opensips server)

2. Opensips: 
- Insert ip of asterisk server to "address" table of "opensips" database
- Add following lines in "opensips.conf"
 #route to PSTN
       if ($rU=~"^9") 
        {
      route(4);
      exit;
  }
 #forward call to asterisk server (gateway) 
    route[4]
{
rewritehostport( "192.168.19.6:5060");  
    route(1);
}
- Configure 1001 extension into the group ld ("grp" table) 
11001 10.2.14.122 ld 2011-03-19 08:00:16 0NULL 1 NULL

3. Dial: 9. from Opensips  (1001) to Ast ok
May  5 15:39:48 opensips /usr/sbin/opensips[6300]: new branch at sip:901228259924@192.168.19.6:5060
May  5 15:39:48 opensips /usr/sbin/opensips[6303]: incoming reply

II. For the direction from Asterisk to Opensips

1. Asterisk 
- Add inbound route for the DID (11111111 as an example) in FreePBX web interface 
- Route call to this dial plan
[call_to_opensips]
exten => s,1,Dial(SIP/to-opensips/1001)
exten => s,n,Hangup

2. Opensips : Do nothing

3. Result :
- Dial to the DID -> Asteriks gets the message as i've  posted before. 
    -- Executing [s@from-zaptel:13] Goto("Zap/2-1", "from-pstn|11111111|1") in new stack
    -- Goto (from-pstn,11111111,1)
    -- Executing [11111111@from-pstn:1] Set("Zap/2-1", "__FROM_DID=11111111") in new stack
    -- Executing [11111111@from-pstn:2] Gosub("Zap/2-1", "app-blacklist-check|s|1") in new stack
    -- Executing [s@app-blacklist-check:1] LookupBlacklist("Zap/2-1", "") in new stack
    -- Executing [s@app-blacklist-check:2] GotoIf("Zap/2-1", "0?blacklisted") in new stack
    -- Executing [s@app-blacklist-check:3] Set("Zap/2-1", "CALLED_BLACKLIST=1") in new stack
    -- Executing [s@app-blacklist-check:4] Return("Zap/2-1", "") in new stack
    -- Executing [11111111@from-pstn:3] ExecIf("Zap/2-1", "1 |Set|CALLERID(name)=462787800") in new stack
    -- Zap/1-1 is ringing
    -- Executing [11111111@from-pstn:4] Set("Zap/2-1", "__CALLINGPRES_SV=allowed_not_screened") in new stack
    -- Executing [11111111@from-pstn:5] SetCallerPres("Zap/2-1", "allowed_not_screened") in new stack
    -- Executing [11111111@from-pstn:6] Goto("Zap/2-1", "call_to_opensips|s|1") in new stack
    -- Goto (call_to_opensips,s,1)
    -- Executing [s@call_to_opensips:1] Dial("Zap/2-1", "SIP/to-opensips/1001") in new stack
    -- Called to-opensips/1001
    -- SIP/to-opensips-00000762 is circuit-busy
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [s@call_to_opensips:2] Hangup("Zap/2-1", "") in new stack
  == Spawn extension (call_to_opensips, s, 2) exited non-zero on 'Zap/2-1'
    -- Hungup 'Zap/2-1'
    -- Channel 0/1, span 1 got hangup request, cause 21
    -- Zap/1-1 is circuit-busy
    -- Hungup 'Zap/1-1'
  == Everyone is busy/congested at this time (1:0/1/0)
    -- Executing [s@macro-dialout-trunk:20] NoOp("SIP/1002-00000761", "Dial failed for some reason with DIALSTATUS = CONGESTION and HANGUPCAUSE = 21") in new stack
    -- Executing [s@macro-dialout-trunk:21] Goto("SIP/1002-00000761", "s-CONGESTION|1") in new stack
    -- Goto (macro-dialout-trunk,s-CONGESTION,1)
    -- Executing [s-CONGESTION@macro-dialout-trunk:1] Set("SIP/1002-00000761", "RC=21") in new stack
    -- Executing [s-CONGESTION@macro-dialout-trunk:2] Goto("SIP/1002-00000761", "21|1") in new stack
    -- Goto (macro-dialout-trunk,21,1)
    -- Executing [21@macro-dialout-trunk:1] Goto("SIP/1002-00000761", "continue|1") in new stack

- Opensips: Nothing happend
May  5 18:20:31 opensips /usr/sbin/opensips[9290]: new branch at sip:1001@10.2.14.122:5060
May  5 18:20:31 opensips /usr/sbin/opensips[9296]: incoming reply
May  5 18:20:31 opensips /usr/sbin/opensips[9295]: incoming reply
(debug level = 3) 

- [root@opensips log]# opensipsctl online
database engine 'MYSQL' loaded
Control engine 'FIFO' loaded
1001


Additionally, i have another error with local calls : Proxy authentication required 
(1001 calls 1002) although both of them are registered !!!!


Please help me to find out why! 

Date: Fri, 6 May 2011 14:06:38 +1000
From: Mark Sayer <[hidden email]>
Subject: Re: [OpenSIPS-Users] Call from Asterisk to Opensips
To: OpenSIPS users mailling list <[hidden email]>
Message-ID: <[hidden email]>
Content-Type: text/plain; charset=ISO-8859-1

You have provided us with the error message from Asterisk but what
have you looked to see what OpenSIPS is doing? Is ext1001 currently
registered with OpenSIPS? There are a number of ways that Asterisk and
OpenSIPS might be configured to operate together. You will have to
give us more information on your setup.

Mark

On Fri, May 6, 2011 at 1:53 PM, Duong Manh Truong
<[hidden email]> wrote:
> Hi all,
> I've created sip trunk on Asterisk and defined asterisk server ip on address
> table of opensips
> Then, from extension of Opensips , i can dial out to pstn through Asterisk
> Now, i want to route PSTN call to the extension
> but when Asterisk receive the call from PSTN and dial Opensips through the
> Sip Trunk
> i always got the message in the asterisk's console:
> ?Called to-opensips/1001
> ? ? -- SIP/to-opensips-00000745 is circuit-busy
> ? == Everyone is busy/congested at this time (1:0/1/0)
> (1001 is the extension of Opensips)
> Then the call hangs up.
> Anyone got this problem ? please help me the way to deal with!
> Thanks so much!
_______________________________________________
Users mailing list
[hidden email]
http://lists.opensips.org/cgi-bin/mailman/listinfo/users