Question: I need to make pattern for asterisk sip calling like this way.

1. Pattern consist only "\*","#" and 0-9 digits
2. pattern's first arguments is optional for "+" symbols.

like it matches

```
*1203#023212232
+*1203#122
12345555

```

but reject these cases

```
3434+23443
*2334%2323

```

I prepared pattern like this way

```
exten => _[*|#|+|0-9].,1,Answer()

```

but this is also accept following pattern too which I do not want to match.

```
*2334%2323

```

Answer: 
I use Rajawali which is an overlay for OpenGL.

<http://www.rozengain.com/blog/2011/08/23/announcing-rajawali-an-opengl-es-2-0-based-3d-framework-for-android/>

I would strongly recommend you use it too as it takes a lot of the pain of OpenGL away. Anyway, what I've put below does involve some Rajawali code but the principles should be similar and you should be able to pick out what you need. If you have a look here to see the results of my work:

<http://www.youtube.com/watch?v=yEioXZT-lv0>

to do this I create the camera view programatically rather than in the layout xml. I had to play about a bit but the following worked for me - this goes in your onCreate method of your Activity:

```
mOpenCvCameraView = (CameraBridgeViewBase) new JavaCameraView(this, -1);
    mOpenCvCameraView.setCvCameraViewListener(this);

    mLayout.addView(mOpenCvCameraView);

    mSurfaceView.setZOrderMediaOverlay(true);
    setGLBackgroundTransparent(true);
    mRenderer = new OpenGLRenderer(this);
    mRenderer.setSurfaceView(mSurfaceView);
    super.setRenderer(mRenderer);

mRenderer.setCameraPosition(0, 0, 20);

```

OpenGLRenderer here extends RajawaliRenderer, which in turn extends GLSurfaceView.Renderer. Probably best to look at the source code for the latter two rather than reproduce here. In my OpenGLRenderer I set up the objects, camera etc. in the initScene() method. I also added a number of methods that can be called from the Activity to control the object movement etc.

My activity extends the RajawaliActivity with the key elements of that class laid out below:

```
public class RajawaliActivity extends Activity {
protected GLSurfaceView mSurfaceView;
protected FrameLayout mLayout;
protected boolean mUsesCoverageAa;
private RajawaliRenderer mRajRenderer;
protected boolean checkOpenGLVersion = true;
protected boolean mDeferGLSurfaceViewCreation = false;

@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    if(!mDeferGLSurfaceViewCreation)
        createSurfaceView();
}

protected void createSurfaceView()
{
    mSurfaceView = new GLSurfaceView(this);

    ActivityManager am = (ActivityManager)getSystemService(Context.ACTIVITY_SERVICE);

    mSurfaceView.setEGLContextClientVersion(2);

    mLayout = new FrameLayout(this);
    mLayout.addView(mSurfaceView);

    setContentView(mLayout);
}

```

I hope this helps - good luck!
You can do it like this in your `onCreate()` method. Remember to `setFormat(PixelFormat.TRANSLUCENT)` in MyGLSurfaceView constructor:

```
    mGLView = new MyGLSurfaceView(this);
    setContentView(mGLView);

    mOpenCvCameraView = (CameraBridgeViewBase) new JavaCameraView(this, -1);
    mOpenCvCameraView.setCvCameraViewListener(this);
    addContentView(mOpenCvCameraView, new LayoutParams(
            LayoutParams.WRAP_CONTENT, LayoutParams.WRAP_CONTENT));

```