AnsweredAssumed Answered

Asterisk-IM with a2billing (account code auth)

Question asked by pczolee on Sep 6, 2012

Dear Experts.

 

I'm using Openfire (witch is great, thanks) 3.7.1, with Asterisk-IM 1.4.0. Everything is working well! But I need one more feature. Because I'm using a2billing for account tracking, I need to add an account number for each sip client to call outside, if I don't set it, than the system asking it, everytime when I make a call.

With callback I need to send an "Account" variable to the asterisk manager with this number. What I need is, I want to set this account number for each clients, for example in Phone Mappings should be a new box where I can set this number. In php it looks like this:

 

    fputs($oSocket, "Action: login\r\n");

    fputs($oSocket, "Events: off\r\n");

    fputs($oSocket, "Username: $strUser\r\n");

    fputs($oSocket, "Secret: $strSecret\r\n\r\n");

    fputs($oSocket, "Action: originate\r\n");

    fputs($oSocket, "Channel: $strChannel\r\n");

    fputs($oSocket, "WaitTime: $strWaitTime\r\n");

    fputs($oSocket, "CallerId: $strCallerId\r\n");

    fputs($oSocket, "Account: $strAccode\r\n");

    fputs($oSocket, "Exten: $number\r\n");

    fputs($oSocket, "Context: $strContext\r\n");

    fputs($oSocket, "Priority: $strPriority\r\n\r\n");

    fputs($oSocket, "Action: Logoff\r\n\r\n");

 

Here the $strAccode variable contains the account code. Of course each account have their own accountcode.

 

How can I do this?

 

Thanks for helping.

 

I wish all the best.

 

Robert

Outcomes