Simultaneous call problems

I have test code that places two SIP calls to the same number simultaneously. I expect one call to complete to the destination number and the other to complete to a vm system. Sometimes this works, but usually it doesn’t. The most common failure is that one of the calls returns a “channel is not available”. In addition, if channel “A” is not available and I perform a channel.hangup() on “B”, I receive all the events to indicate the “B” call is hungup, but in fact it completes to the destination number.

Any ideas where I should start?


Carl

Post a the relevant parts of your extensions.conf file. Need that to attempt to figure out what is going on.

Dan

As near as I can tell, the extensions conf is not executed at all. Perhaps this is a clue. The log shows

== Manager ‘admin’ logged off from 70.239.xxx.xxx
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 70.239.xxx.xxx
> Channel SIP/xxxxxxx2-09c3d558 was never answered.
– Got SIP response 400 “Bad Request” back from 204.9.xxx.xxx

If I place only one call, the log extensions are executed…

== Manager ‘admin’ logged off from 70.239.xxx.xxx
== Parsing ‘/etc/asterisk/manager.conf’: Found
== Parsing ‘/etc/asterisk/manager_custom.conf’: Found
== Manager ‘admin’ logged on from 70.239.xxx.xxx
> Channel SIP/xxxxxx-09c353f8 was answered.
– Executing Answer(“SIP/xxxxx-09c353f8”, “”) in new stack
– Executing Monitor(“SIP/xxxxx-09c353f8”, “wav|recording_vzw|m”) in new stack
– Executing Wait(“SIP/xxxxx-09c353f8”, “0.5”) in new stack

and so forth

This can be duplicated in the following way…

connect to the server and place the call

catch the onDialing event and hangup the channel

onDialing(AsteriskChannel channel) { channel.hangup();

Sometimes (not always) the call goes through to the destination, but the extension conf is not executed.

You’ve got a lot going on here. Lets try to simplify some things and see if we can isolate the problem.

1.) Can you call each extension / number through your asterisk box without going through the manager interface?

2.) When going through the manager interface, Can you call each extension individually? i.e can you call extension 1 connect and hangup, then call extension 2 connect and hangup.

3.) What language / library are you programming with?

FYI

When you make a call out through the AMI, there are two legs of the call. The first leg is the phone number entered. The second is either the application & data or the extension, context, priority to connect to. When the first leg of the call answers, it is immediately transfered to the second leg of the call. 99% of the time this will be an extension, context, priority in your dial plan because you can’t do anything really complex with only one dial plan application. So it is highly probable that you are executing some part of your dial plan. I would recommend posting this part of your dial plan so we can rule out any possible problems there.

Dan

Thanks for your help!

1.) Can you call each extension / number through your asterisk box without going through the manager interface?

I don’t know how to do this without the manager interface. I’ll have to learn something, then try.

2.) When going through the manager interface, Can you call each extension individually? i.e can you call extension 1 connect and hangup, then call extension 2 connect and hangup.

Yes, this seems to work fine.

3.) What language / library are you programming with?

Java / asterisk-java-0.3-m1

Following up on your ‘two legs’ explanation, is it correct that the java version of manager interface indicates the “answer” or “the end of the first leg” by property change event to “UP” or by calling the OrginateCallback’s “onSuccess” method? I’m trying to hangup BEFORE either of these occur, so it makes sense that the second leg isn’t executed. It would seem that hanging up in the first leg prevents execution of the second leg, but doesn’t stop the call from going through.