2

Hy all, I am a newbie in asterisk so don't know much about it. I am currently tangled in an application which makes an outbound call. Previously it wasn't working due to some provisioning issues and then ANI was showing NULL value. But now it's working fine because I used setCallerID function of java.

The problem is that an outbound call is generated successfully to the users for a number say 123, but a leading zero '0' is attached to it and becomes '0123', I am assuming that '0' is for national number which asterisk attached as per defined in asterisk, and my required number is '123', which I want to change from the java code.

I searched a lot of forums/sites including the leading site of voip-info but didn't get success yet. I want to resolve it through java code if possible. Any help would be greatly appreciated.

Update:

Note:

asterisk version is 1.8 , chain ss7 is 2.1

extensions.conf

[gu]
exten =>007775,1,Answer(); this will answer the call
exten =>007775,2,Wait(1); will wait for 1 second
exten =>007775,3,NoOp(Call from ${CALLERID(all)})
exten =>007775,4,AGI(agi://localhost:4573/com.digitania.ivr.gu.domain.ServiceImplDelegate?uniqueId=${UNIQUEID}&isOutbound=${isOutbound}&msisdn=${MSISDN})
exten =>007775,5,Hangup(); end the call

My java code

private static final String PARAM_MSISDN = "MSISDN";
private static final String PARAM_ISOUTBOUND = "isOutbound";
private static final String EXTENSION = "007775";
private static final String CALLER_ID = "7775";
public static int callCount = 0;
public void call(String msisdn, CallListener listener) {
    try {
        
        {
            
            OriginateAction originateAction = new OriginateAction();
            
            originateAction.setChannel((new StringBuilder("SS7/").append(msisdn).toString())); 

            originateAction.setContext("gu");
            originateAction.setPriority(new Integer(1));
            originateAction.setExten(EXTENSION);
            originateAction.setCallerId(CALLER_ID);
            originateAction.setVariable(PARAM_MSISDN, msisdn);
            originateAction.setVariable(PARAM_ISOUTBOUND, "true");
            ManagerResponse originateResponse = managerConnection
                    .sendAction(originateAction, 30000L);
            System.out.println((new StringBuilder("RESPONSE: \n")).append(
                    originateResponse.getResponse()).toString());
            System.out.println(originateResponse.getMessage());

        }
    } catch (TimeoutException e) {
        listener.callTimeOutException();
    } catch (Exception e) {
        e.printStackTrace();
    }
    callCount++;
}
Community
  • 1
  • 1
IConfused
  • 714
  • 2
  • 8
  • 20
  • 1
    Please put here your dialplan, dialling code and framework used. I am afraid no way help you based on your current description. – arheops Apr 23 '13 at 09:27

1 Answers1

0

It's been a while for me using libss7, but have you tried looking at these options in chan_dahdi.conf?

  • ss7_called_nai
  • ss7_calling_nai
  • ss7_internationalprefix
  • ss7_nationalprefix
  • ss7_subscriberprefix
  • ss7_unknownprefix
  • networkindicator

Playing a bit with them (and also talking to your provider) should allow you to send the correct numbers.

Hope it helps.

marcelog
  • 7,062
  • 1
  • 33
  • 46