One way audio sometimes - Outbound Call - Via Trunk

I am currently having issues with the outbound calls on my system.

I have a number of Cisco 514G phones connected to Asterisk / FreePBX and am using DIDLogic for the outbound trunk. Internal calls appear to work absolutely fine.The PBX and Voip phones are all on the same internal subnet and there is no port forwarding going on with the router.

Outbound calls via the trunk result in the person receiving the call quite often cannot hear the dialer. Ringing back virtually straight away always resolves this issue.

I was using the following settings

host=sip.uk.didlogic.net
user=USER
username=USER
fromuser=USER
authname=USER
secret=SECRET
insecure=port,invite
type=friend
qualify=yes
disallow=all
allow=ulaw

On the basis of what I found in did logic setup guide

I have just modified these to

host=sip.uk.didlogic.net
user=USER
username=USER
fromuser=USER
authname=USER
secret=SECRET
insecure=port,invite
type=friend
qualify=yes
nat=yes

Any guidance in the right direction would be helpful, I do have other problems with this system such as delayed answers ( ie no ring ) and showing connected when nothing has happened but I suspect many of these are related to the same thing.

Boxrick,
I also have a system with 25x Cisco 514G phones connected to FreePBX on the same LAN and a few remote phones over OpenVPN with inbound and outbound calls over the internet using SIP trunk.

Do you have any port forwarding from the router to the freepbx server for the sip trunk?

You need to forward from Router to PBX

  • The SIP port (default is 5060, but usually recommended to ask the service provider to use a random port for added security, udp only)

  • RTP ports (default 10000 - 20000 udp only)

If you have the webmin module (not installed by default), it uses 10000 and can cause security vulnerability if u open that port, you change the rtp port range in freepbx to start at 10001 instead

Also, make sure your Public/external IP is set in FreePBX and you have defined your local networks

Thanks for the response, as I understand I only need to punch holes in my firewall for incoming as opposed to outgoing calls?

I will have a look through public and external ip settings though.

Can you share your settings for the Cisco phones?

Deffinitely,
I have spent several weeks perfecting these phone configurations for the Cisco SPA514G, and beefing the system up with every feature that was even remotely needed just for fun because the client is family business.

Several phones are also programmed with the Cisco SPA500S add-on module for additional buttons.

Here is a list of the features we’ve got

Features

  • Hunt Group to direct incoming calls to logged in Agents, line key on
    each phone to login/out

  • Night Mode with Auto Attendant Greeting, line key on each phone to
    activate/deactivate

  • Company Directory, Personal Directory application within phone, Press
    the dir softkey for Personal Directory, then press 3 for “Corp
    Directory” to view the Corporate Directory extensions.

  • Company Directory with dial by name (Option 2 on the Night Mode Auto
    Attendant)

  • Company Mailbox - (Option 0 on the Night Mode Auto Attendant, uses
    Front Desk mailbox), messages can be checked from the Front Desk
    phone Voicemail button or from any Customer Service phone by using
    the Company VM line key. The mailbox is shared, so that if one
    Customer Service rep deletes a voicemail, it is deleted on the others
    phones. Also, message waiting indication (red light and envelope)
    will appear on the Customer Service phones when a message is waiting
    in the Company Mailbox

  • Transfer, Blind Transfer - use phone softkeys

  • Hold - Press the Hand icon, Music on Hold plays

  • Ad-hoc Conference (Use the Conference softkey)

  • MeetMe Conference Bridge: Dial 199. To transfer an external caller to
    the bridge: While on the call, use the bxfer softkey then dial 199.
    Call back to 199 to join yourself to the conference as well.

  • Voicemail to Email - see cutsheet for more info

  • Visual Voicemail application, use the Voicemail line key on each
    phone

  • Wireless Phone Capability - with Cisco WBPN adapter

  • Softphone Capability as a cellphone app or PC app

  • Remote Office phones

  • Follow-Me: Rings a user’s office phone, home phone, and cell phone
    softphone app simultaneously

I was able to upgrade firmware and configure all 25 phones automatically, not using the web GUIs of the phones, by making one XML configuration template, then making individual XML configs for each phone, and having the phones download the firmware and config automatically with DHCP option 150.

I also created one template extension in freepbx, then exported the extension using the Bulk Extensions tool, and then used that spreadsheet to create all the other extensions with similar settings, and reimported back into freepbx.

Working Cisco SPA514G config without SPA500S add-on module:

<flat-profile>

  <XML_Directory_Service_Name ua="na">Corp Directory</XML_Directory_Service_Name>
  <XML_Directory_Service_URL ua="na">http&#58;&#47;&#47;10.1.1.10&#47;directory&#47;dir.xml</XML_Directory_Service_URL>



<Server_Type ua="na">Asterisk</Server_Type>
<!-- Line Key 2 -->

  <Extension_2_ ua="na">Disabled</Extension_2_> <!-- options: 1/2/3/4/5/6/7/8/9/10/11/12/Disabled -->
  <Short_Name_2_ ua="na">Voicemail</Short_Name_2_>
  <Share_Call_Appearance_2_ ua="na">private</Share_Call_Appearance_2_> <!-- options: private/shared -->
  <Extended_Function_2_ ua="na">fnc=xml;url=http://10.1.1.10/voicemail/voicemail.php?user=123</Extended_Function_2_>

 <!-- Line Key 3 -->

  <Extension_3_ ua="na">Disabled</Extension_3_> <!-- options: 1/2/3/4/5/6/7/8/9/10/11/12/Disabled -->
  <Short_Name_3_ ua="na">Hunt Group</Short_Name_3_>
  <Share_Call_Appearance_3_ ua="na">private</Share_Call_Appearance_3_> <!-- options: private/shared -->
  <Extended_Function_3_ ua="na">fnc=sd+blf;sub=*45123*[email protected]</Extended_Function_3_>

  <!-- Line Key 4 -->

  <Extension_4_ ua="na">Disabled</Extension_4_> <!-- options: 1/2/3/4/5/6/7/8/9/10/11/12/Disabled -->
  <Short_Name_4_ ua="na">Night Mode</Short_Name_4_>
  <Share_Call_Appearance_4_ ua="na">private</Share_Call_Appearance_4_> <!-- options: private/shared -->
  <Extended_Function_4_ ua="na">fnc=sd+blf;sub=*[email protected]</Extended_Function_4_>

  <RTP_Packet_Size ua="na">0.020</RTP_Packet_Size>

 <Programmable_Softkey_Enable ua="na">Yes</Programmable_Softkey_Enable>
  <Idle_Key_List ua="na">em_login|1;acd_login|1;acd_logout|1;astate|2;avail|3;unavail|3;redial|5;dir|6;cfwd|7;dnd|8;pickup|10;gpickup|11;unpark|12;guestIn|13;guestOut|13;em_logout</Idle_Key_List>
  <Missed_Call_Key_List ua="na">miss|4</Missed_Call_Key_List>
  <Off_Hook_Key_List ua="na">redial|1;dir|2;cfwd|3</Off_Hook_Key_List>
  <Dialing_Input_Key_List ua="na">dial|1;delchar|2;cancel|3;dir|4</Dialing_Input_Key_List>
  <Progressing_Key_List ua="na">endcall|4</Progressing_Key_List>
  <Connected_Key_List ua="na">xfer|1;bxfer|2;conf|3;endcall|4;toggle;confLx;xferLx;park;phold;flash;</Connected_Key_List>
  <Start-Xfer_Key_List ua="na">hold|1;endcall|2;xfer|4;toggle;</Start-Xfer_Key_List>
  <Start-Conf_Key_List ua="na">hold|1;endcall|2;conf|4;toggle;</Start-Conf_Key_List>
  <Conferencing_Key_List ua="na">hold|1;endcall|2;join|4</Conferencing_Key_List>
  <Releasing_Key_List ua="na">endcall|4;</Releasing_Key_List>
  <Hold_Key_List ua="na">resume|1;endcall|2;newcall|3;redial;dir;cfwd;dnd</Hold_Key_List>
  <Ringing_Key_List ua="na">answer|1;ignore|2;toggle|4</Ringing_Key_List>
  <Shared_Active_Key_List ua="na">newcall|1;barge|2;cfwd|3;dnd|4</Shared_Active_Key_List>
  <Shared_Held_Key_List ua="na">resume|1;barge|2;cfwd|3;dnd|4</Shared_Held_Key_List>
  <PSK_1 ua="na"></PSK_1>
  <PSK_2 ua="na"></PSK_2>
  <PSK_3 ua="na"></PSK_3>
  <PSK_4 ua="na"></PSK_4>
  <PSK_5 ua="na"></PSK_5>
  <PSK_6 ua="na"></PSK_6>
  <PSK_7 ua="na"></PSK_7>
  <PSK_8 ua="na"></PSK_8>
  <PSK_9 ua="na"></PSK_9>
  <PSK_10 ua="na"></PSK_10>
  <PSK_11 ua="na"></PSK_11>
  <PSK_12 ua="na"></PSK_12>
  <PSK_13 ua="na"></PSK_13>
  <PSK_14 ua="na"></PSK_14>
  <PSK_15 ua="na"></PSK_15>
  <PSK_16 ua="na"></PSK_16>

 
 <Line_Navigation ua="na">Per Call</Line_Navigation>
  <Admin_Passwd ua="na">Corproot-Secret</Admin_Passwd>
  <Signaling_Protocol ua="na">SIP</Signaling_Protocol>
  <Connection_Type ua="rw">Static IP</Connection_Type>
   
    <!-- System Configuration -->

  <Static_IP ua="rw">10.1.1.91</Static_IP>
   
    <!-- System Configuration -->

  <NetMask ua="rw">255.255.255.0</NetMask>
  <Gateway ua="rw">10.1.1.1</Gateway>
  <Primary_DNS ua="rw">10.1.1.1</Primary_DNS>
  <Secondary_DNS ua="rw">4.2.2.2</Secondary_DNS>
  <NTP_Enable ua="na">Yes</NTP_Enable>
  <Primary_NTP_Server ua="na">us.pool.ntp.org</Primary_NTP_Server>
  <Secondary_NTP_Server ua="na">pool.ntp.org</Secondary_NTP_Server>
  <Provision_Enable ua="na">Yes</Provision_Enable>
  <Resync_Periodic ua="na">3600</Resync_Periodic>
  <Transport_Protocol ua="na">tftp</Transport_Protocol>
  <Upgrade_Enable ua="na">Yes</Upgrade_Enable>
  <Upgrade_Rule ua="na">( $SWVER ne 7.5.6 )? tftp://10.1.1.10/sw/spa51x-7-5-6.bin</Upgrade_Rule>
  <Line_Enable_1_ ua="na">Yes</Line_Enable_1_>
  <Proxy_1_ ua="na">10.1.1.10</Proxy_1_>
  <Register_1_ ua="na">Yes</Register_1_>
  <Make_Call_Without_Reg_1_ ua="na">No</Make_Call_Without_Reg_1_>
  <Ans_Call_Without_Reg_1_ ua="na">No</Ans_Call_Without_Reg_1_>
  <Line_Navigation ua="na">Per Call</Line_Navigation> 
     
    
     <!-- System Configuration -->

  <Display_Name_1_ ua="na">W Conf RM</Display_Name_1_>
  <User_ID_1_ ua="na">123</User_ID_1_>
      
      <!-- System Configuration -->

  <Password_1_ ua="na">Corproot-Secret</Password_1_>
  <Use_Auth_ID_1_ ua="na">No</Use_Auth_ID_1_>
<Dial_Plan_1_ ua="na">(*xxxxx*xxx|7xxx|1xxS0|[3469]11S0|911S0|[2-9]xxxxxxxxxS0)</Dial_Plan_1_>
  <Line_Enable_2_ ua="na">No</Line_Enable_2_>
  <Line_Enable_3_ ua="na">No</Line_Enable_3_>
  <Line_Enable_4_ ua="na">No</Line_Enable_4_>
  <Log_Missed_Calls_for_EXT_1 ua="na">Yes</Log_Missed_Calls_for_EXT_1>
  <Back_Light_Timer ua="na">Always On</Back_Light_Timer>
    
      <!-- System Configuration -->

  <Station_Name ua="na">W Conf RM</Station_Name>
  <Station_Display_Name ua="na">W Conf RM</Station_Display_Name>
     
      <!-- System Configuration -->

  <Voice_Mail_Number ua="na">*97</Voice_Mail_Number>
    <BMP_Picture_Download_URL ua="na"></BMP_Picture_Download_URL>
  <Select_Logo ua="na"></Select_Logo>
  <Select_Background_Picture ua="na"></Select_Background_Picture>
  <Screen_Saver_Icon ua="rw"></Screen_Saver_Icon>
  <Extension_1_ ua="na">1</Extension_1_>
  <Extension_2_ ua="na">Disabled</Extension_2_>
  <Extension_3_ ua="na">Disabled</Extension_3_>
  <Extension_4_ ua="na">Disabled</Extension_4_>
  <Softkey_Navigation_Style ua="na">More</Softkey_Navigation_Style>
  <Call_Return_Code ua="na"></Call_Return_Code>
  <Blind_Transfer_Code ua="na"></Blind_Transfer_Code>
  <Call_Back_Act_Code ua="na"></Call_Back_Act_Code>
  <Call_Back_Deact_Code ua="na"></Call_Back_Deact_Code>
  <Cfwd_All_Act_Code ua="na"></Cfwd_All_Act_Code>
  <Cfwd_All_Deact_Code ua="na"></Cfwd_All_Deact_Code>
  <Cfwd_Busy_Act_Code ua="na"></Cfwd_Busy_Act_Code>
  <Cfwd_Busy_Deact_Code ua="na"></Cfwd_Busy_Deact_Code>
  <Cfwd_No_Ans_Act_Code ua="na"></Cfwd_No_Ans_Act_Code>
  <Cfwd_No_Ans_Deact_Code ua="na"></Cfwd_No_Ans_Deact_Code>
  <CW_Act_Code ua="na"></CW_Act_Code>
  <CW_Deact_Code ua="na"></CW_Deact_Code>
  <CW_Per_Call_Act_Code ua="na"></CW_Per_Call_Act_Code>
  <CW_Per_Call_Deact_Code ua="na"></CW_Per_Call_Deact_Code>
  <Block_CID_Act_Code ua="na"></Block_CID_Act_Code>
  <Block_CID_Deact_Code ua="na"></Block_CID_Deact_Code>
  <Block_CID_Per_Call_Act_Code ua="na"></Block_CID_Per_Call_Act_Code>
  <Block_CID_Per_Call_Deact_Code ua="na"></Block_CID_Per_Call_Deact_Code>
  <Block_ANC_Act_Code ua="na"></Block_ANC_Act_Code>
  <Block_ANC_Deact_Code ua="na"></Block_ANC_Deact_Code>
  <DND_Act_Code ua="na"></DND_Act_Code>
  <DND_Deact_Code ua="na"></DND_Deact_Code>
  <Secure_All_Call_Act_Code ua="na"></Secure_All_Call_Act_Code>
  <Secure_No_Call_Act_Code ua="na"></Secure_No_Call_Act_Code>
  <Secure_One_Call_Act_Code ua="na"></Secure_One_Call_Act_Code>
  <Secure_One_Call_Deact_Code ua="na"></Secure_One_Call_Deact_Code>
  <Paging_Code ua="na"></Paging_Code>
  <Call_Park_Code ua="na"></Call_Park_Code>
  <Call_Pickup_Code ua="na"></Call_Pickup_Code>
  <Call_UnPark_Code ua="na"></Call_UnPark_Code>
  <Group_Call_Pickup_Code ua="na"></Group_Call_Pickup_Code>
  <Media_Loopback_Code ua="na"></Media_Loopback_Code>
  <Referral_Services_Codes ua="na"></Referral_Services_Codes>
  <Feature_Dial_Services_Codes ua="na"></Feature_Dial_Services_Codes>
  <Service_Annc_Base_Number ua="na"></Service_Annc_Base_Number>
  <Service_Annc_Extension_Codes ua="na"></Service_Annc_Extension_Codes>
  <Prefer_G711u_Code ua="na"></Prefer_G711u_Code>
  <Force_G711u_Code ua="na"></Force_G711u_Code>
  <Prefer_G711a_Code ua="na"></Prefer_G711a_Code>
  <Force_G711a_Code ua="na"></Force_G711a_Code>
  <Prefer_G723_Code ua="na"></Prefer_G723_Code>
  <Force_G723_Code ua="na"></Force_G723_Code>
  <Prefer_G722_Code ua="na"></Prefer_G722_Code>
  <Force_G722_Code ua="na"></Force_G722_Code>
  <Prefer_L16_Code ua="na"></Prefer_L16_Code>
  <Force_L16_Code ua="na"></Force_L16_Code>
  <Prefer_AMR-WB_Code ua="na"></Prefer_AMR-WB_Code>
  <Force_AMR-WB_Code ua="na"></Force_AMR-WB_Code>
  <Prefer_G726r16_Code ua="na"></Prefer_G726r16_Code>
  <Force_G726r16_Code ua="na"></Force_G726r16_Code>
  <Prefer_G726r24_Code ua="na"></Prefer_G726r24_Code>
  <Force_G726r24_Code ua="na"></Force_G726r24_Code>
  <Prefer_G726r32_Code ua="na"></Prefer_G726r32_Code>
  <Force_G726r32_Code ua="na"></Force_G726r32_Code>
  <Prefer_G726r40_Code ua="na"></Prefer_G726r40_Code>
  <Force_G726r40_Code ua="na"></Force_G726r40_Code>
  <Prefer_G729a_Code ua="na"></Prefer_G729a_Code>
  <Force_G729a_Code ua="na"></Force_G729a_Code>
  <Time_Zone ua="na">GMT-06:00</Time_Zone>
  <Daylight_Saving_Time_Rule ua="na">start=3/8/7/2:0:0;end=11/1/7/2:0:0;save=1</Daylight_Saving_Time_Rule>
  <Daylight_Saving_Time_Enable ua="na">Yes</Daylight_Saving_Time_Enable>
  <Locale ua="na">en-US</Locale>
  <Unit_1_Enable ua="na">No</Unit_1_Enable>
  <Unit_2_Enable ua="na">No</Unit_2_Enable>

</flat-profile>

Working SPA514G config with SPA500S add-on module:

<flat-profile>


  <XML_Directory_Service_Name ua="na">Corp Directory</XML_Directory_Service_Name>
  <XML_Directory_Service_URL ua="na">http&#58;&#47;&#47;10.1.1.10&#47;directory&#47;dir.xml</XML_Directory_Service_URL>




<!-- Line Key 2 -->

  <Extension_2_ ua="na">Disabled</Extension_2_> <!-- options: 1/2/3/4/5/6/7/8/9/10/11/12/Disabled -->
  <Short_Name_2_ ua="na">Voicemail</Short_Name_2_>
  <Share_Call_Appearance_2_ ua="na">private</Share_Call_Appearance_2_> <!-- options: private/shared -->
  <Extended_Function_2_ ua="na">fnc=xml;url=http://10.1.1.10/voicemail/voicemail.php?user=101</Extended_Function_2_>

 <!-- Line Key 3 -->

  <Extension_3_ ua="na">Disabled</Extension_3_> <!-- options: 1/2/3/4/5/6/7/8/9/10/11/12/Disabled -->
  <Short_Name_3_ ua="na">Company VM</Short_Name_3_>
  <Share_Call_Appearance_3_ ua="na">private</Share_Call_Appearance_3_> <!-- options: private/shared -->
  <Extended_Function_3_ ua="na">fnc=sd;ext=*[email protected]</Extended_Function_3_>



  <RTP_Packet_Size ua="na">0.020</RTP_Packet_Size>

 <Programmable_Softkey_Enable ua="na">Yes</Programmable_Softkey_Enable>
  <Idle_Key_List ua="na">em_login|1;acd_login|1;acd_logout|1;astate|2;avail|3;unavail|3;redial|5;dir|6;cfwd|7;dnd|8;pickup|10;gpickup|11;unpark|12;guestIn|13;guestOut|13;em_logout</Idle_Key_List>
  <Missed_Call_Key_List ua="na">miss|4</Missed_Call_Key_List>
  <Off_Hook_Key_List ua="na">redial|1;dir|2;cfwd|3</Off_Hook_Key_List>
  <Dialing_Input_Key_List ua="na">dial|1;delchar|2;cancel|3;dir|4</Dialing_Input_Key_List>
  <Progressing_Key_List ua="na">endcall|4</Progressing_Key_List>
  <Connected_Key_List ua="na">xfer|1;bxfer|2;conf|3;endcall|4;toggle;confLx;xferLx;park;phold;flash;</Connected_Key_List>
  <Start-Xfer_Key_List ua="na">hold|1;endcall|2;xfer|4;toggle;</Start-Xfer_Key_List>
  <Start-Conf_Key_List ua="na">hold|1;endcall|2;conf|4;toggle;</Start-Conf_Key_List>
  <Conferencing_Key_List ua="na">hold|1;endcall|2;join|4</Conferencing_Key_List>
  <Releasing_Key_List ua="na">endcall|4;</Releasing_Key_List>
  <Hold_Key_List ua="na">resume|1;endcall|2;newcall|3;redial;dir;cfwd;dnd</Hold_Key_List>
  <Ringing_Key_List ua="na">answer|1;ignore|2;toggle|4</Ringing_Key_List>
  <Shared_Active_Key_List ua="na">newcall|1;barge|2;cfwd|3;dnd|4</Shared_Active_Key_List>
  <Shared_Held_Key_List ua="na">resume|1;barge|2;cfwd|3;dnd|4</Shared_Held_Key_List>
  <PSK_1 ua="na"></PSK_1>
  <PSK_2 ua="na"></PSK_2>
  <PSK_3 ua="na"></PSK_3>
  <PSK_4 ua="na"></PSK_4>
  <PSK_5 ua="na"></PSK_5>
  <PSK_6 ua="na"></PSK_6>
  <PSK_7 ua="na"></PSK_7>
  <PSK_8 ua="na"></PSK_8>
  <PSK_9 ua="na"></PSK_9>
  <PSK_10 ua="na"></PSK_10>
  <PSK_11 ua="na"></PSK_11>
  <PSK_12 ua="na"></PSK_12>
  <PSK_13 ua="na"></PSK_13>
  <PSK_14 ua="na"></PSK_14>
  <PSK_15 ua="na"></PSK_15>
  <PSK_16 ua="na"></PSK_16>


 <Line_Navigation ua="na">Per Call</Line_Navigation>
<Admin_Passwd ua="na">Corp-Secret</Admin_Passwd>
<Signaling_Protocol ua="na">SIP</Signaling_Protocol>
<Connection_Type ua="rw">Static IP</Connection_Type>
 
<!-- System Configuration -->

<Static_IP ua="rw">10.1.1.72</Static_IP>
 
<!-- System Configuration -->

<NetMask ua="rw">255.255.255.0</NetMask>
<Gateway ua="rw">10.1.1.1</Gateway>
<Primary_DNS ua="rw">10.1.1.1</Primary_DNS>
<Secondary_DNS ua="rw">4.2.2.2</Secondary_DNS>
<NTP_Enable ua="na">Yes</NTP_Enable>
<Primary_NTP_Server ua="na">us.pool.ntp.org</Primary_NTP_Server>
<Secondary_NTP_Server ua="na">pool.ntp.org</Secondary_NTP_Server>
<Provision_Enable ua="na">Yes</Provision_Enable>
<Resync_Periodic ua="na">3600</Resync_Periodic>
<Transport_Protocol ua="na">tftp</Transport_Protocol>
<Upgrade_Enable ua="na">Yes</Upgrade_Enable>
<Upgrade_Rule ua="na">( $SWVER ne 7.5.6 )? tftp://10.1.1.10/sw/spa51x-7-5-6.bin</Upgrade_Rule>
<Line_Enable_1_ ua="na">Yes</Line_Enable_1_>
<Proxy_1_ ua="na">10.1.1.10</Proxy_1_>
<Register_1_ ua="na">Yes</Register_1_>
<Make_Call_Without_Reg_1_ ua="na">No</Make_Call_Without_Reg_1_>
<Ans_Call_Without_Reg_1_ ua="na">No</Ans_Call_Without_Reg_1_>
 
    
<!-- System Configuration -->

<Display_Name_1_ ua="na">Val</Display_Name_1_>
<User_ID_1_ ua="na">101</User_ID_1_>

<!-- System Configuration -->

<Password_1_ ua="na">Corp-Secret</Password_1_>
<Use_Auth_ID_1_ ua="na">No</Use_Auth_ID_1_>
<Dial_Plan_1_ ua="na">(*xxxxx*xxx|7xxx|1xxS0|[3469]11S0|911S0|[2-9]xxxxxxxxxS0)</Dial_Plan_1_>
<Line_Enable_2_ ua="na">No</Line_Enable_2_>
<Line_Enable_3_ ua="na">No</Line_Enable_3_>
<Line_Enable_4_ ua="na">No</Line_Enable_4_>
<Log_Missed_Calls_for_EXT_1 ua="na">Yes</Log_Missed_Calls_for_EXT_1>
<Back_Light_Timer ua="na">Always On</Back_Light_Timer>

<!-- System Configuration -->

<Station_Name ua="na">Val</Station_Name>
<Station_Display_Name ua="na">Val</Station_Display_Name>
 
<!-- System Configuration -->

<Voice_Mail_Number ua="na">*97</Voice_Mail_Number>
  <BMP_Picture_Download_URL ua="na"></BMP_Picture_Download_URL>
  <Select_Logo ua="na"></Select_Logo>
  <Select_Background_Picture ua="na"></Select_Background_Picture>
  <Screen_Saver_Icon ua="rw"></Screen_Saver_Icon>
<Extension_1_ ua="na">1</Extension_1_>
<Extension_2_ ua="na">Disabled</Extension_2_>
<Extension_3_ ua="na">Disabled</Extension_3_>
<Extension_4_ ua="na">Disabled</Extension_4_>
<Softkey_Navigation_Style ua="na">More</Softkey_Navigation_Style>
<Call_Return_Code ua="na"></Call_Return_Code>
<Blind_Transfer_Code ua="na"></Blind_Transfer_Code>
<Call_Back_Act_Code ua="na"></Call_Back_Act_Code>
<Call_Back_Deact_Code ua="na"></Call_Back_Deact_Code>
<Cfwd_All_Act_Code ua="na"></Cfwd_All_Act_Code>
<Cfwd_All_Deact_Code ua="na"></Cfwd_All_Deact_Code>
<Cfwd_Busy_Act_Code ua="na"></Cfwd_Busy_Act_Code>
<Cfwd_Busy_Deact_Code ua="na"></Cfwd_Busy_Deact_Code>
<Cfwd_No_Ans_Act_Code ua="na"></Cfwd_No_Ans_Act_Code>
<Cfwd_No_Ans_Deact_Code ua="na"></Cfwd_No_Ans_Deact_Code>
<CW_Act_Code ua="na"></CW_Act_Code>
<CW_Deact_Code ua="na"></CW_Deact_Code>
<CW_Per_Call_Act_Code ua="na"></CW_Per_Call_Act_Code>
<CW_Per_Call_Deact_Code ua="na"></CW_Per_Call_Deact_Code>
<Block_CID_Act_Code ua="na"></Block_CID_Act_Code>
<Block_CID_Deact_Code ua="na"></Block_CID_Deact_Code>
<Block_CID_Per_Call_Act_Code ua="na"></Block_CID_Per_Call_Act_Code>
<Block_CID_Per_Call_Deact_Code ua="na"></Block_CID_Per_Call_Deact_Code>
<Block_ANC_Act_Code ua="na"></Block_ANC_Act_Code>
<Block_ANC_Deact_Code ua="na"></Block_ANC_Deact_Code>
<DND_Act_Code ua="na"></DND_Act_Code>
<DND_Deact_Code ua="na"></DND_Deact_Code>
<Secure_All_Call_Act_Code ua="na"></Secure_All_Call_Act_Code>
<Secure_No_Call_Act_Code ua="na"></Secure_No_Call_Act_Code>
<Secure_One_Call_Act_Code ua="na"></Secure_One_Call_Act_Code>
<Secure_One_Call_Deact_Code ua="na"></Secure_One_Call_Deact_Code>
<Paging_Code ua="na"></Paging_Code>
<Call_Park_Code ua="na"></Call_Park_Code>
<Call_Pickup_Code ua="na"></Call_Pickup_Code>
<Call_UnPark_Code ua="na"></Call_UnPark_Code>
<Group_Call_Pickup_Code ua="na"></Group_Call_Pickup_Code>
<Media_Loopback_Code ua="na"></Media_Loopback_Code>
<Referral_Services_Codes ua="na"></Referral_Services_Codes>
<Feature_Dial_Services_Codes ua="na"></Feature_Dial_Services_Codes>
<Service_Annc_Base_Number ua="na"></Service_Annc_Base_Number>
<Service_Annc_Extension_Codes ua="na"></Service_Annc_Extension_Codes>
<Prefer_G711u_Code ua="na"></Prefer_G711u_Code>
<Force_G711u_Code ua="na"></Force_G711u_Code>
<Prefer_G711a_Code ua="na"></Prefer_G711a_Code>
<Force_G711a_Code ua="na"></Force_G711a_Code>
<Prefer_G723_Code ua="na"></Prefer_G723_Code>
<Force_G723_Code ua="na"></Force_G723_Code>
<Prefer_G722_Code ua="na"></Prefer_G722_Code>
<Force_G722_Code ua="na"></Force_G722_Code>
<Prefer_L16_Code ua="na"></Prefer_L16_Code>
<Force_L16_Code ua="na"></Force_L16_Code>
<Prefer_AMR-WB_Code ua="na"></Prefer_AMR-WB_Code>
<Force_AMR-WB_Code ua="na"></Force_AMR-WB_Code>
<Prefer_G726r16_Code ua="na"></Prefer_G726r16_Code>
<Force_G726r16_Code ua="na"></Force_G726r16_Code>
<Prefer_G726r24_Code ua="na"></Prefer_G726r24_Code>
<Force_G726r24_Code ua="na"></Force_G726r24_Code>
<Prefer_G726r32_Code ua="na"></Prefer_G726r32_Code>
<Force_G726r32_Code ua="na"></Force_G726r32_Code>
<Prefer_G726r40_Code ua="na"></Prefer_G726r40_Code>
<Force_G726r40_Code ua="na"></Force_G726r40_Code>
<Prefer_G729a_Code ua="na"></Prefer_G729a_Code>
<Force_G729a_Code ua="na"></Force_G729a_Code>
<Time_Zone ua="na">GMT-06:00</Time_Zone>
<Daylight_Saving_Time_Rule ua="na">start=3/8/7/2:0:0;end=11/1/7/2:0:0;save=1</Daylight_Saving_Time_Rule>
<Daylight_Saving_Time_Enable ua="na">Yes</Daylight_Saving_Time_Enable>
<Locale ua="na">en-US</Locale>
<Unit_1_Enable ua="na">Yes</Unit_1_Enable>
<Unit_2_Enable ua="na">No</Unit_2_Enable>
<Server_Type ua="na">Asterisk</Server_Type>
<Unit_1_Key_1 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_1>
<Unit_1_Key_2 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_2>
<Unit_1_Key_3 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_3>
<Unit_1_Key_4 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_4>
<Unit_1_Key_5 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_5>
<Unit_1_Key_6 ua="na"/>
<Unit_1_Key_7 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_7>
<Unit_1_Key_8 ua="na"/>
<Unit_1_Key_9 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_9>
<Unit_1_Key_10 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_10>
<Unit_1_Key_11 ua="na"/>
<Unit_1_Key_12 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_12>
<Unit_1_Key_13 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_13>
<Unit_1_Key_14 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_14>
<Unit_1_Key_15 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_15>
<Unit_1_Key_16 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_16>
<Unit_1_Key_17 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_17>
<Unit_1_Key_18 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_18>
<Unit_1_Key_19 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_19>
<Unit_1_Key_20 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_20>
<Unit_1_Key_21 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_21>
<Unit_1_Key_22 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_22>
<Unit_1_Key_23 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_23>
<Unit_1_Key_24 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_24>
<Unit_1_Key_25 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_25>
<Unit_1_Key_26 ua="na">fnc=sd+blf;[email protected]</Unit_1_Key_26>
<Unit_1_Key_27 ua="na"/>
<Unit_1_Key_28 ua="na"/>
<Unit_1_Key_29 ua="na"/>
<Unit_1_Key_30 ua="na"/>
<Unit_1_Key_31 ua="na">fnc=sd+blf;sub=*45101*[email protected]</Unit_1_Key_31>
<Unit_1_Key_32 ua="na">fnc=sd+blf;sub=*[email protected]</Unit_1_Key_32>

</flat-profile>

Example of dir.xml file used by configs above

<CiscoIPPhoneDirectory>
<Title>Corp Directory</Title>
<Prompt>Select a User</Prompt>

<DirectoryEntry>
<Name>Front Desk</Name>
<Telephone>100</Telephone>
</DirectoryEntry>

<DirectoryEntry>
<Name>Customer Service</Name>
<Telephone>101</Telephone>
</DirectoryEntry>

</CiscoIPPhoneDirectory>

Visual Voicemail script used: (voicemail.php)

<?php
$VMDIR="/var/spool/asterisk/voicemail/default";    // Directorio donde se encuentran los mensajes de voz

$URLXML="http://10.1.1.10/voicemail";


$USER=trim($_GET[user]);                // Obtenemos el usuario que queremos consultar
$msg=trim($_GET[msg]);
$call=trim($_GET[call]);




//$USER="0626";        // ESTO HABRA QUE QUITARLO CUANDO 

// Obtenemos los datos y los almacenamos en la estructura
$VMDIR.="/$USER/INBOX";                // Le añadimos el usuario del voicemail
$localdir=opendir($VMDIR);
while ($cnt=readdir($localdir)){
    if ($cnt[0] != "."){
        if (strpos($cnt,".txt") !== false){
        $listaArchivos[]=$cnt;
    }
    }
}
sort($listaArchivos);
for ($t=0; $t<count($listaArchivos); $t++){
    $tmpfile=file($VMDIR."/".$listaArchivos[$t]);
    list($mensaje[$t][archivo])=explode(".",$listaArchivos[$t]);
    for ($f=0; $f<count($tmpfile); $f++){        // Parseamos todas las filas buscando los parámetros
    list($campo,$valor)=explode("=",$tmpfile[$f]);
    $campo=trim($campo); $valor=trim($valor);
    if (($campo != "")&&($valor != "")){
        $mensaje[$t][$campo]=$valor;
    }
    }
}
header ("content-type: text/xml");
if (($USER != "")&&($msg == "") && ($call == "")){                // Mostramos un menú básico con los mensajes que tiene por leer
    echo "<CiscoIPPhoneMenu>\n";
    echo "<Title>Voicemail menu</Title>\n";
    echo "<Prompt>Select a message</Prompt>\n";
    for ($t=0; $t<count($mensaje); $t++){
    list($n,$orig)=explode("<",$mensaje[$t][callerid]);
    list($orig)=explode(">",$orig);
    $fecha=date("m/d g:ia",$mensaje[$t][origtime]);
    $msg=trim($msg);
    if (($USER != "") && ($msg == "")){
        echo "<MenuItem>\n";
        echo "    <Name>$fecha $n ($orig)</Name>\n";               
        echo "    <URL>$URLXML/voicemail.php?user=$USER&amp;msg=$t</URL>\n";
        echo "</MenuItem>\n";
    }
    }
    echo "<SoftKeyItem>\n";
    echo "    <Name>Exit</Name>\n";
    echo "    <URL>Init:Services</URL>\n";       //Force application to close
    echo "    <Position>1</Position>\n";
    echo "</SoftKeyItem>\n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Select</Name>\n";
    echo "    <URL>SoftKey:Select</URL>\n";
    echo "    <Position>2</Position>\n";
    echo "</SoftKeyItem>\n";
    echo "</CiscoIPPhoneMenu>\n";

}elseif (($USER != "")&&($msg != "")&&($call == "")){                // Hemos seleccionado un mensaje, le damos los datos


    echo "<CiscoIPPhoneText>\n";
    echo "<Title>Menu Voicemail</Title>\n";
    echo "<Prompt> </Prompt>\n";
    list($n,$orig)=explode("<",$mensaje[$msg][callerid]);
    list($orig)=explode(">",$orig);
    $fecha=date("m/d/Y g:ia",$mensaje[$msg][origtime]);
    $msg=trim($msg);
    
    echo "<Text>Date: $fecha\n Caller: $n ($orig)\n Length: ".$mensaje[$msg][duration]." Seconds</Text> \n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Exit</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER</URL>\n";
    echo "    <Position>1</Position>\n";
    echo "</SoftKeyItem>\n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Play</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER&amp;msg=$msg&amp;call=1</URL>\n";
    echo "    <Position>2</Position>\n";
    echo "</SoftKeyItem>\n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Delete</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER&amp;msg=$msg&amp;call=3</URL>\n";
    echo "    <Position>3</Position>\n";
    echo "</SoftKeyItem>\n";
    
    echo "</CiscoIPPhoneText>\n";

}elseif (($USER != "")&&($msg != "")&&($call == 1) ){ // Play Message
    $random=rand(100,999);
    $f1=fopen("/tmp/getVoiceMailMsg$random.call","w+");
    //fputs($f1,"Channel: SIP/$USER\n");  If you Use FeePBX and have "Paging and Intercom" Enabled you can uncomment the following line and comment out this line to have the phone auto pickup and start playing your message
    fputs($f1,"Channel: Local/*80$USER@ext-intercom\n"); 
    fputs($f1,"Application: Playback\n");
    fputs($f1,"Data: $VMDIR/".$mensaje[$msg][archivo]."");
    fclose($f1);
    rename("/tmp/getVoiceMailMsg$random.call","/var/spool/asterisk/outgoing/getVoiceMailMsg$random.call");

    echo "<CiscoIPPhoneText>\n";
    echo "<Title>Menu Voicemail</Title>\n";
    echo "<Prompt> </Prompt>\n";
    list($n,$orig)=explode("<",$mensaje[$msg][callerid]);
    list($orig)=explode(">",$orig);
    $fecha=date("m/d/Y g:ia",$mensaje[$msg][origtime]);
    $msg=trim($msg);
    
    echo "<Text>Date: $fecha\n Caller: $n ($orig)\n Length: ".$mensaje[$msg][duration]." Seconds</Text> \n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Exit</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER</URL>\n";
    echo "    <Position>1</Position>\n";
    echo "</SoftKeyItem>\n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Play</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER&amp;msg=$msg&amp;call=1</URL>\n";
    echo "    <Position>2</Position>\n";
    echo "</SoftKeyItem>\n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Delete</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER&amp;msg=$msg&amp;call=3</URL>\n";
    echo "    <Position>3</Position>\n";
    echo "</SoftKeyItem>\n";
    
    echo "</CiscoIPPhoneText>\n";

}elseif (($USER != "")&&($msg != "")&&($call == 3) ){ // Delete Message 
unlink("$VMDIR/".$mensaje[$msg][archivo].".wav");
unlink("$VMDIR/".$mensaje[$msg][archivo].".WAV");
unlink("$VMDIR/".$mensaje[$msg][archivo].".txt");
unlink("$VMDIR/".$mensaje[$msg][archivo].".gsm");


           echo "<CiscoIPPhoneText>\n";
    echo "<Title>Menu Voicemail</Title>\n";
    echo "<Prompt> </Prompt>\n";
    echo "<Text>Message Deleted</Text> \n";
    echo "<SoftKeyItem>\n";
    echo "    <Name>Exit</Name>\n";
    echo "    <URL>$URLXML/voicemail.php?user=$USER</URL>\n";
    echo "    <Position>1</Position>\n";
    echo "</SoftKeyItem>\n";
echo "</CiscoIPPhoneText>\n";    
}

?>